Easy file_to_id()

file_to_id() can stat the filepath to find the inode number (aka the
song id).  This is much easier than doing a bunch of lookups.  What I
really want to do eventually is get rid of file_to_id()...
This commit is contained in:
Bryan Schumaker 2010-11-11 22:46:17 -05:00
parent b8eb1817b7
commit 0af81adbcd
1 changed files with 1 additions and 8 deletions

View File

@ -75,14 +75,7 @@ def walk():
yield tag[3]
def file_to_id(file):
global fs_tree
stripped = file.strip(libsaria.path.sep)
split = stripped.split(libsaria.path.sep)
res = fs_tree.walk_path(split)
if res == False:
return None
return res[0]
return os.stat(file).st_ino
def get_attrs(id, *attrs):
res = []