use get_item (in beets HEAD) instead of get_path

This commit is contained in:
Adrian Sampson
2010-07-21 11:18:05 -07:00
parent 5736929acd
commit 6a2df1f1c1
+3 -6
View File
@@ -394,8 +394,7 @@ class FileHandler(object):
subdepth = path.count('/') + 1 subdepth = path.count('/') + 1
# determine the real path # determine the real path
items = self.lib.get_path(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]) self.real_path = self.lib.get_item(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]).path
self.real_path = items[0]
# open the on-disk file for reading # open the on-disk file for reading
self.file_object = open(self.real_path, 'r+') self.file_object = open(self.real_path, 'r+')
@@ -541,8 +540,7 @@ class beetFileSystem(fuse.Fuse):
if len(pathsplit) == structure_depth: if len(pathsplit) == structure_depth:
# it's a file # it's a file
items = self.lib.get_path(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]) item = self.lib.get_item(directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]).path
item = items[0]
if not item: if not item:
# file not found # file not found
@@ -603,7 +601,7 @@ class beetFileSystem(fuse.Fuse):
# if exists, always return allowed for directories # if exists, always return allowed for directories
return 0 return 0
else: else:
item = self.lib.get_path(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]])[0] item = self.lib.get_item(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]).path
if not item: if not item:
return -errno.EACCES return -errno.EACCES
else: else:
@@ -959,7 +957,6 @@ class beetFileSystem(fuse.Fuse):
except: except:
return -errno.EPERM return -errno.EPERM
return self.files[path].read(size, offset) return self.files[path].read(size, offset)
def write(self, path, buf, offset, fh=None): def write(self, path, buf, offset, fh=None):