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:
parent
b8eb1817b7
commit
0af81adbcd
|
@ -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 = []
|
||||
|
|
Loading…
Reference in New Issue