fix(webui): filter values could be duplicated

This commit is contained in:
Gauthier Roebroeck 2020-09-01 11:41:42 +08:00
parent e0cff70ff5
commit e91954f6bd
3 changed files with 13 additions and 13 deletions

View file

@ -273,15 +273,15 @@ export default Vue.extend({
this.collection = await this.$komgaCollections.getOneCollection(collectionId)
await this.loadSeries(collectionId)
this.filterOptionsPanel.library.values.push(...this.$store.state.komgaLibraries.libraries.map((x: LibraryDto) => ({
this.filterOptionsPanel.library.values = this.$store.state.komgaLibraries.libraries.map((x: LibraryDto) => ({
name: x.name,
value: x.id,
})))
this.filterOptionsPanel.genre.values.push(...toNameValue(await this.$komgaReferential.getGenres(undefined, collectionId)))
this.filterOptionsPanel.tag.values.push(...toNameValue(await this.$komgaReferential.getTags(undefined, undefined, collectionId)))
this.filterOptionsPanel.publisher.values.push(...toNameValue(await this.$komgaReferential.getPublishers(undefined, collectionId)))
this.filterOptionsPanel.language.values.push(...(await this.$komgaReferential.getLanguages(undefined, collectionId)))
this.filterOptionsPanel.ageRating.values.push(...toNameValue(await this.$komgaReferential.getAgeRatings(undefined, collectionId)))
}))
this.filterOptionsPanel.genre.values = toNameValue(await this.$komgaReferential.getGenres(undefined, collectionId))
this.filterOptionsPanel.tag.values = toNameValue(await this.$komgaReferential.getTags(undefined, undefined, collectionId))
this.filterOptionsPanel.publisher.values = toNameValue(await this.$komgaReferential.getPublishers(undefined, collectionId))
this.filterOptionsPanel.language.values = (await this.$komgaReferential.getLanguages(undefined, collectionId))
this.filterOptionsPanel.ageRating.values = toNameValue(await this.$komgaReferential.getAgeRatings(undefined, collectionId))
},
updateRoute () {
const loc = {

View file

@ -321,11 +321,11 @@ export default Vue.extend({
this.library = this.getLibraryLazy(libraryId)
const requestLibraryId = libraryId !== LIBRARIES_ALL ? libraryId : undefined
this.filterOptionsPanel.genre.values.push(...toNameValue(await this.$komgaReferential.getGenres(requestLibraryId)))
this.filterOptionsPanel.tag.values.push(...toNameValue(await this.$komgaReferential.getTags(requestLibraryId)))
this.filterOptionsPanel.publisher.values.push(...toNameValue(await this.$komgaReferential.getPublishers(requestLibraryId)))
this.filterOptionsPanel.language.values.push(...(await this.$komgaReferential.getLanguages(requestLibraryId)))
this.filterOptionsPanel.ageRating.values.push(...toNameValue(await this.$komgaReferential.getAgeRatings(requestLibraryId)))
this.filterOptionsPanel.genre.values = toNameValue(await this.$komgaReferential.getGenres(requestLibraryId))
this.filterOptionsPanel.tag.values = toNameValue(await this.$komgaReferential.getTags(requestLibraryId))
this.filterOptionsPanel.publisher.values = toNameValue(await this.$komgaReferential.getPublishers(requestLibraryId))
this.filterOptionsPanel.language.values = (await this.$komgaReferential.getLanguages(requestLibraryId))
this.filterOptionsPanel.ageRating.values = toNameValue(await this.$komgaReferential.getAgeRatings(requestLibraryId))
await this.loadPage(libraryId, this.page, this.sortActive)
},

View file

@ -412,7 +412,7 @@ export default Vue.extend({
this.series = await this.$komgaSeries.getOneSeries(seriesId)
this.collections = await this.$komgaSeries.getCollections(seriesId)
this.filterOptionsPanel.tag.values.push(...toNameValue(await this.$komgaReferential.getTags(undefined, this.seriesId)))
this.filterOptionsPanel.tag.values = toNameValue(await this.$komgaReferential.getTags(undefined, this.seriesId))
await this.loadPage(seriesId, this.page, this.sortActive)
},