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

Make itunes compatible optional #1411

Merged
merged 3 commits into from
Apr 30, 2016

Conversation

irfancharania
Copy link
Contributor

in generated xml to address issue #1408

If this is acceptable, I'll update the rspec files as well

@knu
Copy link
Member

knu commented Apr 8, 2016

I think there should be a migration that turns the flag on for existing agents. Otherwise this will break existing feeds that are expected to be the way they are now.

@irfancharania
Copy link
Contributor Author

Good point. How would I do that?

@@ -156,6 +157,12 @@ def feed_description
interpolated['template']['description'].presence || "A feed of Events received by the '#{name}' Huginn Agent"
end

def xml_namespace
if (interpolated['itunes_compatible'] == "true")
Copy link
Member

Choose a reason for hiding this comment

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

Use our boolify helper to handle true as well.

if boolify(interpolated['itunes_compatible'])

@cantino
Copy link
Member

cantino commented Apr 10, 2016

Good idea!

I agree that a spec and migration are needed for this. The migration could probably be similar to db/migrate/20160224120316_add_mode_option_to_ftpsite_agents.rb

@irfancharania
Copy link
Contributor Author

Sounds good. I'll have a look and try to submit later in the week.

@irfancharania
Copy link
Contributor Author

Sorry for taking so long. Hopefully this does the trick?

@@ -24,6 +24,8 @@ class DataOutputAgent < Agent
* `template` - A JSON object representing a mapping between item output keys and incoming event values. Use [Liquid](https://github.com/cantino/huginn/wiki/Formatting-Events-using-Liquid) to format the values. Values of the `link`, `title`, `description` and `icon` keys will be put into the \\<channel\\> section of RSS output. Value of the `self` key will be used as URL for this feed itself, which is useful when you serve it via reverse proxy. The `item` key will be repeated for every Event. The `pubDate` key for each item will have the creation time of the Event unless given.
* `events_to_show` - The number of events to output in RSS or JSON. (default: `40`)
* `ttl` - A value for the \\<ttl\\> element in RSS output. (default: `60`)
* `ns_media` - Add [yahoo media namespace](https://en.wikipedia.org/wiki/Media_RSS) in output xml (default: `true`)
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest removing the "default" words here, since it doesn't actually get set to true unless the user includes ns_media and ns_itunes.

Copy link
Member

Choose a reason for hiding this comment

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

I'd also be happy to make this change and merge-- let me know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I already made the change. It's good to go.

Copy link
Member

Choose a reason for hiding this comment

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

Whoops, thanks!

@cantino
Copy link
Member

cantino commented Apr 26, 2016

Other than my one comment, looks great and worked when I tested the migration.

as per comment
@cantino cantino merged commit 50aff67 into huginn:master Apr 30, 2016
@irfancharania irfancharania deleted the itunes_compatible_rss branch May 1, 2016 00:49
@Warloxx Warloxx mentioned this pull request Aug 27, 2016
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 this pull request may close these issues.

None yet

3 participants