fix #513 OPDS updated date format invalid per Atom specification

replace space separating date from time with 'T'
pull/514/head
Eric Le Lay 7 years ago
parent 9867959916
commit 513355e2e5

@ -280,6 +280,9 @@ class Books(Base):
self.timestamp, self.pubdate, self.series_index, self.timestamp, self.pubdate, self.series_index,
self.last_modified, self.path, self.has_cover) self.last_modified, self.path, self.has_cover)
@property
def atom_timestamp(self):
return (self.timestamp or '').replace(' ', 'T')
class Custom_Columns(Base): class Custom_Columns(Base):
__tablename__ = 'custom_columns' __tablename__ = 'custom_columns'

@ -38,7 +38,7 @@
<entry> <entry>
<title>{{entry.title}}</title> <title>{{entry.title}}</title>
<id>{{entry.uuid}}</id> <id>{{entry.uuid}}</id>
<updated>{{entry.timestamp}}</updated> <updated>{{entry.atom_timestamp}}</updated>
<author> <author>
<name>{{entry.authors[0].name}}</name> <name>{{entry.authors[0].name}}</name>
</author> </author>
@ -55,7 +55,7 @@
{% endif %} {% endif %}
{% for format in entry.data %} {% for format in entry.data %}
<link rel="http://opds-spec.org/acquisition" href="{{ url_for('get_opds_download_link', book_id=entry.id, book_format=format.format|lower)}}" <link rel="http://opds-spec.org/acquisition" href="{{ url_for('get_opds_download_link', book_id=entry.id, book_format=format.format|lower)}}"
length="{{format.uncompressed_size}}" mtime="{{entry.timestamp}}" type="{{format.format|lower|mimetype}}"/> length="{{format.uncompressed_size}}" mtime="{{entry.atom_timestamp}}" type="{{format.format|lower|mimetype}}"/>
{% endfor %} {% endfor %}
</entry> </entry>
{% endfor %} {% endfor %}

Loading…
Cancel
Save