From d6abfab2abe3783a810e486f6c9e019a31b9acbe Mon Sep 17 00:00:00 2001 From: bjschuma Date: Sat, 2 Jan 2010 01:14:54 -0500 Subject: [PATCH] Pull out song length, too --- src/core/extract.py | 3 ++- src/core/tools/database.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/extract.py b/src/core/extract.py index cd5eb6c2..0bd6c692 100644 --- a/src/core/extract.py +++ b/src/core/extract.py @@ -112,4 +112,5 @@ def run(file=None): # Insert the track if it is new trid,inserted = findId("track",title) if inserted == False: - database.insert("track", (trid,arid,alid,0,title,file[len(root):])) + a = f.audioProperties() + database.insert("track", (trid,arid,alid,0,a.length,title,file[len(root):])) diff --git a/src/core/tools/database.py b/src/core/tools/database.py index 8e69eda2..10458527 100644 --- a/src/core/tools/database.py +++ b/src/core/tools/database.py @@ -67,6 +67,7 @@ def create(): artist INTEGER, album INTEGER, count INTEGER, + length INTEGER, name TEXT, path TEXT UNIQUE ); @@ -79,7 +80,7 @@ def create(): vals["artist"]= "?,?" vals["album"] = "?,?" vals["library"] = "?,?,?" - vals["track"] = "?,?,?,?,?,?" + vals["track"] = "?,?,?,?,?,?,?"