diff --git a/src/views/Search.js b/src/views/Search.js
index 2dd2c8e1..a7f308f0 100644
--- a/src/views/Search.js
+++ b/src/views/Search.js
@@ -156,7 +156,7 @@ export function SearchView() {
if (entry.percentageDone < 90) {
newContinueWatching.push(entry)
- // begin next episode logic
+ // begin next episode logic
} else {
// we can't do next episode for movies!
if (!subselection.show) continue;
@@ -168,19 +168,19 @@ export function SearchView() {
newShow.season = subselection.show.season;
newShow.episode = `${parseInt(subselection.show.episode) + 1}`;
entry.percentageDone = 0;
- // if the current season does not have a next epsiode, and the next season has a first episode, load that
- } else if (subselection.meta.episodes[`${parseInt(subselection.show.season) + 1}`][0]) {
+ // if the current season does not have a next epsiode, and the next season has a first episode, load that
+ } else if (subselection.meta.episodes?.[`${parseInt(subselection.show.season) + 1}`]?.[0]) {
newShow.season = `${parseInt(subselection.show.season) + 1}`;
newShow.episode = subselection.meta.episodes[`${parseInt(subselection.show.season) + 1}`][0];
entry.percentageDone = 0;
- // the next episode does not exist
+ // the next episode does not exist
} else {
continue;
}
-
+
// assign the new episode and season data
entry.data.show = { ...newShow };
-
+
// if the next episode exists, continue. we don't want to end up with duplicate data.
let nextEpisode = progressData?.[source]?.show?.[slug]?.[`${entry.data.show.season}-${entry.data.show.episode}`];
if (nextEpisode) continue;
@@ -263,20 +263,19 @@ export function SearchView() {
{/* Continue watching */}
{continueWatching.length > 0 && page === 'watching' ?