Add:Podcast library filter for languages and show language on podcast item page

This commit is contained in:
advplyr 2024-04-08 15:48:41 -05:00
parent 04993dd63d
commit e60d2a9858
4 changed files with 12 additions and 2 deletions

View File

@ -89,7 +89,7 @@
</template> </template>
</div> </div>
</div> </div>
<div v-if="language && !isPodcast" class="flex py-0.5"> <div v-if="language" class="flex py-0.5">
<div class="w-24 min-w-24 sm:w-32 sm:min-w-32"> <div class="w-24 min-w-24 sm:w-32 sm:min-w-32">
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelLanguage }}</span> <span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelLanguage }}</span>
</div> </div>

View File

@ -235,6 +235,11 @@ export default {
value: 'tags', value: 'tags',
sublist: true sublist: true
}, },
{
text: this.$strings.LabelLanguage,
value: 'languages',
sublist: true
},
{ {
text: this.$strings.ButtonIssues, text: this.$strings.ButtonIssues,
value: 'issues', value: 'issues',

View File

@ -451,7 +451,7 @@ module.exports = {
libraryId: libraryId libraryId: libraryId
} }
}, },
attributes: ['tags', 'genres'] attributes: ['tags', 'genres', 'language']
}) })
for (const podcast of podcasts) { for (const podcast of podcasts) {
if (podcast.tags?.length) { if (podcast.tags?.length) {
@ -460,6 +460,9 @@ module.exports = {
if (podcast.genres?.length) { if (podcast.genres?.length) {
podcast.genres.forEach((genre) => data.genres.add(genre)) podcast.genres.forEach((genre) => data.genres.add(genre))
} }
if (podcast.language) {
data.languages.add(podcast.language)
}
} }
} else { } else {
const books = await Database.bookModel.findAll({ const books = await Database.bookModel.findAll({

View File

@ -51,6 +51,8 @@ module.exports = {
[Sequelize.Op.gte]: 1 [Sequelize.Op.gte]: 1
}) })
replacements.filterValue = value replacements.filterValue = value
} else if (group === 'languages') {
mediaWhere['language'] = value
} }
return { return {