OPDS feed id should be unique

Bug #1756666 reported by Mike Ferenduros
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

As of 3.19, the OPDS root feed's id is always 'urn:calibre:main', whereas Atom requires that this be a globally unique identifier.

I can't use the network address as a feed ID as it's not stable (eg DHCP), nor unique (eg. two feeds on two different LANs may share an IP or MDNS name).

Right now my app is identifying all calibre OPDS feeds as the same feed, which effectively means the user is only able to subscribe to a single such feed in the app.

Any chance of making this id globally unique? I'm unfamiliar with the code (and Python), but is library_id suitable for constructing a per-installation UUID?

Tags: opds
Revision history for this message
Kovid Goyal (kovid) wrote :

I'm somewhat unclear on what you are asking for. You want two different calibre installs to generate different ids? Why would a user be running two different calibre installs?

If so, I dont want to do that, as doing that might break other apps that depend on the id value to recognize calibre feeds. However, I'm willing to expose the calibre installation id which is unique per install elsewhere in the feed.

Revision history for this message
Mike Ferenduros (klassobanieras) wrote : Re: [Bug 1756666] Re: OPDS feed id should be unique

 Hi!

Yep, I was indeed hoping that each install could have a globally unique root feed id.

A user might not themself run two calibre installations, but I know of quite a few users subscribed to multiple calibre feeds in my app (chunky comic reader). Currently it deals with this ok but the rewrite of the app will not.

But yep, a uuid in a calibre-specific element elsewhere in /feed would do the trick for my purposes.

Cheers

Mike

>
> On Mar 18, 2018 at 2:35 PM, <Kovid Goyal (mailto:<email address hidden>)> wrote:
>
>
>
> I'm somewhat unclear on what you are asking for. You want two different
> calibre installs to generate different ids? Why would a user be running
> two different calibre installs?
>
> If so, I dont want to do that, as doing that might break other apps that
> depend on the id value to recognize calibre feeds. However, I'm willing
> to expose the calibre installation id which is unique per install
> elsewhere in the feed.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1756666
>
> Title:
> OPDS feed id should be unique
>
> Status in calibre:
> New
>
> Bug description:
> As of 3.19, the OPDS root feed's id is always 'urn:calibre:main',
> whereas Atom requires that this be a globally unique identifier.
>
> I can't use the network address as a feed ID as it's not stable (eg
> DHCP), nor unique (eg. two feeds on two different LANs may share an IP
> or MDNS name).
>
> Right now my app is identifying all calibre OPDS feeds as the same
> feed, which effectively means the user is only able to subscribe to a
> single such feed in the app.
>
> Any chance of making this id globally unique? I'm unfamiliar with the
> code (and Python), but is library_id suitable for constructing a per-
> installation UUID?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/calibre/+bug/1756666/+subscriptions
>

Revision history for this message
Kovid Goyal (kovid) wrote : Re: calibre bug 1756666

OK if you have any preferences for where you want it, let me know.

Revision history for this message
Mike Ferenduros (klassobanieras) wrote : Re: [Bug 1756666] Re: calibre bug 1756666

How about in the ‘xml:base’ attribute of the id tag?
Eg. <id xml:base=‘urn:calibre:library:123456’>urn:calibre:main<id>

It kinda conveys the meaning, without introducing any new attributes or tags (or affecting how id is parsed).

But if you’d prefer to make it more obvious that it’s calibre-specific, any attribute-name (or a separate tag, even) would be just as good.

Thanks for taking the time btw :)

> On 18 Mar 2018, at 19:19, Kovid Goyal <email address hidden> wrote:
>
> OK if you have any preferences for where you want it, let me know.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1756666
>
> Title:
> OPDS feed id should be unique
>
> Status in calibre:
> New
>
> Bug description:
> As of 3.19, the OPDS root feed's id is always 'urn:calibre:main',
> whereas Atom requires that this be a globally unique identifier.
>
> I can't use the network address as a feed ID as it's not stable (eg
> DHCP), nor unique (eg. two feeds on two different LANs may share an IP
> or MDNS name).
>
> Right now my app is identifying all calibre OPDS feeds as the same
> feed, which effectively means the user is only able to subscribe to a
> single such feed in the app.
>
> Any chance of making this id globally unique? I'm unfamiliar with the
> code (and Python), but is library_id suitable for constructing a per-
> installation UUID?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/calibre/+bug/1756666/+subscriptions

Revision history for this message
Kovid Goyal (kovid) wrote :

Hmm according to RFC 4287 xml:base can influence how relative URIs are resolved. The other option, which will likely lead to the lowest change of disrpution would be to use an HTTP header, something like calibre-opds-instance-id. Woudl that work with your app?

Revision history for this message
Mike Ferenduros (klassobanieras) wrote : Re: [Bug 1756666] Re: OPDS feed id should be unique

 Sure, that’d be great.

 Cheers

 Mike

>
> On Mar 19, 2018 at 3:12 PM, <Kovid Goyal (mailto:<email address hidden>)> wrote:
>
>
>
> Hmm according to RFC 4287 xml:base can influence how relative URIs are
> resolved. The other option, which will likely lead to the lowest change
> of disrpution would be to use an HTTP header, something like calibre-
> opds-instance-id. Woudl that work with your app?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1756666
>
> Title:
> OPDS feed id should be unique
>
> Status in calibre:
> New
>
> Bug description:
> As of 3.19, the OPDS root feed's id is always 'urn:calibre:main',
> whereas Atom requires that this be a globally unique identifier.
>
> I can't use the network address as a feed ID as it's not stable (eg
> DHCP), nor unique (eg. two feeds on two different LANs may share an IP
> or MDNS name).
>
> Right now my app is identifying all calibre OPDS feeds as the same
> feed, which effectively means the user is only able to subscribe to a
> single such feed in the app.
>
> Any chance of making this id globally unique? I'm unfamiliar with the
> code (and Python), but is library_id suitable for constructing a per-
> installation UUID?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/calibre/+bug/1756666/+subscriptions
>

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in master

Fixed in branch master. The fix will be in the next release. calibre is usually released every alternate Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.