fix: starting season reference

This commit is contained in:
Cory Dransfeldt 2023-09-05 11:19:16 -07:00
parent dd4f84c604
commit 0f1d5d66d4
No known key found for this signature in database

View file

@ -28,12 +28,13 @@ module.exports = async function () {
) )
// populate the subtext to show the appropriate range if it spans multiple seasons // populate the subtext to show the appropriate range if it spans multiple seasons
// this yields a string in the format of S1E1 - S2E2 or S1E1 - E2
const subtext = const subtext =
matchedEpisode['season'] === episode['episode']['season'] matchedEpisode['season'] === episode['episode']['season']
? `S${matchedEpisode['season']}E${ ? `S${matchedEpisode['startingSeason'] || matchedEpisode['season']}E${
matchedEpisode['startingEpisode'] || matchedEpisode['episode'] matchedEpisode['startingEpisode'] || matchedEpisode['episode']
} - ${episode['episode']['number']}` } - E${episode['episode']['number']}`
: `S${matchedEpisode['season']}E${ : `S${matchedEpisode['startingSeason'] || matchedEpisode['season']}E${
matchedEpisode['startingEpisode'] || matchedEpisode['episode'] matchedEpisode['startingEpisode'] || matchedEpisode['episode']
} - S${episode['episode']['season']}E${episode['episode']['number']}` } - S${episode['episode']['season']}E${episode['episode']['number']}`
@ -49,6 +50,7 @@ module.exports = async function () {
.replace(/\s+/g, '-') .replace(/\s+/g, '-')
.toLowerCase()}.jpg` || 'https://cdn.coryd.dev/tv/missing-tv.jpg', .toLowerCase()}.jpg` || 'https://cdn.coryd.dev/tv/missing-tv.jpg',
startingEpisode: matchedEpisode['episode'], startingEpisode: matchedEpisode['episode'],
startingSeason: matchedEpisode['season'],
episode: episode['episode']['number'], episode: episode['episode']['number'],
season: episode['episode']['season'], season: episode['episode']['season'],
type: 'tv', type: 'tv',