Skip to content

Commit

Permalink
Videos other than Jesus Film videos crash convertConfig (#428)
Browse files Browse the repository at this point in the history
Fixes issue #427
This does not make all the other video types play.  It just avoids the crash by providing default values for nonexistent fields
  • Loading branch information
davidmoore1 authored Dec 5, 2023
1 parent 7071691 commit 8af7975
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions scripts/convertConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -685,13 +685,22 @@ function convertConfig(dataDir: string, verbose: number) {
.getNamedItem('ref')!
.value.split('|')[0]
};
const tagWidth = tag.attributes.getNamedItem('width')
? parseInt(tag.attributes.getNamedItem('width')!.value)
: 0;
const tagHeight = tag.attributes.getNamedItem('height')
? parseInt(tag.attributes.getNamedItem('width')!.value)
: 0;
const onlineUrlHTML = tag.getElementsByTagName('online-url')[0]
? tag.getElementsByTagName('online-url')[0]?.innerHTML
: '';
data.videos.push({
id: tag.attributes.getNamedItem('id')!.value,
width: parseInt(tag.attributes.getNamedItem('width')!.value),
height: parseInt(tag.attributes.getNamedItem('height')!.value),
width: tagWidth,
height: tagHeight,
title: tag.getElementsByTagName('title')[0]?.innerHTML,
thumbnail: tag.getElementsByTagName('thumbnail')[0]?.innerHTML,
onlineUrl: decodeFromXml(tag.getElementsByTagName('online-url')[0]?.innerHTML),
onlineUrl: decodeFromXml(onlineUrlHTML),
placement
});
}
Expand Down

0 comments on commit 8af7975

Please sign in to comment.