Skip to content

Conversation

@x0000ff
Copy link
Contributor

@x0000ff x0000ff commented Oct 14, 2025

The OPDS 1.x is based on Atom, and Atom’s Feed must contain an id tag. I found it useful to parse the <id> tag.

1.1. Introduction
The Open Publication Distribution System (OPDS) Catalog format is a syndication format for electronic publications based on Atom [RFC4287] and HTTP [RFC2616].

atom:feed elements MUST contain exactly one atom:id element.

I left it as optional to avoid breaking compatibility with existing clients.

  • ✅ Tests are updated

@x0000ff x0000ff changed the title Parse the feed identifier for OPDS 1.x Implement parsing of the <id> element in OPDS 1.x feeds Oct 14, 2025
@x0000ff x0000ff force-pushed the feature/parse-feed-id-for-opds-1.0 branch 2 times, most recently from 9e2b993 to 2b15c8c Compare October 14, 2025 20:03
@x0000ff x0000ff force-pushed the feature/parse-feed-id-for-opds-1.0 branch from 2b15c8c to 07f3a99 Compare October 21, 2025 13:36
Copy link
Member

@mickael-menu mickael-menu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, thank you. Please note that we will revamp the OPDS models next year, and this kind of information will be available as part of the extension models for metadata instead of a native property.

@mickael-menu mickael-menu merged commit 8875768 into readium:develop Oct 21, 2025
5 checks passed
@x0000ff x0000ff deleted the feature/parse-feed-id-for-opds-1.0 branch October 21, 2025 16:14
@x0000ff
Copy link
Contributor Author

x0000ff commented Oct 22, 2025

Thanks a lot for merging my PRs, @mickael-menu!

Looking good, thank you. Please note that we will revamp the OPDS models next year, and this kind of information will be available as part of the extension models for metadata instead of a native property.

Can I find this written somewhere, such as in the issues? I’m about to submit another PR and don’t want to waste your time reviewing something that isn’t aligned with future plans.

@mickael-menu
Copy link
Member

It's not documented anywhere but it should look like the otherMetadata in the Publication's Metadata models:

/// Additional properties for extensions.
public var otherMetadata: JSONDictionary.Wrapped {
get { otherMetadataJSON.json }
set { otherMetadataJSON = JSONDictionary(newValue) ?? JSONDictionary() }
}
// Trick to keep the struct equatable despite [String: Any]
private var otherMetadataJSON: JSONDictionary

and the metadata keys will be expanded with the XML namespace, similarly to this with EPUB:

otherMetadata: [
"http://purl.org/dc/terms/source": [
"Feedbooks",
[
"@value": "Web",
"http://my.url/#scheme": "http",
],
"Internet",
] as [Any],
"http://purl.org/dc/terms/rights": "Public Domain",
"http://idpf.org/epub/vocab/package/#type": "article",
"http://my.url/#customProperty": [
"@value": "Custom property",
"http://my.url/#refine1": "Refine 1",
"http://my.url/#refine2": "Refine 2",
],
"http://purl.org/dc/terms/format": "application/epub+zip",
"http://www.idpf.org/vocab/rendition/#flow": "scrolled-doc",
"http://www.idpf.org/vocab/rendition/#orientation": "landscape",
"http://www.idpf.org/vocab/rendition/#spread": "both",

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants