Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Store a backend GUID hash for RSS-derived episodes #81

Closed
dariusk opened this issue Jan 18, 2018 · 0 comments
Closed

Store a backend GUID hash for RSS-derived episodes #81

dariusk opened this issue Jan 18, 2018 · 0 comments
Assignees
Labels
Milestone

Comments

@dariusk
Copy link
Contributor

dariusk commented Jan 18, 2018

We need to create a more universal way to tag inactive (or active) episodes. TAL numbers all of their episodes sequentially but not every podcast does that, and we can't infer a constant number from an RSS feed (even if we do a chronological inference, there's no guarantee the feed holds all episodes. so if a feed holds the last 5 episodes, episode "1" will change every time it's updated with a new one and the window shifts).

The RSS spec indicates that <guid></guid> should hold a global ID but of course these are usually unwieldy URIs. Inspecting Google Music, it seems like what they do is hash the GUID, which makes some sense.

So, proposal:

const crypto = require('crypto');
...
let hash = crypto.createHash('md5').update('https://ourGUIDuriorwhatever.com/episode275.html').digest('hex');

We then assign this to a "invisible" item ID that we use in our URL routing and store clientside on the individual episode listing as a data-guid data-attribute in its html.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants