mirror of
https://github.com/tachiyomiorg/website.git
synced 2024-12-20 23:22:00 +01:00
Remove irrelevant NSFW filter for extensions
This commit is contained in:
parent
f087aebccb
commit
ed9378f616
@ -15,21 +15,18 @@ import {
|
||||
import { langName, simpleLangName } from '../../../config/scripts/languages'
|
||||
import type { Extension } from '../../queries/useExtensionsRepositoryQuery'
|
||||
|
||||
export type Nsfw = 'Show all' | 'NSFW' | 'SFW'
|
||||
export type Sort = 'Ascending' | 'Descending'
|
||||
|
||||
const props = defineProps<{
|
||||
extensions: Extension[][]
|
||||
search: string
|
||||
lang: string[]
|
||||
nsfw: Nsfw
|
||||
sort: Sort
|
||||
}>()
|
||||
|
||||
defineEmits<{
|
||||
(e: 'update:search', search: string): void
|
||||
(e: 'update:lang', lang: string[]): void
|
||||
(e: 'update:nsfw', nsfw: Nsfw): void
|
||||
(e: 'update:sort', sort: Sort): void
|
||||
}>()
|
||||
|
||||
@ -76,16 +73,6 @@ const labelPosition = computed(() => isSmallScreen.value ? 'top' : 'right')
|
||||
<ElRadio label="Descending" />
|
||||
</ElRadioGroup>
|
||||
</ElFormItem>
|
||||
<ElFormItem label="Display mode:">
|
||||
<ElRadioGroup
|
||||
:model-value="nsfw"
|
||||
@update:model-value="$emit('update:nsfw', $event)"
|
||||
>
|
||||
<ElRadio label="NSFW" />
|
||||
<ElRadio label="SFW" />
|
||||
<ElRadio label="Show all" />
|
||||
</ElRadioGroup>
|
||||
</ElFormItem>
|
||||
</ElForm>
|
||||
</div>
|
||||
</ClientOnly>
|
||||
|
@ -12,7 +12,6 @@ const pkgId = computed(() => {
|
||||
})
|
||||
|
||||
const pkgName = computed(() => item.value.name.split(': ')[1])
|
||||
const pkgIsNsfw = computed(() => item.value.nsfw === 1)
|
||||
|
||||
const iconUrl = computed(() => {
|
||||
return `https://raw.githubusercontent.com/tachiyomiorg/extensions/repo/icon/${item.value.pkg}.png`
|
||||
@ -43,8 +42,7 @@ function handleAnalytics() {
|
||||
{{ pkgId }}
|
||||
</div>
|
||||
</div>
|
||||
<Badge v-if="pkgIsNsfw" type="danger" :text="item.version" title="This extension contains NSFW entries." />
|
||||
<Badge v-else type="info" :text="item.version" title="This extension is free from NSFW entries." />
|
||||
<Badge type="info" :text="item.version" />
|
||||
<a
|
||||
:href="apkUrl"
|
||||
class="extension-download"
|
||||
|
@ -8,7 +8,7 @@ import useExtensionsRepositoryQuery from '../../queries/useExtensionsRepositoryQ
|
||||
import type { Extension } from '../../queries/useExtensionsRepositoryQuery'
|
||||
import ExtensionFilters from './ExtensionFilters.vue'
|
||||
import ExtensionList from './ExtensionList.vue'
|
||||
import type { Nsfw, Sort } from './ExtensionFilters.vue'
|
||||
import type { Sort } from './ExtensionFilters.vue'
|
||||
|
||||
const { data: extensions, isLoading } = useExtensionsRepositoryQuery({
|
||||
select: (response) => {
|
||||
@ -22,7 +22,6 @@ const { data: extensions, isLoading } = useExtensionsRepositoryQuery({
|
||||
const filters = reactive({
|
||||
search: '',
|
||||
lang: [] as string[],
|
||||
nsfw: 'Show all' as Nsfw,
|
||||
sort: 'Ascending' as Sort,
|
||||
})
|
||||
|
||||
@ -65,9 +64,6 @@ const filteredExtensions = computed(() => {
|
||||
|| ext.sources.some(source => source.id.includes(filters.search)),
|
||||
)
|
||||
}
|
||||
filteredGroup = filteredGroup.filter(ext =>
|
||||
filters.nsfw === 'Show all' ? true : ext.nsfw === (filters.nsfw === 'NSFW' ? 1 : 0),
|
||||
)
|
||||
|
||||
if (filters.sort && filters.sort === 'Descending')
|
||||
filteredGroup = filteredGroup.reverse()
|
||||
@ -109,7 +105,6 @@ watch([isLoading, loadingInstance], async ([newIsLoading]) => {
|
||||
<ExtensionFilters
|
||||
v-model:search="filters.search"
|
||||
v-model:lang="filters.lang"
|
||||
v-model:nsfw="filters.nsfw"
|
||||
v-model:sort="filters.sort"
|
||||
:extensions="extensions ?? []"
|
||||
/>
|
||||
|
@ -12,9 +12,6 @@ export interface Extension {
|
||||
lang: string
|
||||
code: number
|
||||
version: string
|
||||
nsfw: number
|
||||
hasReadme: number
|
||||
hasChangelog: number
|
||||
sources: Source[]
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user