refactor: separate podcasts from downloads — own route + nav item
All checks were successful
Security Checks / dependency-audit (push) Successful in 13s
Security Checks / secret-scanning (push) Successful in 3s
Security Checks / dockerfile-lint (push) Successful in 4s

- /podcasts — new page with PodcastPlayer (headphones icon)
- /downloads — old media page renamed (download icon)
- /media — kept for backward compat (same as downloads)
- Nav: Reader → Podcasts → Downloads → Brain

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Yusuf Suleman
2026-04-03 07:42:56 -05:00
parent 587040b7a6
commit 0e9702d494
13 changed files with 105 additions and 3442 deletions

View File

@@ -3,27 +3,20 @@
import BookSearch from '$lib/components/media/BookSearch.svelte';
import MusicSearch from '$lib/components/media/MusicSearch.svelte';
import BookLibrary from '$lib/components/media/BookLibrary.svelte';
import PodcastPlayer from '$lib/components/media/PodcastPlayer.svelte';
type MediaTab = 'books' | 'music' | 'library' | 'podcasts';
type MediaTab = 'books' | 'music' | 'library';
const urlMode = page.url.searchParams.get('mode');
let activeTab = $state<MediaTab>(
urlMode === 'music' ? 'music'
: urlMode === 'library' ? 'library'
: urlMode === 'podcasts' ? 'podcasts'
: 'books'
);
let activeTab = $state<MediaTab>(urlMode === 'music' ? 'music' : urlMode === 'library' ? 'library' : 'books');
</script>
<div class="page">
<div class="app-surface">
<div class="page-header">
<div class="page-title">MEDIA</div>
<div class="page-title">DOWNLOADS</div>
<div class="page-subtitle">
{#if activeTab === 'books'}Book Downloads
{:else if activeTab === 'music'}Music Downloads
{:else if activeTab === 'podcasts'}Podcast Player
{:else}Book Library{/if}
</div>
</div>
@@ -37,10 +30,6 @@
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M9 18V5l12-2v13"/><circle cx="6" cy="18" r="3"/><circle cx="18" cy="16" r="3"/></svg>
Music
</button>
<button class="tab" class:active={activeTab === 'podcasts'} onclick={() => activeTab = 'podcasts'}>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M4 11a9 9 0 0 1 9 9"/><path d="M4 4a16 16 0 0 1 16 16"/><circle cx="5" cy="20" r="1"/></svg>
Podcasts
</button>
<button class="tab" class:active={activeTab === 'library'} onclick={() => activeTab = 'library'}>
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"/><path d="M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"/></svg>
Library
@@ -51,8 +40,6 @@
<BookSearch />
{:else if activeTab === 'music'}
<MusicSearch />
{:else if activeTab === 'podcasts'}
<PodcastPlayer />
{:else}
<BookLibrary />
{/if}