Guard for missing ProductionYear/Episode Number

This commit is contained in:
Mike Heier 2024-03-14 07:46:17 -04:00
parent 4e3b28ea92
commit 82126e7523

View File

@ -99,9 +99,17 @@ sub LoadItems_AddVideoContent(video as object, mediaSourceId as dynamic, audio_s
if videotype = "episode" or videotype = "series"
video.content.contenttype = "episode"
video.content.title = "S" + meta.json.ParentIndexNumber.toStr() + "E" + meta.json.IndexNumber.toStr() + " - " + meta.title + + " (" + meta.json.ProductionYear.ToStr() + ")"
if Type(meta.json.ParentIndexNumber) = "roInt" and Type(meta.json.IndexNumber) = "roInt" and Type(meta.json.ProductionYear) = "roInt"
video.content.title = "S" + meta.json.ParentIndexNumber.toStr() + " - E" + meta.json.IndexNumber.toStr() + " - " + meta.title + + " (" + meta.json.ProductionYear.ToStr() + ")"
else
video.content.title = meta.title
end if
else
video.content.title = meta.title + " (" + meta.json.ProductionYear.ToStr() + ")"
if Type(meta.json.ProductionYear) = "roInt"
video.content.title = meta.title + " (" + meta.json.ProductionYear.ToStr() + ")"
else
video.content.title = meta.title
end if
end if
video.chapters = meta.json.Chapters