Fix media display for no media_data row in sql.
If there is no media_data row for the current media (for whatever reason, there might be good ones), let MediaEntry.media_data not raise an exception but just return None. The exif display part now handles this by checking whether .media_data.exif is defined (None has no attribute exif, so it's undefined, all fine).
This commit is contained in:
@@ -176,7 +176,7 @@ class MediaEntry(Base, MediaEntryMixin):
|
||||
session = Session()
|
||||
|
||||
return session.query(self.media_data_table).filter_by(
|
||||
media_entry=self.id).one()
|
||||
media_entry=self.id).first()
|
||||
|
||||
def media_data_init(self, **kwargs):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user