Can add artists to the library
This commit is contained in:
parent
5dc8dc52e9
commit
b391dedc85
|
@ -33,9 +33,20 @@ def addtrk(path):
|
||||||
scanned += 1
|
scanned += 1
|
||||||
try:
|
try:
|
||||||
f = tagpy.FileRef(path)
|
f = tagpy.FileRef(path)
|
||||||
|
t = f.tag()
|
||||||
added += 1
|
added += 1
|
||||||
except:
|
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)):
|
def scan((dir,func)):
|
||||||
|
@ -67,14 +78,10 @@ def go(name):
|
||||||
totthr = needle.Needle(scan,(path,incr))
|
totthr = needle.Needle(scan,(path,incr))
|
||||||
totthr.start()
|
totthr.start()
|
||||||
|
|
||||||
|
# Start a thread to actually add tracks to the db
|
||||||
scthr = needle.Needle(scan,(path,addtrk))
|
scthr = needle.Needle(scan,(path,addtrk))
|
||||||
scthr.start()
|
scthr.start()
|
||||||
|
|
||||||
#scan(path, incr)
|
|
||||||
#write(path)
|
|
||||||
#totthr.join()
|
|
||||||
#write(str(total) + " Files to scan")
|
|
||||||
|
|
||||||
|
|
||||||
def prcnt():
|
def prcnt():
|
||||||
global total
|
global total
|
||||||
|
|
Loading…
Reference in New Issue