Add <guid> fields to episodes
richardcornish opened this issue · 1 comments
The <guid>
of each show's episode is currently the enclosure's URL of the media file. This is an OK solution, but it works only under certain conditions:
- If hosting providers change,
MEDIA_URL
changes, breaking sync with Apple's<guid>
s - If the media files are hosted on the same domain as the show, and if the domain name changes, the URLs also change again, breaking sync again
- If an episode's enclosure is updated with a new file "version" (say with better audio, editing, etc.), and if the file name is different (which is likely), the URL changes, and the
<guid>
breaks again
Additionally, Apple calls out <guid>
in its updated specification, although no new syntax changes have occurred, likely indicating that Apple is relying more heavily on <guid>
s in iOS 11:
The globally unique identifier (GUID) string for your episode. Every tag (episode) should have a permanent, case-sensitive GUID. When you add episodes to your RSS feed, GUIDs are compared in case-sensitive fashion to determine which episodes are new. If you don’t add the GUID for an episode, the episode URL is used instead. Assign the GUID to an episode only once and never change it. Assigning new GUIDs to existing episodes can cause issues with your podcast’s listing and chart placement in Apple Podcasts.
Lastly, Django provides a native UUID model field solution meant specifically to solve this problem. The field should be on the episode and not the enclosure because then it would more closely match the specification.
The various IDs generated by Python, including uuid4
, generate unique but irreproducible IDs because they depend on heuristics of the computer or are random. It's probably better to go with a saltless hashing of a field of the model that isn't subject to editing by the user, probably the primary key.