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]
|
yield tag[3]
|
||||||
|
|
||||||
def file_to_id(file):
|
def file_to_id(file):
|
||||||
global fs_tree
|
return os.stat(file).st_ino
|
||||||
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]
|
|
||||||
|
|
||||||
def get_attrs(id, *attrs):
|
def get_attrs(id, *attrs):
|
||||||
res = []
|
res = []
|
||||||
|
|
Loading…
Reference in New Issue