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',
year: 'Year',
music: {
browse: 'Browse',
mode: { chart: 'Charts', tag: 'Categories' },
genre: {
pop: 'Pop',
rock: 'Rock',
-2
View File
@@ -4168,8 +4168,6 @@ export default {
zone: '地区',
year: '年代',
music: {
browse: '浏览',
mode: { chart: '排行榜', tag: '分类浏览' },
genre: {
pop: '流行',
rock: '摇滚',
-2
View File
@@ -4164,8 +4164,6 @@ export default {
zone: '地區',
year: '年代',
music: {
browse: '瀏覽',
mode: { chart: '排行榜', tag: '分類瀏覽' },
genre: {
pop: '流行',
rock: '搖滾',
+4 -15
View File
@@ -22,7 +22,6 @@ const doubanZone = ref('')
// 年代
const doubanYear = ref('')
const coverFilter = ref<'all' | 'with_cover'>('all')
const musicMode = ref<'chart' | 'tag'>('chart')
const musicCategory = ref('流行')
const musicZone = ref('')
const musicSort = ref<'U' | 'S' | 'R' | 'O'>('U')
@@ -146,8 +145,7 @@ const listParams = computed<Record<string, unknown>>(() => {
return {
count: 30,
media_source: 'doubanmusic',
mode: musicMode.value,
tags: musicMode.value === 'tag' ? [musicCategory.value, musicZone.value].filter(Boolean).join(',') : '',
tags: [musicCategory.value, musicZone.value].filter(Boolean).join(','),
douban_sort: musicSort.value,
with_cover: coverFilter.value === 'with_cover',
}
@@ -164,7 +162,7 @@ watch([doubanCategory, doubanZone, doubanYear], () => {
const currentKey = ref(0)
// 类型和过滤参数变化后重新刷新列表
watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, musicSort], () => {
watch([type, filterParams, coverFilter, musicCategory, musicZone, musicSort], () => {
if (!type.value) {
type.value = 'movies'
}
@@ -259,15 +257,6 @@ watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, mus
</div>
<template v-else>
<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">
<VLabel>{{ t('douban.genre') }}</VLabel>
</div>
@@ -277,7 +266,7 @@ watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, mus
</VChip>
</VChipGroup>
</div>
<div v-if="musicMode === 'tag'" class="flex justify-start align-center">
<div class="flex justify-start align-center">
<div class="mr-5">
<VLabel>{{ t('douban.zone') }}</VLabel>
</div>
@@ -287,7 +276,7 @@ watch([type, filterParams, coverFilter, musicMode, musicCategory, musicZone, mus
</VChip>
</VChipGroup>
</div>
<div v-if="musicMode === 'tag'" class="flex justify-start align-center">
<div class="flex justify-start align-center">
<div class="mr-5">
<VLabel>{{ t('douban.sort') }}</VLabel>
</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()
await renderView()
@@ -117,16 +117,16 @@ describe('DoubanView', () => {
count: 30,
douban_sort: 'U',
media_source: 'doubanmusic',
mode: 'chart',
tags: '',
tags: '流行',
with_cover: false,
},
})
})
expect(screen.queryByText('高分优先')).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('评分排序'))
@@ -135,7 +135,6 @@ describe('DoubanView', () => {
count: 30,
douban_sort: 'S',
media_source: 'doubanmusic',
mode: 'tag',
tags: '流行,华语',
with_cover: false,
})