Skip to content

Commit

Permalink
feat(watchhistory): change limit for JWP
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLantukh committed Dec 8, 2023
1 parent 2364b83 commit 31b103c
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/features/user-watchlists.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion src/stores/FavoritesController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
1 change: 1 addition & 0 deletions src/stores/WatchHistoryController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 31b103c

Please sign in to comment.