Use PDB.get_albums_by_id for Photo.get_albums.

This commit is contained in:
voussoir 2018-04-28 19:17:11 -07:00
parent 62496d183e
commit 41823394eb

View file

@ -873,11 +873,12 @@ class Photo(ObjectBase):
'''
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 == ?',
[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
def get_tags(self):