Added select all option to the episode selector

This commit is contained in:
Rasmus Krämer 2022-04-09 10:25:24 +02:00
parent baf738f5ba
commit 5c91c1e2c7
3 changed files with 16 additions and 3 deletions

4
.gitignore vendored
View File

@ -4,6 +4,7 @@ node_modules/
/config/
/audiobooks/
/audiobooks2/
/podcasts/
/media/
/metadata/
test/
@ -11,4 +12,5 @@ test/
/client/dist/
/dist/
sw.*
sw.*
.DS_STORE

View File

@ -39,6 +39,14 @@
<div class="w-full md:w-1/2 p-4">
<p class="text-lg font-semibold mb-2">Episodes</p>
<div ref="episodeContainer" id="episodes-scroll" class="w-full overflow-x-hidden overflow-y-auto">
<div class="relative">
<div class="absolute top-0 left-0 h-full flex items-center p-2">
<ui-checkbox small checkbox-bg="primary" border-color="gray-600" v-on:input="selectedEpisodes = episodes.map(_ => !allSelected)" v-bind:value="allSelected" />
</div>
<div class="px-8 py-2">
<p class="font-semibold text-gray-200">Select all episodes</p>
</div>
</div>
<div v-for="(episode, index) in episodes" :key="index" class="relative cursor-pointer" :class="selectedEpisodes[String(index)] ? 'bg-success bg-opacity-10' : index % 2 == 0 ? 'bg-primary bg-opacity-25 hover:bg-opacity-40' : 'bg-primary bg-opacity-5 hover:bg-opacity-25'" @click="toggleSelectEpisode(index)">
<div class="absolute top-0 left-0 h-full flex items-center p-2">
<ui-checkbox v-model="selectedEpisodes[String(index)]" small checkbox-bg="primary" border-color="gray-600" />
@ -149,6 +157,9 @@ export default {
if (!this.podcastFeedData) return []
return this.podcastFeedData.episodes || []
},
allSelected() {
return Object.values(this.selectedEpisodes).filter(episode => !episode).length === 0
},
episodesSelected() {
return Object.keys(this.selectedEpisodes).filter((key) => !!this.selectedEpisodes[key])
},

View File

@ -150,8 +150,8 @@ class Server {
app.use(this.auth.cors)
app.use(fileUpload())
app.use(express.urlencoded({ extended: true }));
app.use(express.json())
app.use(express.urlencoded({ extended: true, limit: "3mb" }));
app.use(express.json({ limit: "3mb" }))
// Static path to generated nuxt
const distPath = Path.join(global.appRoot, '/client/dist')