From d38e553d9f7985b77c806808ac3ceeedb8d4c5dc Mon Sep 17 00:00:00 2001 From: Kasper Date: Thu, 5 Mar 2026 14:03:18 +0100 Subject: [PATCH] fmt --- mobile/src/routes/+layout.svelte | 4 +- mobile/src/routes/+layout.ts | 2 +- mobile/src/routes/+page.svelte | 142 +++--- mobile/src/routes/Library.svelte | 810 +++++++++++++++++-------------- 4 files changed, 527 insertions(+), 431 deletions(-) diff --git a/mobile/src/routes/+layout.svelte b/mobile/src/routes/+layout.svelte index f16e2ae..f89ec5a 100644 --- a/mobile/src/routes/+layout.svelte +++ b/mobile/src/routes/+layout.svelte @@ -1,7 +1,7 @@ {@render children()} diff --git a/mobile/src/routes/+layout.ts b/mobile/src/routes/+layout.ts index 9d24899..2696395 100644 --- a/mobile/src/routes/+layout.ts +++ b/mobile/src/routes/+layout.ts @@ -2,4 +2,4 @@ // so we use adapter-static with a fallback to index.html to put the site in SPA mode // See: https://svelte.dev/docs/kit/single-page-apps // See: https://v2.tauri.app/start/frontend/sveltekit/ for more info -export const ssr = false; +export const ssr = false diff --git a/mobile/src/routes/+page.svelte b/mobile/src/routes/+page.svelte index b4f7a94..79f1fc2 100644 --- a/mobile/src/routes/+page.svelte +++ b/mobile/src/routes/+page.svelte @@ -1,82 +1,86 @@ -
- {#if error} -
⚠ {error}
- {/if} - - {#snippet open_button()} - - {/snippet} +
+ {#if error} +
+ ⚠ {error} +
+ {/if} + {#snippet open_button()} + + {/snippet} - {#if library} - - {:else} -
- ♪ -
-

No library loaded

-
- {@render open_button()} -
-
-
+ {#if library} + + {:else} +
+ ♪ +
+

No library loaded

+
+ {@render open_button()} +
+
+
{/if}
diff --git a/mobile/src/routes/Library.svelte b/mobile/src/routes/Library.svelte index 41924b8..71c1386 100644 --- a/mobile/src/routes/Library.svelte +++ b/mobile/src/routes/Library.svelte @@ -1,369 +1,461 @@ -
- - -
- {#if page.url.searchParams.has('id')} - - {/if} - -
- {#if view.kind === 'browser'} -

{node_name(view.folder_id)}

- {:else if view.kind === 'tracks'} -

{node_name(view.playlist_id)}

- {/if} - -
- - {@render open_button()} -
- - {#if error} -
⚠ {error}
- {/if} - - - {#if view.kind === 'browser'} -
- {#if current_children.length > 0} -
    - {#each current_children as child_id} - {@const tl = get_tracklist(child_id)} - {#if tl?.type === 'folder'} -
  • - -
  • - {:else if tl?.type === 'playlist'} -
  • - -
  • - {/if} - {/each} -
- {:else} -
This folder is empty
- {/if} -
- - - {:else if view.kind === 'tracks'} -
-
-
- ⌕ - -
-
- - - - - - {filtered_tracks.length}/{playlist_tracks.length} - -
- -
- - - {#each genres as genre} - - {/each} -
-
- -
- {#if filtered_tracks.length > 0} -
    - {#each filtered_tracks as track} -
  • -
    -

    {track.name}

    -

    - {track.artist ?? 'Unknown Artist'} - {#if track.albumName} - · {track.albumName} - {/if} -

    -
    - {#if track.genre} - {track.genre} - {/if} - {#if track.year} - {track.year} - {/if} -
    -
    -
    - {format_duration(track.duration)} - {#if track.playCount} - {track.playCount} plays - {/if} - {#if track.liked} - ♥ - {/if} -
    -
  • - {/each} -
- {:else} -
- ⌕ -

No tracks match your search or filter

-
- {/if} -
- {/if} - +
+ +
+ {#if page.url.searchParams.has('id')} + + {/if} + +
+ {#if view.kind === 'browser'} +

+ {node_name(view.folder_id)} +

+ {:else if view.kind === 'tracks'} +

+ {node_name(view.playlist_id)} +

+ {/if} +
+ + {@render open_button()} +
+ + {#if error} +
+ ⚠ {error} +
+ {/if} + + + {#if view.kind === 'browser'} +
+ {#if current_children.length > 0} +
    + {#each current_children as child_id} + {@const tl = get_tracklist(child_id)} + {#if tl?.type === 'folder'} +
  • + +
  • + {:else if tl?.type === 'playlist'} +
  • + +
  • + {/if} + {/each} +
+ {:else} +
+ This folder is empty +
+ {/if} +
+ + + {:else if view.kind === 'tracks'} +
+
+
+ ⌕ + +
+
+ + + + + + {filtered_tracks.length}/{playlist_tracks.length} + +
+ +
+ + + {#each genres as genre} + + {/each} +
+
+ +
+ {#if filtered_tracks.length > 0} +
    + {#each filtered_tracks as track} +
  • +
    +

    + {track.name} +

    +

    + {track.artist ?? 'Unknown Artist'} + {#if track.albumName} + · {track.albumName} + {/if} +

    +
    + {#if track.genre} + {track.genre} + {/if} + {#if track.year} + {track.year} + {/if} +
    +
    +
    + {format_duration(track.duration)} + {#if track.playCount} + {track.playCount} plays + {/if} + {#if track.liked} + ♥ + {/if} +
    +
  • + {/each} +
+ {:else} +
+ ⌕ +

No tracks match your search or filter

+
+ {/if} +
+ {/if}
-- 2.51.2