Use PDB.get_albums_by_id for Photo.get_albums.

master
voussoir 2018-04-28 19:17:11 -07:00
parent 62496d183e
commit 41823394eb
1 changed files with 3 additions and 2 deletions

View File

@ -873,11 +873,12 @@ class Photo(ObjectBase):
''' '''
Return the albums of which this photo is a member. Return the albums of which this photo is a member.
''' '''
album_rows = self.photodb.sql_select( album_ids = self.photodb.sql_select(
'SELECT albumid FROM album_photo_rel WHERE photoid == ?', 'SELECT albumid FROM album_photo_rel WHERE photoid == ?',
[self.id] [self.id]
) )
albums = [self.photodb.get_album(id=row[0]) for row in album_rows] album_ids = [row[0] for row in album_ids]
albums = list(self.photodb.get_albums_by_id(album_ids))
return albums return albums
def get_tags(self): def get_tags(self):