mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-20 12:55:15 +02:00
format files
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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}".`);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user