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: support for lowercased episodeType values #48

Conversation

liberlanco
Copy link
Contributor

I met this issue with following RSS: https://feeds.fireside.fm/smartlogic/rss

They uses lowercase values for episodeType like 'trailer' or 'full'. I tried 2 different RSS readers with the URL and all of them read this feed without problems (liferea and some from flatpack, forget the name).

ruby/rss raises exception:

RSS::NotAvailableValueError: value <trailer> of tag <episodeType> is not available. (RSS::NotAvailableValueError)

I also tried RSS validator, and it gave many errors but not about episodeType value: https://www.rssboard.org/rss-validator/check.cgi?url=https%3A%2F%2Ffeeds.fireside.fm%2Fsmartlogic%2Frss

Hence I understood that official specs defines Full, Trailer and Bonus as legal values for this XML tag, but looks like it's already common practice to use lowercase values (even validator doesn't think it's bad)

So here is the patch to support them + small test update with lowercase value

@kou
Copy link
Member

kou commented Dec 29, 2023

I can understand what you think but please disable validation for this case. (And please feedback this to fireside.fm if you want.)
If we provide a "loose" validation, users can't trust validated feeds. Users need some workarounds even with validated feeds. For example, users need to normalize case for this case.

In general, feed readers parse feed loosely as much as possible because there are many broken feeds in the world and feed readers needs to process them as much as possible.

@@ -593,7 +593,7 @@ def itunes_episode_type_writer(name, disp_name=name)
module_eval(<<-DEF, *get_file_and_line_from_caller(2))
def #{name}=(new_value)
if @do_validate and
!["Full", "Trailer", "Bonus", nil].include?(new_value)
!["full", "trailer", "bonus", nil].include?(new_value.downcase)
Copy link
Member

Choose a reason for hiding this comment

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

Could you accept only Full/full variants? (We don't want to accept FULL, fULL and so on.

Suggested change
!["full", "trailer", "bonus", nil].include?(new_value.downcase)
!["Full", "full", "Trailer", "trailer", "Bonus", "bonus", nil].include?(new_value)

@kou
Copy link
Member

kou commented May 25, 2024

Apple uses full/trailer/bonus too internally.
See also: #51 (comment)

@kou
Copy link
Member

kou commented Aug 2, 2024

Implemented by #53.

@kou kou closed this Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants