format files

This commit is contained in:
maxDorninger
2025-10-27 22:26:59 +01:00
parent b846480b84
commit bb566e6eb9
6 changed files with 13 additions and 18 deletions

View File

@@ -2,7 +2,6 @@
import * as Collapsible from '$lib/components/ui/collapsible/index.js';
import * as Sidebar from '$lib/components/ui/sidebar/index.js';
import ChevronRight from '@lucide/svelte/icons/chevron-right';
import { resolve } from '$app/paths';
let {
items
@@ -34,7 +33,8 @@
{mainItem.title}
{/snippet}
{#snippet child({ props })}
<a href={resolve(mainItem.url, {})} {...props}>
<a href={mainItem.url} {...props}>
<!-- eslint-disable-line svelte/no-navigation-without-resolve -->
<mainItem.icon />
<span>{mainItem.title}</span>
</a>

View File

@@ -3,7 +3,6 @@
import type { ComponentProps } from 'svelte';
import Sun from '@lucide/svelte/icons/sun';
import Moon from '@lucide/svelte/icons/moon';
import { resolve } from '$app/paths';
import { toggleMode } from 'mode-watcher';
let {
@@ -41,7 +40,8 @@
<Sidebar.MenuItem>
<Sidebar.MenuButton size="sm">
{#snippet child({ props })}
<a href={resolve(item.url, {})} {...props}>
<a href={item.url} {...props}>
<!-- eslint-disable-line svelte/no-navigation-without-resolve -->
<item.icon />
<span>{item.title}</span>
</a>

View File

@@ -100,9 +100,8 @@ export function formatSecondsToOptimalUnit(seconds: number): string {
return '0s';
}
export function handleQueryNotificationToast(count: number = 0, query: string = "") {
if (count > 0 && query.length > 0) toast.success(`Found ${count} ${count > 1 ? 'result' : 'results'} for search term "${query}".`);
export function handleQueryNotificationToast(count: number = 0, query: string = '') {
if (count > 0 && query.length > 0)
toast.success(`Found ${count} ${count > 1 ? 'result' : 'results'} for search term "${query}".`);
else if (count == 0) toast.info(`No results found for "${query}".`);
}
}

View File

@@ -9,12 +9,11 @@
import * as Collapsible from '$lib/components/ui/collapsible/index.js';
import * as RadioGroup from '$lib/components/ui/radio-group/index.js';
import AddMediaCard from '$lib/components/add-media-card.svelte';
import { toast } from 'svelte-sonner';
import { onMount } from 'svelte';
import { base } from '$app/paths';
import client from '$lib/api';
import type { components } from '$lib/api/api';
import {handleQueryNotificationToast} from "$lib/utils.ts";
import { handleQueryNotificationToast } from '$lib/utils.ts';
let searchTerm: string = $state('');
let metadataProvider: 'tmdb' | 'tvdb' = $state('tmdb');
@@ -41,7 +40,7 @@
} else {
results = null;
}
handleQueryNotificationToast(data?.length ?? 0, query)
handleQueryNotificationToast(data?.length ?? 0, query);
}
</script>

View File

@@ -9,7 +9,6 @@
import * as Collapsible from '$lib/components/ui/collapsible/index.js';
import * as RadioGroup from '$lib/components/ui/radio-group/index.js';
import AddMediaCard from '$lib/components/add-media-card.svelte';
import { toast } from 'svelte-sonner';
import { onMount } from 'svelte';
let searchTerm: string = $state('');
@@ -18,7 +17,7 @@
import { resolve } from '$app/paths';
import client from '$lib/api';
import type { components } from '$lib/api/api';
import {handleQueryNotificationToast} from "$lib/utils.ts";
import { handleQueryNotificationToast } from '$lib/utils.ts';
onMount(() => {
search('');
@@ -37,13 +36,12 @@
})
: await client.GET('/api/v1/tv/recommended');
if (results.data && results.data.length > 0) {
handleQueryNotificationToast(results.data.length, query)
handleQueryNotificationToast(results.data.length, query);
data = results.data as components['schemas']['MetaDataProviderSearchResult'][];
} else {
handleQueryNotificationToast(0, query)
handleQueryNotificationToast(0, query);
data = null;
}
}
</script>

View File

@@ -2,7 +2,6 @@
import { UserCheck } from 'lucide-svelte';
import { Button } from '$lib/components/ui/button/index.js';
import { handleLogout } from '$lib/utils.ts';
import { resolve } from '$app/paths';
</script>
<svelte:head>