diff --git a/etiquette/jsonify.py b/etiquette/jsonify.py index 395e940..95c030b 100644 --- a/etiquette/jsonify.py +++ b/etiquette/jsonify.py @@ -33,7 +33,7 @@ def photo(p, include_albums=True, include_tags=True): 'ratio': p.ratio, 'area': p.area, 'bytes': p.bytes, - 'duration_str': p.duration_string(), + 'duration_str': p.duration_string, 'duration': p.duration, 'bytes_str': p.bytestring(), 'has_thumbnail': bool(p.thumbnail), diff --git a/etiquette/objects.py b/etiquette/objects.py index 6b679dd..dcca034 100644 --- a/etiquette/objects.py +++ b/etiquette/objects.py @@ -505,6 +505,7 @@ class Photo(ObjectBase): self.photodb.log.debug('Committing - delete photo') self.photodb.commit() + @property def duration_string(self): if self.duration is None: return None diff --git a/templates/photo.html b/templates/photo.html index 23e30c2..b30fb5e 100644 --- a/templates/photo.html +++ b/templates/photo.html @@ -169,7 +169,7 @@ {% endif %}
  • Size: {{photo.bytestring()}}
  • {% if photo.duration %} -
  • Duration: {{photo.duration_string()}}
  • +
  • Duration: {{photo.duration_string}}
  • {% endif %}
  • Download as {{photo.id}}.{{photo.extension}}
  • Download as "{{photo.basename}}"
  • diff --git a/templates/photo_card.html b/templates/photo_card.html index ed8c68d..8b12a63 100644 --- a/templates/photo_card.html +++ b/templates/photo_card.html @@ -60,7 +60,7 @@ {{photo.width}}×{{photo.height}}, {% endif %} {% if photo.duration %} - {{photo.duration_string()}}, + {{photo.duration_string}}, {% endif %} {{photo.bytestring()}}