From 6a2df1f1c1d52d4dc788b0d2e8d50683bc8d6e2a Mon Sep 17 00:00:00 2001 From: Adrian Sampson Date: Wed, 21 Jul 2010 11:18:05 -0700 Subject: [PATCH] use get_item (in beets HEAD) instead of get_path --- beetsplug/beetFs.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/beetsplug/beetFs.py b/beetsplug/beetFs.py index 844578f..1b4391b 100644 --- a/beetsplug/beetFs.py +++ b/beetsplug/beetFs.py @@ -394,8 +394,7 @@ class FileHandler(object): subdepth = path.count('/') + 1 # 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 = items[0] + self.real_path = self.lib.get_item(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]).path # open the on-disk file for reading self.file_object = open(self.real_path, 'r+') @@ -541,8 +540,7 @@ class beetFileSystem(fuse.Fuse): if len(pathsplit) == structure_depth: # it's a file - items = self.lib.get_path(id=directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]) - item = items[0] + item = self.lib.get_item(directory_structure.getnode(pathsplit[0:structure_depth-1]).files[pathsplit[structure_depth-1]]).path if not item: # file not found @@ -603,7 +601,7 @@ class beetFileSystem(fuse.Fuse): # if exists, always return allowed for directories return 0 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: return -errno.EACCES else: @@ -959,7 +957,6 @@ class beetFileSystem(fuse.Fuse): except: return -errno.EPERM - return self.files[path].read(size, offset) def write(self, path, buf, offset, fh=None):