From 513355e2e510e15e452e6387aecc706fa1605992 Mon Sep 17 00:00:00 2001 From: Eric Le Lay Date: Sat, 26 May 2018 17:21:20 +0200 Subject: [PATCH] fix #513 OPDS updated date format invalid per Atom specification replace space separating date from time with 'T' --- cps/db.py | 3 +++ cps/templates/feed.xml | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cps/db.py b/cps/db.py index 1c274baa..7bb4ab7c 100755 --- a/cps/db.py +++ b/cps/db.py @@ -280,6 +280,9 @@ class Books(Base): self.timestamp, self.pubdate, self.series_index, self.last_modified, self.path, self.has_cover) + @property + def atom_timestamp(self): + return (self.timestamp or '').replace(' ', 'T') class Custom_Columns(Base): __tablename__ = 'custom_columns' diff --git a/cps/templates/feed.xml b/cps/templates/feed.xml index fce047d9..ecdb5f54 100644 --- a/cps/templates/feed.xml +++ b/cps/templates/feed.xml @@ -38,7 +38,7 @@ {{entry.title}} {{entry.uuid}} - {{entry.timestamp}} + {{entry.atom_timestamp}} {{entry.authors[0].name}} @@ -55,7 +55,7 @@ {% endif %} {% for format in entry.data %} + length="{{format.uncompressed_size}}" mtime="{{entry.atom_timestamp}}" type="{{format.format|lower|mimetype}}"/> {% endfor %} {% endfor %}