From 31b103c75708130cdd9e7cc2f796b23e2b38ad2d Mon Sep 17 00:00:00 2001 From: Anton Lantukh Date: Thu, 7 Dec 2023 12:43:28 +0100 Subject: [PATCH] feat(watchhistory): change limit for JWP --- docs/features/user-watchlists.md | 2 +- src/config.ts | 6 +++--- src/stores/FavoritesController.ts | 2 +- src/stores/WatchHistoryController.ts | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/features/user-watchlists.md b/docs/features/user-watchlists.md index c259bcf3d..8481cb1dc 100644 --- a/docs/features/user-watchlists.md +++ b/docs/features/user-watchlists.md @@ -131,7 +131,7 @@ Example data format #### JWP -For JWP customers it is possible to add 100 items for Favorites and 100 for Watch History +For JWP the limit is 50 items for Favorites and 50 for Watch History. #### Cleeng diff --git a/src/config.ts b/src/config.ts index 315ffb8bb..5b4fbedeb 100644 --- a/src/config.ts +++ b/src/config.ts @@ -24,9 +24,9 @@ export const VideoProgressMinMax = { export const PLAYLIST_LIMIT = 25; export const MAX_WATCHLIST_ITEMS_COUNT = { - JWP: 100, - CLEENG: 38, // The externalData attribute of Cleeng can contain max 4000 characters - DEFAULT: 48, // Local storage + CLEENG: 38, // The 'externalData' attribute of Cleeng can contain max 4000 characters + JWP: 50, // Limit of media_ids length passed to the /apps/watchlists endpoint + DEFAULT: 38, // Local storage }; export const ADYEN_TEST_CLIENT_KEY = 'test_I4OFGUUCEVB5TI222AS3N2Y2LY6PJM3K'; diff --git a/src/stores/FavoritesController.ts b/src/stores/FavoritesController.ts index 2a20c55f5..4ff754fff 100644 --- a/src/stores/FavoritesController.ts +++ b/src/stores/FavoritesController.ts @@ -112,7 +112,7 @@ export default class FavoritesController { const favoritesLimit = this.accountService?.features?.watchListSizeLimit || MAX_WATCHLIST_ITEMS_COUNT.DEFAULT; // If we exceed the max available number of favorites, we show a warning - if (this.accountService && favorites?.length >= favoritesLimit) { + if (favoritesLimit && favorites?.length >= favoritesLimit) { setWarning(i18next.t('video:favorites_warning', { maxCount: MAX_WATCHLIST_ITEMS_COUNT })); return; } diff --git a/src/stores/WatchHistoryController.ts b/src/stores/WatchHistoryController.ts index 83420ab5a..baf13b096 100644 --- a/src/stores/WatchHistoryController.ts +++ b/src/stores/WatchHistoryController.ts @@ -89,6 +89,7 @@ export default class WatchHistoryController { if (!videoProgress) return; const watchHistoryLimit = this.accountService?.features.watchListSizeLimit || MAX_WATCHLIST_ITEMS_COUNT.DEFAULT; + const updatedHistory = await this.watchHistoryService.saveItem(item, seriesItem, videoProgress, watchHistory, watchHistoryLimit); if (updatedHistory) {