Skip to content

Commit a749993

Browse files
committed
chore(refactor): move utils/watching to store/composable
1 parent cf96f94 commit a749993

File tree

6 files changed

+18
-16
lines changed

6 files changed

+18
-16
lines changed

src/components/views/checkin/CheckinComponent.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import IconMovie from '~/components/icons/IconMovie.vue';
99
import IconScreen from '~/components/icons/IconScreen.vue';
1010
import { Logger } from '~/services/logger.service';
1111
import { NotificationService } from '~/services/notification.service';
12-
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
13-
import { useI18n } from '~/utils/i18n.utils';
1412
import {
1513
type CheckinQuery,
1614
isWatchingMovie,
1715
isWatchingShow,
1816
useCancelWatching,
1917
useWatchingProgress,
20-
} from '~/utils/watching.utils';
18+
} from '~/stores/composable/use-watching.ts';
19+
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
20+
import { useI18n } from '~/utils/i18n.utils';
2121
import { watchMedia } from '~/utils/window.utils';
2222
2323
const props = defineProps({

src/components/views/panel/movie/MoviePanel.vue

+6-6
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,18 @@ import { Logger } from '~/services/logger.service';
2525
import { NotificationService } from '~/services/notification.service';
2626
import { ResolveExternalLinks } from '~/settings/external.links';
2727
import { useAppStateStoreRefs } from '~/stores/app-state.store';
28+
import {
29+
type CheckinQuery,
30+
isWatchingMovie,
31+
useCancelWatching,
32+
useWatchingProgress,
33+
} from '~/stores/composable/use-watching.ts';
2834
import { useListStore } from '~/stores/data/list.store';
2935
import { useListsStoreRefs } from '~/stores/data/lists.store';
3036
import { useMovieStore, useMovieStoreRefs } from '~/stores/data/movie.store';
3137
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
3238
import { useExtensionSettingsStoreRefs } from '~/stores/settings/extension.store';
3339
import { useI18n } from '~/utils/i18n.utils';
34-
import {
35-
type CheckinQuery,
36-
isWatchingMovie,
37-
useCancelWatching,
38-
useWatchingProgress,
39-
} from '~/utils/watching.utils';
4040
4141
const props = defineProps({
4242
movieId: {

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

+6-6
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ import { Logger } from '~/services/logger.service';
3434
import { NotificationService } from '~/services/notification.service';
3535
import { ResolveExternalLinks } from '~/settings/external.links';
3636
import { useAppStateStoreRefs } from '~/stores/app-state.store';
37+
import {
38+
type CheckinQuery,
39+
isWatchingShow,
40+
useCancelWatching,
41+
useWatchingProgress,
42+
} from '~/stores/composable/use-watching.ts';
3743
import { type AddOrRemoveIds, useListStore } from '~/stores/data/list.store';
3844
import { useListsStoreRefs } from '~/stores/data/lists.store';
3945
import { useShowStore } from '~/stores/data/show.store';
4046
import { useWatchingStoreRefs } from '~/stores/data/watching.store';
4147
import { useExtensionSettingsStoreRefs } from '~/stores/settings/extension.store';
4248
import { useI18n } from '~/utils/i18n.utils';
43-
import {
44-
type CheckinQuery,
45-
isWatchingShow,
46-
useCancelWatching,
47-
useWatchingProgress,
48-
} from '~/utils/watching.utils';
4949
5050
const props = defineProps({
5151
showId: {

src/models/list-scroll.model.ts

+2
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ export const ListScrollItemType = {
9595

9696
export type ListScrollItemTypes = (typeof ListScrollItemType)[keyof typeof ListScrollItemType];
9797

98+
export const isEpisodeOrMovie = (type?: ListScrollItemTypes): type is 'episode' | 'movie' => !!type && ['episode', 'movie'].includes(type);
99+
98100
export type ListScrollItemMeta<T = { [key: string]: unknown }> = {
99101
source: ListScrollSourceItem | ProgressItem;
100102
ids: {
File renamed without changes.

src/stores/data/watching.store.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import { PollingIntervals } from '~/models/polling.model';
1010
import { Logger } from '~/services/logger.service';
1111
import { NotificationService } from '~/services/notification.service';
1212
import { TraktService } from '~/services/trakt.service';
13+
import { isWatchingMovie, isWatchingShow } from '~/stores/composable/use-watching.ts';
1314
import { useAuthSettingsStoreRefs } from '~/stores/settings/auth.store';
1415
import { storage } from '~/utils/browser/browser-storage.utils';
1516
import { useI18n } from '~/utils/i18n.utils';
1617
import { useDocumentVisible } from '~/utils/store.utils';
17-
import { isWatchingMovie, isWatchingShow } from '~/utils/watching.utils';
1818

1919
const WatchingStoreConstants = {
2020
Store: 'data.watching',

0 commit comments

Comments
 (0)