Skip to content

Commit 644dc61

Browse files
committed
fix(favorites): only enable favorite list for movie & shows
1 parent c7ad96b commit 644dc61

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/components/views/panel/show/ShowPanelButtons.vue

+11-6
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import {
2727
type SeasonProgress,
2828
type ShowProgress,
2929
} from '~/models/list-scroll.model';
30-
import { type ListEntity, ListType } from '~/models/list.model';
30+
import { canFavorite, type ListEntity, ListType } from '~/models/list.model';
3131
import { useListsStore, useListsStoreRefs } from '~/stores/data/lists.store';
3232
import { useI18n } from '~/utils/i18n.utils';
3333
@@ -188,11 +188,16 @@ const listLoading = computed(() => {
188188
189189
const listOptions = computed(
190190
() =>
191-
myLists.value?.map(list => ({
192-
label: list.type === ListType.List ? list.name : i18n(list.name),
193-
value: list.id,
194-
icon: getIcon(list),
195-
})),
191+
myLists.value
192+
?.filter(list => {
193+
if (list.type === ListType.Favorites) return canFavorite(mode.value);
194+
return true;
195+
})
196+
.map(list => ({
197+
label: list.type === ListType.List ? list.name : i18n(list.name),
198+
value: list.id,
199+
icon: getIcon(list),
200+
})),
196201
);
197202
198203
const watchedConfirmOptions = computed<PopselectProps | undefined>(() => {

src/models/list.model.ts

+1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ export const isDefaultList = (list: ListEntity | ListTypes) => DefaultListsTypes
5555

5656
export type ListItemTypes = 'show' | 'season' | 'episode' | 'movie';
5757
export const isListItemType = (type?: string): type is ListItemTypes => !!type && ['show', 'season', 'episode', 'movie'].includes(type);
58+
export const canFavorite = (type?: string) => type === 'show' || type === 'movie';
5859

5960
export type AddOrRemoveIds = Pick<TraktApiIds, 'trakt'> | Pick<TraktApiIds, 'trakt'>[];

0 commit comments

Comments
 (0)