Files
furumi-web/templates/player/podcasts.html
T
2026-11-22 17:11:37 +02:00

175 lines
9.7 KiB
HTML

<style>
.podcast-nav{appearance:none;border:0;background:transparent;width:100%;font:inherit;text-align:left}
.podcast-page{padding:20px;max-width:1100px;margin:auto}.podcast-toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:16px 0}.podcast-toolbar input,.podcast-toolbar select{background:var(--bg-secondary,#171c28);color:inherit;border:1px solid var(--border,#384052);border-radius:8px;padding:10px;max-width:100%}.podcast-toolbar input[type=text]{flex:1;min-width:160px}.podcast-page button,.podcast-card button{border:1px solid var(--border,#384052);background:var(--bg-secondary,#171c28);color:inherit;border-radius:8px;padding:8px 12px;cursor:pointer}.podcast-page button:disabled,.podcast-card button:disabled{opacity:.5}.podcast-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(280px,100%),1fr));gap:14px;margin:16px 0 28px}.podcast-card,.podcast-episode{border:1px solid var(--border,#384052);border-radius:12px;padding:16px;overflow-wrap:anywhere}.podcast-card h3,.podcast-episode h3{margin:0 0 8px}.podcast-description{color:var(--text-secondary,#a2a9b8);white-space:pre-line;margin:8px 0}.podcast-episode{margin:10px 0}.podcast-notice{padding:12px 0;color:var(--accent,#67e8f9)}@media(max-width:600px){.podcast-page{padding:12px}.podcast-page button,.podcast-page input,.podcast-page select{min-height:44px;font-size:16px}}
</style>
<template x-if="$store.library.view === 'podcasts'">
<section class="podcast-page">
<h1 x-text="$store.podcasts.text('podcasts')"></h1>
<form class="podcast-toolbar" @submit.prevent="$store.podcasts.add()">
<input
type="text"
x-model="$store.podcasts.url"
placeholder="RSS / Atom URL"
aria-label="RSS / Atom URL"
required
/><button :disabled="$store.podcasts.busy" x-text="$store.podcasts.text('add')"></button
><button
type="button"
@click="$store.podcasts.refreshAll()"
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text('checkAll')"
></button>
</form>
<div
role="status"
aria-live="polite"
class="podcast-notice"
x-text="$store.podcasts.message"
></div>
<h2 x-text="$store.podcasts.text('mine')"></h2>
<p x-show="!$store.podcasts.mine.length" x-text="$store.podcasts.text('empty')"></p>
<div class="podcast-grid">
<template x-for="pod in $store.podcasts.mine" :key="pod.id"
><article class="podcast-card">
<h3>
<button
@click="$store.podcasts.open(pod)"
x-text="pod.metadata.title"
></button>
</h3>
<div x-text="pod.metadata.author"></div>
<div
class="podcast-description"
x-text="pod.episodes+' · '+pod.new_episodes+' '+$store.podcasts.text('unplayed')"
></div>
<div x-show="pod.error" x-text="pod.error"></div>
<div class="podcast-toolbar">
<button
@click="$store.podcasts.refresh(pod)"
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text('check')"
></button
><button
@click="$store.podcasts.share(pod)"
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text(pod.shared?'unpublish':'publish')"
></button
><button
@click="$store.podcasts.remove(pod)"
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text('remove')"
></button>
</div></article
></template>
</div>
<template x-if="$store.podcasts.selected"
><section>
<h2 x-text="$store.podcasts.selected.metadata.title"></h2>
<p
class="podcast-description"
x-text="$store.podcasts.selected.metadata.description"
></p>
<div class="podcast-toolbar">
<input
type="text"
x-model="$store.podcasts.filter"
:placeholder="$store.podcasts.text('filter')"
:aria-label="$store.podcasts.text('filter')"
/><select
x-model="$store.podcasts.season"
:aria-label="$store.podcasts.text('season')"
>
<option value="" x-text="$store.podcasts.text('allSeasons')"></option>
<template x-for="season in $store.podcasts.seasons()" :key="season"
><option
:value="season"
x-text="$store.podcasts.text('season')+' '+season"
></option
></template></select
><label
><input type="checkbox" x-model="$store.podcasts.unplayedOnly" />
<span x-text="$store.podcasts.text('unplayedOnly')"></span
></label>
</div>
<p
x-show="!$store.podcasts.filteredEpisodes().length"
x-text="$store.podcasts.text('noEpisodes')"
></p>
<template x-for="episode in $store.podcasts.filteredEpisodes()" :key="episode.id"
><article class="podcast-episode">
<h3 x-text="episode.metadata.title"></h3>
<div x-text="$store.podcasts.date(episode.metadata.published_at_ms)"></div>
<details x-show="episode.metadata.description">
<summary x-text="$store.podcasts.text('description')"></summary>
<p
class="podcast-description"
x-text="episode.metadata.description"
></p>
</details>
<div class="podcast-toolbar">
<button
@click="$store.podcasts.play(episode)"
x-text="$store.podcasts.text(episode.position_ms&&!episode.completed?'resume':'play')"
></button
><button
@click="$store.podcasts.download(episode)"
:disabled="episode.cached||episode.downloading"
x-text="$store.podcasts.text(episode.cached?'saved':episode.downloading?'downloading':'download')"
></button
><button
@click="$store.podcasts.mark(episode)"
x-text="$store.podcasts.text(episode.completed?'markUnplayed':'markPlayed')"
></button
><button
x-show="episode.position_ms"
@click="$store.podcasts.restart(episode)"
x-text="$store.podcasts.text('restart')"
></button>
</div>
<div
role="status"
x-show="episode.error"
x-text="episode.error"
></div></article></template
><button
x-show="$store.podcasts.hasMore"
@click="$store.podcasts.more()"
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text('loadMore')"
></button></section
></template>
<h2 x-text="$store.podcasts.text($store.podcasts.searched?'results':'public')"></h2>
<form class="podcast-toolbar" @submit.prevent="$store.podcasts.search()">
<input
type="text"
x-model="$store.podcasts.query"
@input="$store.podcasts.resetSearch()"
:placeholder="$store.podcasts.text('searchNetwork')"
:aria-label="$store.podcasts.text('searchNetwork')"
minlength="2"
maxlength="200"
/><button
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text('search')"
></button>
</form>
<p
x-show="!$store.podcasts.publicCards().length"
x-text="$store.podcasts.text($store.podcasts.searched?'noMatches':'noPublic')"
></p>
<div class="podcast-grid">
<template x-for="pod in $store.podcasts.publicCards()" :key="pod.id"
><article class="podcast-card">
<h3 x-text="pod.metadata.title"></h3>
<div x-text="pod.metadata.author"></div>
<p class="podcast-description" x-text="pod.metadata.description"></p>
<button
@click="$store.podcasts.openResult(pod)"
:disabled="$store.podcasts.busy"
x-text="$store.podcasts.text(pod.subscribed||$store.podcasts.mine.some(p=>p.id===pod.id)?'open':'subscribe')"
></button></article
></template>
</div></section
></template>