refactor(xtream): update favorite status checks and toggleFavorite method to include IDs

This commit is contained in:
4gray committed 2024-12-24 23:19:24 +01:00
1 parent 755e12aaa6
commit 5dd4dd2aba
2 files changed
+18 -7

No files matched your search

@@ -41,8 +41,11 @@ export class SerialDetailsComponent {
...currentSerial,
series_id: serialId,
});
// Move checkFavoriteStatus after setting the selected item
this.xtreamStore.checkFavoriteStatus();
this.xtreamStore.checkFavoriteStatus(
serialId,
this.xtreamStore.currentPlaylist().id
);
});
}
@@ -73,6 +76,9 @@ export class SerialDetailsComponent {
}
toggleFavorite() {
this.xtreamStore.toggleFavorite();
this.xtreamStore.toggleFavorite(
this.route.snapshot.params.serialId,
this.xtreamStore.currentPlaylist().id
);
}
}
@@ -44,12 +44,14 @@ export class VodDetailsComponent implements OnInit, OnDestroy {
this.xtreamStore.getVodDetails(vodId).then((currentVod) => {
this.xtreamStore.setSelectedCategory(Number(categoryId));
this.xtreamStore.setSelectedItem({
...currentVod.movie_data,
info: currentVod.info,
...currentVod,
stream_id: vodId,
});
// Check favorite status after setting selected item
this.xtreamStore.checkFavoriteStatus();
this.xtreamStore.checkFavoriteStatus(
vodId,
this.xtreamStore.currentPlaylist().id
);
});
}
@@ -81,7 +83,10 @@ export class VodDetailsComponent implements OnInit, OnDestroy {
}
toggleFavorite() {
this.xtreamStore.toggleFavorite();
this.xtreamStore.toggleFavorite(
this.route.snapshot.params.vodId,
this.xtreamStore.currentPlaylist().id
);
}
private addToRecentlyViewed() {