From 7c50757d493f7621e0143f71c9103fac9b3e8645 Mon Sep 17 00:00:00 2001
From: deuce <>
Date: Mon, 11 May 2015 00:22:13 +0000
Subject: [PATCH] Add add_channel_opt_attribute_rename() and support for
 ITExplicit for the itunes:explicit tag.

---
 exec/podcast.js | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/exec/podcast.js b/exec/podcast.js
index 2b3493f087..fa637c1c7e 100644
--- a/exec/podcast.js
+++ b/exec/podcast.js
@@ -30,6 +30,11 @@ function add_channel_opt_attribute(name) {
 	}
 }
 
+function add_channel_opt_attribute_rename(name, newName) {
+	if (opts[name] !== undefined)
+		out.write('\t\t<'+newName+'>'+encode_xml(opts[name])+'</'+newName+'>\n');
+}
+
 function create_item_xml(base, hdr) {
 	var info;
 	var item;
@@ -140,8 +145,7 @@ add_channel_opt_attribute('Category');
 out.write('\t\t<generator>Synchronet Podcast Script '+("$Revision$".split(' ')[1])+'</generator>\n');
 add_channel_opt_attribute('Docs');
 // TODO: cloud (fancy!)
-if (opts.TTL != undefined)
-	out.write('\t\t<ttl>'+encode_xml(opts.TTL)+'</ttl>\n');
+add_channel_opt_attribute_rename('TTL', 'ttl');
 if (opts.ImageURL != undefined) {
 	img_title = opts.ImageTitle == undefined ? opts.Title : opts.ImageTitle;
 	img_link = opts.ImageLink == undefined ? opts.Link : opts.ImageLink;
@@ -159,6 +163,7 @@ add_channel_opt_attribute('Rating');
 // TODO: textInput?
 add_channel_opt_attribute('SkipHours');
 add_channel_opt_attribute('SkipDays');
+add_channel_opt_attribute_rename('ITExplicit', 'itunes:explicit');
 out.write('\t\t<atom:link href="'+opts.FeedURI+'" rel="self" type="application/rss+xml" />\n');
 
 for (i=hdrs.length - 1; i >= 0; i--) {
-- 
GitLab