Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iTunes extension not working while the extensions map does contain the respective information #158

Closed
SamTV12345 opened this issue Jan 9, 2024 · 8 comments · Fixed by #159

Comments

@SamTV12345
Copy link

I use your crate which works really smooth in one of my projects: SamTV12345/PodFetch#492 . Unfortunately the itunes extension doesn't work with one of the podcasts a user tried to download. Maybe you have an idea why the extensions map is filled with the image tag while the itunes_extensions shows None.

I created a reproducible here: https://gitlab.com/samtv12345/rss-crate-bug-report. Just run cargo run and you should see that itunes extension is none while the map contains the information. Do you have an idea why @andy128k ?

@andy128k
Copy link
Member

Extensions are recognized by a namespace URI. iTunes URI in your example is http://www.itunes.com/DTDs/Podcast-1.0.dtd while the crate looks for http://www.itunes.com/dtds/podcast-1.0.dtd.

@SamTV12345
Copy link
Author

Wouldn't a toLowercase comparison solve the issue?

@SamTV12345
Copy link
Author

If you'd like to I can add a pull request for this. @andy128k

@andy128k
Copy link
Member

Tough question. Formally URIs are case sensitive and such a change may be risky.

@SamTV12345
Copy link
Author

Good point. The question is will someone else create a schema that is equal to the iTunes url but change a character in the url to lower/uppercase. Probably not. So I think the chance of breaking an existing project using your library is very minimal.

@andy128k
Copy link
Member

https://help.apple.com/itc/podcasts_connect/#/itcb54353390

Without this declaration, Podcasts Connect ignores all tags specific to Apple Podcasts. The namespace definition is case sensitive, and must be entered as shown.


It's not about someone creating a schema (that's unlikely and that should be someone with access to www.itunes.com domain).

But someone may create a feed with multiple namespaces:

<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:ITUNES="http://www.itunes.com/DTDs/Podcast-1.0.dtd" version="2.0">
   <channel>
       <itunes:author>Author 1</itunes:author>
       <ITUNES:author>Author 2</ITUNES:author>
   </channel>
</rss>

Now we have an issue with merging formally two extensions into a single one. OTOH someone may create an alias like <rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:ITUNES="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0"> and we still have this problem.

I'd say, this is much bigger issue than just add toLowercase.

@andy128k
Copy link
Member

So, I reviewed the code and it seems that I overestimated the complexity. It looks a bit easier now #159.

@SamTV12345
Copy link
Author

Thank you for the changes 😃.

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 a pull request may close this issue.

2 participants