Can add artists to the library

This commit is contained in:
bjschuma 2010-01-30 18:01:49 -05:00
parent 5dc8dc52e9
commit b391dedc85
1 changed files with 13 additions and 6 deletions

View File

@ -33,9 +33,20 @@ def addtrk(path):
scanned += 1
try:
f = tagpy.FileRef(path)
t = f.tag()
added += 1
except:
pass
return
artist = t.artist
if artist == "":
artist = "Unknown Artist"
sel = sql.Select("id","artist","name='"+artist.replace("\'","\'\'")+"'")
result = sel.execute().fetchall()
write(result)
if result == []:
ins = sql.Insert("artist",[None,artist])
ins.execute()
def scan((dir,func)):
@ -67,14 +78,10 @@ def go(name):
totthr = needle.Needle(scan,(path,incr))
totthr.start()
# Start a thread to actually add tracks to the db
scthr = needle.Needle(scan,(path,addtrk))
scthr.start()
#scan(path, incr)
#write(path)
#totthr.join()
#write(str(total) + " Files to scan")
def prcnt():
global total