Rename Album.associated_directories -> get_associated_directories.

This commit is contained in:
voussoir 2018-02-17 13:33:27 -08:00
parent 574ac9f656
commit 6363cb5fc0

View file

@ -335,16 +335,6 @@ class Album(ObjectBase, GroupableMixin):
self.photodb.log.debug('Committing - add tag to all') self.photodb.log.debug('Committing - add tag to all')
self.photodb.commit() self.photodb.commit()
def associated_directories(self):
cur = self.photodb.sql.cursor()
cur.execute(
'SELECT directory FROM album_associated_directories WHERE albumid == ?',
[self.id]
)
directories = [x[0] for x in cur.fetchall()]
directories = [pathclass.Path(x) for x in directories]
return directories
@decorators.required_feature('album.edit') @decorators.required_feature('album.edit')
@decorators.transaction @decorators.transaction
def delete(self, *, delete_children=False, commit=True): def delete(self, *, delete_children=False, commit=True):
@ -392,6 +382,16 @@ class Album(ObjectBase, GroupableMixin):
self.photodb.log.debug('Committing - edit album') self.photodb.log.debug('Committing - edit album')
self.photodb.commit() self.photodb.commit()
def get_associated_directories(self):
cur = self.photodb.sql.cursor()
cur.execute(
'SELECT directory FROM album_associated_directories WHERE albumid == ?',
[self.id]
)
directories = [x[0] for x in cur.fetchall()]
directories = [pathclass.Path(x) for x in directories]
return directories
def get_photos(self): def get_photos(self):
photos = [] photos = []
generator = helpers.select_generator( generator = helpers.select_generator(