tvpassport.com - Added optional chaining on elements that may not exist

Added optional chaining on elements that are expected to not exist on the guide listings such as 'episodetitle' and 'year', this fixes the pull for 25 channels that were failing (out of 19,287 channels).
This commit is contained in:
dblake10 authored and GitHub committed 2026-02-24 18:23:07 -06:00
1 parent 163634dee3
commit 5623296b34
1 file changed
+3 -2
@@ -133,11 +133,11 @@ function parseTitle($item) {
}
function parseSubTitle($item) {
return $item('*').data('episodetitle').toString() || null
return $item('*').data('episodetitle')?.toString() || null
}
function parseYear($item) {
return $item('*').data('year').toString() || null
return $item('*').data('year')?.toString() || null
}
function parseCategory($item) {
@@ -200,3 +200,4 @@ function parseCurrentTimezone(content) {
return $('#timezone_selector').val()
}