diff --git a/src/renderer/components/ft-search-filters/ft-search-filters.js b/src/renderer/components/ft-search-filters/ft-search-filters.js index aaf0c7b66..3fe6da742 100644 --- a/src/renderer/components/ft-search-filters/ft-search-filters.js +++ b/src/renderer/components/ft-search-filters/ft-search-filters.js @@ -28,11 +28,13 @@ export default defineComponent({ 'all', 'video', 'channel', - 'playlist' + 'playlist', + 'movie' ], durationValues: [ '', 'short', + 'medium', 'long' ] } @@ -76,7 +78,8 @@ export default defineComponent({ this.$t('Search Filters.Type.All Types'), this.$t('Search Filters.Type.Videos'), this.$t('Search Filters.Type.Channels'), - this.$t('Playlists') + this.$t('Playlists'), + this.$t('Search Filters.Type.Movies') ] }, @@ -84,18 +87,23 @@ export default defineComponent({ return [ this.$t('Search Filters.Duration.All Durations'), this.$t('Search Filters.Duration.Short (< 4 minutes)'), + this.$t('Search Filters.Duration.Medium (4 - 20 minutes)'), this.$t('Search Filters.Duration.Long (> 20 minutes)') ] } }, methods: { + isVideoOrMovieOrAll(type) { + return type === 'video' || type === 'movie' || type === 'all' + }, + updateSortBy: function (value) { this.$store.commit('setSearchSortBy', value) this.$emit('filterValueUpdated', this.filterValueChanged) }, updateTime: function (value) { - if (this.searchSettings.type !== 'video') { + if (!this.isVideoOrMovieOrAll(this.searchSettings.type)) { const typeRadio = this.$refs.typeRadio typeRadio.updateSelectedValue('all') this.$store.commit('setSearchType', 'all') @@ -108,17 +116,20 @@ export default defineComponent({ if (value === 'channel' || value === 'playlist') { const timeRadio = this.$refs.timeRadio const durationRadio = this.$refs.durationRadio + const sortByRadio = this.$refs.sortByRadio timeRadio.updateSelectedValue('') durationRadio.updateSelectedValue('') + sortByRadio.updateSelectedValue(this.sortByValues[0]) this.$store.commit('setSearchTime', '') this.$store.commit('setSearchDuration', '') + this.$store.commit('setSearchSortBy', this.sortByValues[0]) } this.$store.commit('setSearchType', value) this.$emit('filterValueUpdated', this.filterValueChanged) }, updateDuration: function (value) { - if (value !== '' && this.searchSettings.type !== 'video') { + if (value !== '' && !this.isVideoOrMovieOrAll(this.searchSettings.type)) { const typeRadio = this.$refs.typeRadio typeRadio.updateSelectedValue('all') this.updateType('all') diff --git a/src/renderer/helpers/api/local.js b/src/renderer/helpers/api/local.js index e982e7425..f73675761 100644 --- a/src/renderer/helpers/api/local.js +++ b/src/renderer/helpers/api/local.js @@ -350,7 +350,7 @@ function convertSearchFilters(filters) { } if (filters.duration) { - convertedFilters.type = filters.duration + convertedFilters.duration = filters.duration } } diff --git a/static/locales/en-US.yaml b/static/locales/en-US.yaml index 995484509..7b5980bbc 100644 --- a/static/locales/en-US.yaml +++ b/static/locales/en-US.yaml @@ -65,11 +65,13 @@ Search Filters: All Types: All Types Videos: Videos Channels: Channels + Movies: Movies #& Playlists Duration: Duration: Duration All Durations: All Durations Short (< 4 minutes): Short (< 4 minutes) + Medium (4 - 20 minutes): Medium (4 - 20 minutes) Long (> 20 minutes): Long (> 20 minutes) # On Search Page Search Results: Search Results