Skip to content

Commit

Permalink
Add:Podcast library filter for languages and show language on podcast…
Browse files Browse the repository at this point in the history
… item page
  • Loading branch information
advplyr committed Apr 8, 2024
1 parent 04993dd commit e60d2a9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/components/content/LibraryItemDetails.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</template>
</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">
<span class="text-white text-opacity-60 uppercase text-sm">{{ $strings.LabelLanguage }}</span>
</div>
Expand Down
5 changes: 5 additions & 0 deletions client/components/controls/LibraryFilterSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,11 @@ export default {
value: 'tags',
sublist: true
},
{
text: this.$strings.LabelLanguage,
value: 'languages',
sublist: true
},
{
text: this.$strings.ButtonIssues,
value: 'issues',
Expand Down
5 changes: 4 additions & 1 deletion server/utils/queries/libraryFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ module.exports = {
libraryId: libraryId
}
},
attributes: ['tags', 'genres']
attributes: ['tags', 'genres', 'language']
})
for (const podcast of podcasts) {
if (podcast.tags?.length) {
Expand All @@ -460,6 +460,9 @@ module.exports = {
if (podcast.genres?.length) {
podcast.genres.forEach((genre) => data.genres.add(genre))
}
if (podcast.language) {
data.languages.add(podcast.language)
}
}
} else {
const books = await Database.bookModel.findAll({
Expand Down
2 changes: 2 additions & 0 deletions server/utils/queries/libraryItemsPodcastFilters.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ module.exports = {
[Sequelize.Op.gte]: 1
})
replacements.filterValue = value
} else if (group === 'languages') {
mediaWhere['language'] = value
}

return {
Expand Down

0 comments on commit e60d2a9

Please sign in to comment.