|
@@ -2,6 +2,8 @@
|
|
|
* Represents a single show. This show could be defined in the shows.xml file, or could be inferred from the
|
|
|
* schedule.
|
|
|
*/
|
|
|
+
|
|
|
+
|
|
|
class RadioShow {
|
|
|
constructor(name, description, website, feed, schedule, radio_calendar) {
|
|
|
this.name = name
|
|
@@ -44,7 +46,7 @@ function parseRadioShows(xml) {
|
|
|
}
|
|
|
let website = doc.evaluate('./info/metadata/show:website', bm, showsNamespaceResolver, XPathResult.STRING_TYPE).stringValue
|
|
|
if (website === '') {
|
|
|
- website = getAttribute(bm, 'href', null)
|
|
|
+ website = bm.getAttribute('href')
|
|
|
}
|
|
|
const feed = doc.evaluate('./info/metadata/show:feed', bm, showsNamespaceResolver, XPathResult.STRING_TYPE).stringValue
|
|
|
const schedule = doc.evaluate('./info/metadata/show:schedule', bm, showsNamespaceResolver, XPathResult.STRING_TYPE).stringValue
|
|
@@ -70,7 +72,7 @@ async function getShows(manifest) {
|
|
|
}
|
|
|
if (resp !== null) {
|
|
|
try {
|
|
|
- text = await resp.text()
|
|
|
+ const text = await resp.text()
|
|
|
const parser = new DOMParser()
|
|
|
const showsDom = parser.parseFromString(text, 'text/xml')
|
|
|
return parseRadioShows(showsDom)
|
|
@@ -90,7 +92,7 @@ function showsNamespaceResolver(prefix) {
|
|
|
}
|
|
|
|
|
|
|
|
|
-module.exports = {
|
|
|
+export default {
|
|
|
get: getShows,
|
|
|
parse: parseRadioShows,
|
|
|
RadioShow: RadioShow,
|