fix(music): remove Douban explore mode switch

This commit is contained in:
jxxghp
2026-08-12 13:13:54 +08:00
parent d7534ecba4
commit f5f7a35e29
5 changed files with 8 additions and 26 deletions
-2
View File
@@ -4232,8 +4232,6 @@ export default {
zone: 'Region', zone: 'Region',
year: 'Year', year: 'Year',
music: { music: {
browse: 'Browse',
mode: { chart: 'Charts', tag: 'Categories' },
genre: { genre: {
pop: 'Pop', pop: 'Pop',
rock: 'Rock', rock: 'Rock',
-2
View File
@@ -4168,8 +4168,6 @@ export default {
zone: '地区', zone: '地区',
year: '年代', year: '年代',
music: { music: {
browse: '浏览',
mode: { chart: '排行榜', tag: '分类浏览' },
genre: { genre: {
pop: '流行', pop: '流行',
rock: '摇滚', rock: '摇滚',
-2
View File
@@ -4164,8 +4164,6 @@ export default {
zone: '地區', zone: '地區',
year: '年代', year: '年代',
music: { music: {
browse: '瀏覽',
mode: { chart: '排行榜', tag: '分類瀏覽' },
genre: { genre: {
pop: '流行', pop: '流行',
rock: '搖滾', rock: '搖滾',
+4 -15
View File
@@ -22,7 +22,6 @@ const doubanZone = ref('')
// 年代 // 年代
const doubanYear = ref('') const doubanYear = ref('')
const coverFilter = ref<'all' | 'with_cover'>('all') const coverFilter = ref<'all' | 'with_cover'>('all')
const musicMode = ref<'chart' | 'tag'>('chart')
const musicCategory = ref('流行') const musicCategory = ref('流行')
const musicZone = ref('') const musicZone = ref('')
const musicSort = ref<'U' | 'S' | 'R' | 'O'>('U') const musicSort = ref<'U' | 'S' | 'R' | 'O'>('U')
@@ -146,8 +145,7 @@ const listParams = computed<Record<string, unknown>>(() => {
return { return {
count: 30, count: 30,
media_source: 'doubanmusic', media_source: 'doubanmusic',
mode: musicMode.value, tags: [musicCategory.value, musicZone.value].filter(Boolean).join(','),
tags: musicMode.value === 'tag' ? [musicCategory.value, musicZone.value].filter(Boolean).join(',') : '',
douban_sort: musicSort.value, douban_sort: musicSort.value,
with_cover: coverFilter.value === 'with_cover', with_cover: coverFilter.value === 'with_cover',
} }
@@ -164,7 +162,7 @@ watch([doubanCategory, doubanZone, doubanYear], () => {
const currentKey = ref(0) const currentKey = ref(0)
// 类型和过滤参数变化后重新刷新列表 // 类型和过滤参数变化后重新刷新列表
watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, musicSort], () => { watch([type, filterParams, coverFilter, musicCategory, musicZone, musicSort], () => {
if (!type.value) { if (!type.value) {
type.value = 'movies' type.value = 'movies'
} }
@@ -259,15 +257,6 @@ watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, mus
</div> </div>
<template v-else> <template v-else>
<div class="flex justify-start align-center"> <div class="flex justify-start align-center">
<div class="mr-5">
<VLabel>{{ t('douban.music.browse') }}</VLabel>
</div>
<VChipGroup v-model="musicMode" mandatory>
<VChip value="chart" filter tile>{{ t('douban.music.mode.chart') }}</VChip>
<VChip value="tag" filter tile>{{ t('douban.music.mode.tag') }}</VChip>
</VChipGroup>
</div>
<div v-if="musicMode === 'tag'" class="flex justify-start align-center">
<div class="mr-5"> <div class="mr-5">
<VLabel>{{ t('douban.genre') }}</VLabel> <VLabel>{{ t('douban.genre') }}</VLabel>
</div> </div>
@@ -277,7 +266,7 @@ watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, mus
</VChip> </VChip>
</VChipGroup> </VChipGroup>
</div> </div>
<div v-if="musicMode === 'tag'" class="flex justify-start align-center"> <div class="flex justify-start align-center">
<div class="mr-5"> <div class="mr-5">
<VLabel>{{ t('douban.zone') }}</VLabel> <VLabel>{{ t('douban.zone') }}</VLabel>
</div> </div>
@@ -287,7 +276,7 @@ watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, mus
</VChip> </VChip>
</VChipGroup> </VChipGroup>
</div> </div>
<div v-if="musicMode === 'tag'" class="flex justify-start align-center"> <div class="flex justify-start align-center">
<div class="mr-5"> <div class="mr-5">
<VLabel>{{ t('douban.sort') }}</VLabel> <VLabel>{{ t('douban.sort') }}</VLabel>
</div> </div>
@@ -104,7 +104,7 @@ describe('DoubanView', () => {
}) })
}) })
it('merges music into Douban with chart and official tag browsing filters', async () => { it('defaults Douban music to official category browsing filters', async () => {
const user = userEvent.setup() const user = userEvent.setup()
await renderView() await renderView()
@@ -117,16 +117,16 @@ describe('DoubanView', () => {
count: 30, count: 30,
douban_sort: 'U', douban_sort: 'U',
media_source: 'doubanmusic', media_source: 'doubanmusic',
mode: 'chart', tags: '流行',
tags: '',
with_cover: false, with_cover: false,
}, },
}) })
}) })
expect(screen.queryByText('高分优先')).not.toBeInTheDocument() expect(screen.queryByText('高分优先')).not.toBeInTheDocument()
expect(screen.queryByText('2020年代')).not.toBeInTheDocument() expect(screen.queryByText('2020年代')).not.toBeInTheDocument()
expect(screen.queryByText('排行榜')).not.toBeInTheDocument()
expect(screen.queryByText('分类浏览')).not.toBeInTheDocument()
await user.click(screen.getByText('分类浏览'))
await user.click(screen.getByText('华语')) await user.click(screen.getByText('华语'))
await user.click(screen.getByText('评分排序')) await user.click(screen.getByText('评分排序'))
@@ -135,7 +135,6 @@ describe('DoubanView', () => {
count: 30, count: 30,
douban_sort: 'S', douban_sort: 'S',
media_source: 'doubanmusic', media_source: 'doubanmusic',
mode: 'tag',
tags: '流行,华语', tags: '流行,华语',
with_cover: false, with_cover: false,
}) })