introduce tag exclusion
This commit is contained in:
parent
9d919bfb0a
commit
246d352761
6 changed files with 31 additions and 3 deletions
|
@ -5,6 +5,8 @@ import { fetchAndParseConfig } from 'src/utilities/fetch'
|
|||
|
||||
const props = defineProps<{
|
||||
tags: string | MediaEntryTag[]
|
||||
excludeTags?: string[]
|
||||
excludeTagCategories?: string[]
|
||||
}>()
|
||||
|
||||
const emits = defineEmits<{
|
||||
|
@ -56,9 +58,11 @@ const resetTags = () => {
|
|||
}
|
||||
|
||||
onMounted(async () => {
|
||||
tagsLoaded.value = Array.isArray(props.tags)
|
||||
? tagsLoaded.value = props.tags
|
||||
const tags = Array.isArray(props.tags)
|
||||
? props.tags
|
||||
: await fetchAndParseConfig<MediaEntryTag[]>(props.tags)
|
||||
|
||||
tagsLoaded.value = tags.filter(tag => !props.excludeTags?.includes(tag.tagId) && !props.excludeTagCategories?.includes(tag.category || 'NoCategory'))
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import type {
|
|||
ConfigfulRouteDefinition,
|
||||
ListWithWarnings,
|
||||
MediaEntry,
|
||||
ResolvedListEntries,
|
||||
} from '@goldenwere/mackenzii-types'
|
||||
import { fetchAndParseConfig, fetchConfigsFromList, storage } from 'src/utilities/fetch'
|
||||
import { getCurrentRoute } from 'src/utilities/vuetils'
|
||||
|
@ -121,6 +120,8 @@ onMounted(async () => {
|
|||
FilterPanel(
|
||||
v-if='ready && globalConfig.tags'
|
||||
:tags='globalConfig.tags'
|
||||
:excludeTags='config.excludeTags'
|
||||
:excludeTagCategories='config.excludeTagCategories'
|
||||
@toggledTagsChanged='onToggledTagsChanged($event)'
|
||||
)
|
||||
Transition
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue