Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
bdf9ab36
Commit
bdf9ab36
authored
9 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add support for all the iTunes channel tags.
iTunes item tag support still doesn't exist.
parent
7c50757d
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/podcast.js
+45
-8
45 additions, 8 deletions
exec/podcast.js
with
45 additions
and
8 deletions
exec/podcast.js
+
45
−
8
View file @
bdf9ab36
...
...
@@ -14,6 +14,9 @@ var item_info;
function
encode_xml
(
str
)
{
print
(
"
Encoding: '
"
+
str
+
"
'
"
);
if
(
str
==
undefined
)
return
''
;
str
=
str
.
toString
();
str
=
str
.
replace
(
/&/g
,
'
&
'
);
str
=
str
.
replace
(
/</g
,
'
<
'
);
...
...
@@ -23,18 +26,20 @@ function encode_xml(str)
return
str
;
}
function
add_channel_opt_attribute
(
name
)
{
if
(
opts
[
name
]
!==
undefined
)
{
var
xml_name
=
name
.
substr
(
0
,
1
).
toLowercase
()
+
name
.
substr
(
1
);
out
.
write
(
'
\t\t
<
'
+
xml_name
+
'
>
'
+
encode_xml
(
opts
[
name
])
+
'
</
'
+
xml_name
+
'
>
\n
'
);
}
}
function
add_channel_opt_attribute_rename
(
name
,
newName
)
{
if
(
opts
[
name
]
!==
undefined
)
out
.
write
(
'
\t\t
<
'
+
newName
+
'
>
'
+
encode_xml
(
opts
[
name
])
+
'
</
'
+
newName
+
'
>
\n
'
);
}
function
add_channel_opt_attribute
(
name
)
{
var
xml_name
=
name
.
substr
(
0
,
1
).
toLowerCase
()
+
name
.
substr
(
1
);
add_channel_opt_attribute_rename
(
name
,
xml_name
);
}
function
add_channel_itunes_attribute
(
name
)
{
add_channel_opt_attribute_rename
(
'
IT
'
+
name
,
'
itunes:
'
+
name
.
substr
(
0
,
1
).
toLowerCase
()
+
name
.
substr
(
1
));
}
function
create_item_xml
(
base
,
hdr
)
{
var
info
;
var
item
;
...
...
@@ -163,7 +168,39 @@ 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
'
);
add_channel_itunes_attribute
(
'
Author
'
);
add_channel_itunes_attribute
(
'
Block
'
);
if
(
opts
.
ITImageURL
!=
undefined
)
{
out
.
write
(
'
\t\t
<itunes:image href="
'
+
encode_xml
(
opts
.
ITImageURL
)
+
'
">
\n
'
);
}
else
if
(
opts
.
ImageURL
!=
undefined
)
{
out
.
write
(
'
\t\t
<itunes:image href="
'
+
encode_xml
(
opts
.
ImageURL
)
+
'
">
\n
'
);
}
if
(
opts
.
ITCategory
!=
undefined
)
{
if
((
m
=
opts
.
ITCategory
.
match
(
/^
\s
*
([^\/]
+
)\/(
.+
?)\s
*$/
))
!=
null
)
{
out
.
write
(
'
\t\t
<itunes:category text="
'
+
encode_xml
(
m
[
1
])
+
'
">
\n
'
);
out
.
write
(
'
\t\t\t
<itunes:category text="
'
+
encode_xml
(
m
[
2
])
+
'
" />
\n
'
);
out
.
write
(
'
\t\t
</itunes:category>
\n
'
);
}
else
{
out
.
write
(
'
\t\t
<itunes:category text="
'
+
encode_xml
(
opts
.
ITCategory
)
+
'
" />
\n
'
);
}
}
add_channel_itunes_attribute
(
'
Explicit
'
);
add_channel_itunes_attribute
(
'
Complete
'
);
add_channel_opt_attribute_rename
(
'
ITNewFeedURL
'
,
'
itunes:new-feed-url
'
);
if
(
opts
.
ITOwnerEmail
!=
undefined
)
{
out
.
write
(
'
\t\t
<itunes:owner>
\n
'
);
out
.
write
(
'
\t
'
);
add_channel_opt_attribute_rename
(
'
ITOwnerEmail
'
,
'
itunes:email
'
);
if
(
opts
.
ITOwnerName
!=
undefined
)
{
out
.
write
(
'
\t
'
);
add_channel_opt_attribute_rename
(
'
ITOwnerName
'
,
'
itunes:name
'
);
}
out
.
write
(
'
\t\t
</itunes:owner>
\n
'
);
}
add_channel_itunes_attribute
(
'
Subtitle
'
);
add_channel_itunes_attribute
(
'
Summary
'
);
out
.
write
(
'
\t\t
<atom:link href="
'
+
opts
.
FeedURI
+
'
" rel="self" type="application/rss+xml" />
\n
'
);
for
(
i
=
hdrs
.
length
-
1
;
i
>=
0
;
i
--
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment