kiwix / libkiwix

Common code base for all Kiwix ports
https://download.kiwix.org/release/libkiwix/
GNU General Public License v3.0
112 stars 55 forks source link

Missing Date meta ZIM (invalid) produces non-ISO dc:created/update in OPDS #902

Open rgaudin opened 1 year ago

rgaudin commented 1 year ago

When a book doesn't specify a Date metadata (neither in-ZIM or in the library.xml), the returned OPDS entry includes invalid values for updated and dc:issued.

Given the spec mandates the Date metadata, we should not care much about how to handle it. We've also discussed in other tickets whether to support invalid ZIM at all.

curl 'https://library.kiwix.org/catalog/v2/entry/43b94328-4e20-9ccd-1e07-8d8fa551bfaf'

<?xml version="1.0" encoding="UTF-8"?>
  <entry>
    <id>urn:uuid:43b94328-4e20-9ccd-1e07-8d8fa551bfaf</id>
    <title>Le Dojo de Plume</title>
    <updated>T00:00:00Z</updated>
    <summary>Tu trouveras dans le Dojo de nombreuses activités amusantes pour progresser en français.</summary>
    <language>fra</language>
    <name>plume-app.co_fr_all</name>
    <flavour></flavour>
    <category></category>
    <tags>_ftindex:no;_pictures:yes;_videos:yes;_details:yes</tags>
    <articleCount>191</articleCount>
    <mediaCount>122</mediaCount>
    <link rel="http://opds-spec.org/image/thumbnail"
          href="/catalog/v2/illustration/43b94328-4e20-9ccd-1e07-8d8fa551bfaf/?size=48"
          type="image/png;width=48;height=48;scale=1"/>
    <link type="text/html" href="/content/plume-app.co_fr_all_2021-12" />
    <author>
      <name>Plume</name>
    </author>
    <publisher>
      <name>Kiwix</name>
    </publisher>
    <dc:issued>T00:00:00Z</dc:issued>
    <link rel="http://opds-spec.org/acquisition/open-access" type="application/x-zim" href="https://download.kiwix.org/zim/other/plume-app.co_fr_all_2021-12.zim.meta4" length="7667712" />
  </entry>

Opening this for history's sake but also recreating the ZIM and https://github.com/openzim/python-scraperlib/issues/95.

Incidentally it only concerns a single ZIM 🤷‍♂️

kelson42 commented 1 year ago

See https://github.com/openzim/overview/issues/9#issuecomment-1261037141