Updated store location

This commit is contained in:
WardPearce
2024-05-13 14:59:31 +12:00
parent 116ce3cb82
commit cbbf4e8fc6
18 changed files with 68 additions and 34 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ import {
instanceStore,
returnYTDislikesInstanceStore,
synciousInstanceStore
} from '../../store';
} from '../store';
import type {
Channel,
ChannelContentPlaylists,
+1 -1
View File
@@ -1,8 +1,8 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { get } from 'svelte/store';
import { miniPlayerSrcStore, playerProxyVideosStore } from '../store';
import { proxyVideoUrl } from './misc';
import { miniPlayerSrcStore, playerProxyVideosStore } from './store';
let currentTime: number = 0;
+4 -4
View File
@@ -7,6 +7,9 @@
import { get } from 'svelte/store';
import type { MediaTimeUpdateEvent, PlayerSrc, VideoSrc } from 'vidstack';
import type { MediaPlayerElement } from 'vidstack/elements';
import { deleteVideoProgress, getVideoProgress, saveVideoProgress } from './Api';
import type { VideoPlay } from './Api/model';
import { getBestThumbnail, proxyVideoUrl, videoLength, type PhasedDescription } from './misc';
import {
authStore,
instanceStore,
@@ -19,10 +22,7 @@
sponsorBlockCategoriesStore,
sponsorBlockUrlStore,
synciousStore
} from '../store';
import { deleteVideoProgress, getVideoProgress, saveVideoProgress } from './Api';
import type { VideoPlay } from './Api/model';
import { getBestThumbnail, proxyVideoUrl, videoLength, type PhasedDescription } from './misc';
} from './store';
import { getDynamicTheme } from './theme';
export let data: { video: VideoPlay; content: PhasedDescription; playlistId: string | null };
+1 -1
View File
@@ -3,8 +3,8 @@
import Mousetrap from 'mousetrap';
import { createEventDispatcher, onMount } from 'svelte';
import { _ } from 'svelte-i18n';
import { interfaceSearchSuggestionsStore } from '../store';
import { getSearchSuggestions } from './Api';
import { interfaceSearchSuggestionsStore } from './store';
const dispatch = createEventDispatcher();
+2 -2
View File
@@ -3,6 +3,7 @@
import { Capacitor } from '@capacitor/core';
import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { ensureNoTrailingSlash } from './misc';
import {
authStore,
darkModeStore,
@@ -30,8 +31,7 @@
synciousInstanceStore,
synciousStore,
themeColorStore
} from '../store';
import { ensureNoTrailingSlash } from './misc';
} from './store';
let sponsorCategoriesList: string[] = [];
sponsorBlockCategoriesStore.subscribe((value) => (sponsorCategoriesList = value));
+1 -1
View File
@@ -7,7 +7,7 @@
import { onDestroy, onMount } from 'svelte';
import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { syncPartyConnectionsStore, syncPartyPeerStore } from '../store';
import { syncPartyConnectionsStore, syncPartyPeerStore } from './store';
function changeVideoEvent(conn: DataConnection) {
conn.on('data', (data) => {
+6 -6
View File
@@ -2,6 +2,11 @@
import { createEventDispatcher, onMount } from 'svelte';
import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { getDeArrow, getThumbnail, getVideo, getVideoProgress } from './Api';
import type { Notification, PlaylistPageVideo, Video, VideoBase, VideoPlay } from './Api/model';
import ShareVideo from './ShareVideo.svelte';
import { cleanNumber, getBestThumbnail, proxyVideoUrl, videoLength } from './misc';
import type { PlayerEvents } from './player';
import {
authStore,
deArrowEnabledStore,
@@ -11,12 +16,7 @@
syncPartyConnectionsStore,
syncPartyPeerStore,
synciousStore
} from '../store';
import { getDeArrow, getThumbnail, getVideo, getVideoProgress } from './Api';
import type { Notification, PlaylistPageVideo, Video, VideoBase, VideoPlay } from './Api/model';
import ShareVideo from './ShareVideo.svelte';
import { cleanNumber, getBestThumbnail, proxyVideoUrl, videoLength } from './misc';
import type { PlayerEvents } from './player';
} from './store';
const dispatch = createEventDispatcher();
+1 -1
View File
@@ -1,10 +1,10 @@
<script lang="ts">
import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { authStore } from '../store';
import { removePlaylistVideo } from './Api';
import type { Notification, PlaylistPageVideo, Video, VideoBase } from './Api/model';
import Thumbnail from './Thumbnail.svelte';
import { authStore } from './store';
export let videos: VideoBase[] | Video[] | Notification[] | PlaylistPageVideo[] = [];
export let oneItemPerRow: boolean = false;
+2 -2
View File
@@ -1,5 +1,4 @@
import { page } from '$app/stores';
import { get } from 'svelte/store';
import {
darkModeStore,
deArrowEnabledStore,
@@ -24,7 +23,8 @@ import {
synciousInstanceStore,
synciousStore,
themeColorStore
} from '../store';
} from '$lib/store';
import { get } from 'svelte/store';
const persistedStores = [
{
+1 -1
View File
@@ -3,8 +3,8 @@ import { page } from '$app/stores';
import humanNumber from 'human-number';
import type Peer from 'peerjs';
import { get } from 'svelte/store';
import { instanceStore } from '../store';
import type { Image } from './Api/model';
import { instanceStore } from './store';
export function truncate(value: string, maxLength: number = 50): string {
return value.length > maxLength ? `${value.substring(0, maxLength)}...` : value;
@@ -0,0 +1,23 @@
import { getVideo } from '$lib/Api/index.js';
import { error } from '@sveltejs/kit';
import { get } from 'svelte/store';
import type { PhasedDescription } from '../../../../lib/misc.js';
import { playerProxyVideosStore } from '../../../../lib/store.js';
export async function load({ params }) {
let video;
try {
video = await getVideo(params.slug, get(playerProxyVideosStore));
} catch (errorMessage: any) {
error(500, errorMessage);
}
return {
video: video,
content: {
description: '',
timestamps: []
} as PhasedDescription,
playlistId: null
};
}
@@ -0,0 +1,11 @@
<script lang="ts">
import Player from '$lib/Player.svelte';
import type { MediaPlayerElement } from 'vidstack/elements';
export let data;
export let layout = false;
let player: MediaPlayerElement;
</script>
<Player bind:player {data} />
+1 -1
View File
@@ -1,6 +1,6 @@
<script src="ts">
import { page } from '$app/stores';
import { activePageStore } from '../store';
import { activePageStore } from '$lib/store';
activePageStore.set(null);
</script>
+8 -8
View File
@@ -11,6 +11,14 @@
import SyncParty from '$lib/SyncParty.svelte';
import Thumbnail from '$lib/Thumbnail.svelte';
import { bookmarkletLoadFromUrl, loadSettingsFromEnv } from '$lib/externalSettings';
import {
activePageStore,
authStore,
darkModeStore,
instanceStore,
syncPartyPeerStore,
themeColorStore
} from '$lib/store';
import { App } from '@capacitor/app';
import { Browser } from '@capacitor/browser';
import { Capacitor } from '@capacitor/core';
@@ -20,14 +28,6 @@
import { _ } from 'svelte-i18n';
import { get } from 'svelte/store';
import { pwaInfo } from 'virtual:pwa-info';
import {
activePageStore,
authStore,
darkModeStore,
instanceStore,
syncPartyPeerStore,
themeColorStore
} from '../store';
let mobileSearchShow = false;
+1 -1
View File
@@ -1,6 +1,6 @@
<script lang="ts">
import VideoList from '$lib/VideoList.svelte';
import { activePageStore } from '../store';
import { activePageStore } from '$lib/store';
export let data;
@@ -1,8 +1,8 @@
<script lang="ts">
import { deleteUnsubscribe } from '$lib/Api';
import { activePageStore } from '$lib/store';
import Fuse from 'fuse.js';
import { _ } from 'svelte-i18n';
import { activePageStore } from '../../../store';
activePageStore.set(null);
@@ -7,14 +7,14 @@ import {
postHistory
} from '$lib/Api/index.js';
import { phaseDescription } from '$lib/misc';
import { error } from '@sveltejs/kit';
import { get } from 'svelte/store';
import {
authStore,
playerProxyVideosStore,
returnYTDislikesInstanceStore,
returnYtDislikesStore
} from '../../../store';
} from '$lib/store';
import { error } from '@sveltejs/kit';
import { get } from 'svelte/store';
export async function load({ params, url }) {
let video;