Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Convert audio as a supported media type #1801

Merged
merged 1 commit into from
Sep 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/components/VContentSwitcher/VSearchTypeItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<div class="flex w-full flex-row items-center gap-2 py-2 text-base">
<VIcon :icon-path="icon" />
<span class="font-semibold">{{ $t(`search-type.${item}`) }}</span>
<VPill v-if="status === 'beta'" class="ms-auto">{{
<VPill v-if="isBeta" class="ms-auto">{{
$t('search-type.status-beta')
}}</VPill>
</div>
Expand All @@ -19,7 +19,7 @@
<script>
import { computed, useContext, defineComponent } from '@nuxtjs/composition-api'
import { ALL_MEDIA, contentStatus } from '~/constants/media'
import { ALL_MEDIA, BETA, contentStatus } from '~/constants/media'
import { useSearchStore } from '~/stores/search'
import VIcon from '~/components/VIcon/VIcon.vue'
Expand All @@ -42,9 +42,7 @@ export default defineComponent({
const { app } = useContext()
const searchStore = useSearchStore()
const status = computed(() => {
return contentStatus[props.item]
})
const isBeta = computed(() => contentStatus[props.item] === BETA)
/**
* The query sets the filters that are applicable for the specific search type.
Expand All @@ -63,7 +61,7 @@ export default defineComponent({
})
return {
component,
status,
isBeta,
}
},
})
Expand Down
8 changes: 4 additions & 4 deletions src/constants/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ export function isAdditionalSearchType(

/* Media support */

const SUPPORTED = 'supported' // Native search
const BETA = 'beta' // Native but incomplete search
const ADDITIONAL = 'additional' // Meta search
export const SUPPORTED = 'supported' // Native search
export const BETA = 'beta' // Native but incomplete search
export const ADDITIONAL = 'additional' // Meta search

export const contentStatus = Object.freeze({
[ALL_MEDIA]: SUPPORTED,
[IMAGE]: SUPPORTED,
[AUDIO]: BETA,
[AUDIO]: SUPPORTED,
[VIDEO]: ADDITIONAL,
[MODEL_3D]: ADDITIONAL,
} as const)
Expand Down