diff --git a/src/lib/components/custom/PlayerSidebar.svelte b/src/lib/components/custom/PlayerSidebar.svelte
index ee563de..73a2e2f 100644
--- a/src/lib/components/custom/PlayerSidebar.svelte
+++ b/src/lib/components/custom/PlayerSidebar.svelte
@@ -6,22 +6,25 @@
import {View} from "$lib/components/custom/Views/views.svelte";
import {AlbumView} from "$lib/components/custom/Views/views.svelte.js";
import {viewState} from "$lib/states/view-state.svelte";
+ import {goto} from "$app/navigation";
let playlists = $state([]);
+ let expanded = $state(true);
+ $inspect(expanded)
-
-
+ expanded = !expanded} class="flex flex-col h-fit">Albums
+ {#if expanded}
+ goto("/albums/all")}>All
+ goto("/albums/random")}>Random
+ goto("/albums/favourites")}>Favourites
+ goto("/albums/top-rated")}>Top Rated
+ goto("/albums/recently-added")}>Recently Added
+ goto("/albums/recently-played")}>Recently Played
+ goto("/albums/most-played")}>Most Played
+ {/if}
viewState.setMode(View.Artists)}>Artists
diff --git a/src/lib/components/custom/Views/AlbumComponent.svelte b/src/lib/components/custom/Views/AlbumComponent.svelte
new file mode 100644
index 0000000..d95fcb4
--- /dev/null
+++ b/src/lib/components/custom/Views/AlbumComponent.svelte
@@ -0,0 +1,20 @@
+
+
+
+
+
updateScroll(self)}>
+ {#if albums.loading}
+ {#each [...Array(20).keys()] as i}
+
+ {/each}
+ {:else}
+ {#each albums.list as album}
+
+ {/each}
+ {/if}
+
\ No newline at end of file
diff --git a/src/lib/components/custom/Views/album-pages-utils.svelte.ts b/src/lib/components/custom/Views/album-pages-utils.svelte.ts
new file mode 100644
index 0000000..c751a8a
--- /dev/null
+++ b/src/lib/components/custom/Views/album-pages-utils.svelte.ts
@@ -0,0 +1,30 @@
+import {type AlbumID3, type GetAlbumList2Response, OpenSubsonic, type Parameter} from "$lib/opensubsonic";
+
+export class AlbumState {
+ list: Array
= $state(new Array())
+ loading: boolean = $state(true)
+ paginating: boolean = $state(false)
+ paginationIncrement: number = $state(100)
+ pagination: number = $state(0)
+ mode: string = $state("alphabeticalByName")
+
+ async fetchAlbums(): Promise {
+ const parameters: Array = [
+ {key: "type", value: this.mode},
+ {key: "size", value: this.paginationIncrement.toString()},
+ {key: "offset", value: this.pagination.toString()},
+ ];
+
+ const data: GetAlbumList2Response = await OpenSubsonic.get("getAlbumList2", parameters);
+ if (data && data.albumList2.album) {
+ this.list = this.list.concat(data.albumList2.album);
+ this.pagination += this.paginationIncrement;
+ this.paginating = false;
+ this.loading = false;
+ }
+ }
+
+ setMode(mode: string): void {
+ this.mode = mode;
+ }
+}
\ No newline at end of file
diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte
index 94f8872..9390832 100644
--- a/src/routes/+layout.svelte
+++ b/src/routes/+layout.svelte
@@ -5,16 +5,15 @@
import QueueFrame from "$lib/components/custom/QueueFrame.svelte";
import {onMount} from "svelte";
import PlayerControls from "$lib/components/custom/PlayerControls.svelte";
- import {AlbumView, View} from "$lib/components/custom/Views/views.svelte";
import PlayerSidebar from "$lib/components/custom/PlayerSidebar.svelte";
+ import {queueState} from "$lib/states/play-queue.svelte";
+ import {playbackState} from "$lib/states/playback-state.svelte";
let { children } = $props();
- let viewMode = $state(View.Albums);
- let subViewMode = $state(AlbumView.All);
-
onMount(() => {
-
+ queueState.getPlayQueue(true);
+ playbackState.song = new Audio(); // needed so source is not undefined
})
@@ -25,7 +24,9 @@
- {@render children()}
+
+ {@render children()}
+
diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte
index 4579c7a..8e9c60c 100644
--- a/src/routes/+page.svelte
+++ b/src/routes/+page.svelte
@@ -7,11 +7,6 @@
import {queueState} from "$lib/states/play-queue.svelte";
import {playbackState} from "$lib/states/playback-state.svelte";
import {viewState} from "$lib/states/view-state.svelte";
-
- onMount(() => {
- queueState.getPlayQueue(true);
- playbackState.song = new Audio(); // needed so source is not undefined
- })
@@ -19,12 +14,10 @@
-
- {#if viewState.current.mode === View.Albums}es
-
- {:else if viewState.current.mode === View.Artists}
-
Get Fucked
- {/if}
-
+{#if viewState.current.mode === View.Albums}es
+
+{:else if viewState.current.mode === View.Artists}
+ Get Fucked
+{/if}
diff --git a/src/routes/albums/all/+page.svelte b/src/routes/albums/all/+page.svelte
new file mode 100644
index 0000000..8f2848a
--- /dev/null
+++ b/src/routes/albums/all/+page.svelte
@@ -0,0 +1,38 @@
+
+
+
+
+
+
diff --git a/src/routes/albums/favourites/+page.svelte b/src/routes/albums/favourites/+page.svelte
new file mode 100644
index 0000000..0b6938d
--- /dev/null
+++ b/src/routes/albums/favourites/+page.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/albums/most-played/+page.svelte b/src/routes/albums/most-played/+page.svelte
new file mode 100644
index 0000000..80a60da
--- /dev/null
+++ b/src/routes/albums/most-played/+page.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/albums/random/+page.svelte b/src/routes/albums/random/+page.svelte
new file mode 100644
index 0000000..0b502d9
--- /dev/null
+++ b/src/routes/albums/random/+page.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/albums/recently-added/+page.svelte b/src/routes/albums/recently-added/+page.svelte
new file mode 100644
index 0000000..737878c
--- /dev/null
+++ b/src/routes/albums/recently-added/+page.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/albums/recently-played/+page.svelte b/src/routes/albums/recently-played/+page.svelte
new file mode 100644
index 0000000..62891a0
--- /dev/null
+++ b/src/routes/albums/recently-played/+page.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/routes/albums/top-rated/+page.svelte b/src/routes/albums/top-rated/+page.svelte
new file mode 100644
index 0000000..5287df6
--- /dev/null
+++ b/src/routes/albums/top-rated/+page.svelte
@@ -0,0 +1,37 @@
+
+
+
+
+
\ No newline at end of file