Skip to content

Commit

Permalink
fix(project): undouble serieIds to prevent crash
Browse files Browse the repository at this point in the history
  • Loading branch information
langemike authored and ChristiaanScheermeijer committed Feb 7, 2024
1 parent 320fe44 commit ca3d38e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/common/src/services/WatchHistoryService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ export default class WatchHistoryService {
const seriesIds = Object.keys(mediaWithSeries || {})
.map((key) => mediaWithSeries?.[key]?.[0]?.series_id)
.filter(Boolean) as string[];
const uniqueSerieIds = [...new Set(seriesIds)];

const seriesItems = await this.apiService.getMediaByWatchlist(continueWatchingList, seriesIds);
const seriesItems = await this.apiService.getMediaByWatchlist(continueWatchingList, uniqueSerieIds);
const seriesItemsDict = Object.keys(mediaWithSeries || {}).reduce((acc, key) => {
const seriesItemId = mediaWithSeries?.[key]?.[0]?.series_id;
if (seriesItemId) {
Expand Down

0 comments on commit ca3d38e

Please sign in to comment.