mirror of
https://github.com/algerkong/AlgerMusicPlayer.git
synced 2026-04-28 02:47:22 +08:00
🔧 chore: 更新音乐源设置,移除 YouTube,添加 Kuwo,确保平台一致性
This commit is contained in:
+1
-1
@@ -23,5 +23,5 @@
|
|||||||
"alwaysShowDownloadButton": false,
|
"alwaysShowDownloadButton": false,
|
||||||
"unlimitedDownload": false,
|
"unlimitedDownload": false,
|
||||||
"enableMusicUnblock": true,
|
"enableMusicUnblock": true,
|
||||||
"enabledMusicSources": ["migu", "kugou", "pyncmd", "bilibili", "youtube"]
|
"enabledMusicSources": ["migu", "kugou", "pyncmd", "bilibili", "kuwo"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import match from '@unblockneteasemusic/server';
|
import match from '@unblockneteasemusic/server';
|
||||||
|
|
||||||
type Platform = 'qq' | 'migu' | 'kugou' | 'pyncmd' | 'joox' | 'kuwo' | 'bilibili' | 'youtube';
|
type Platform = 'qq' | 'migu' | 'kugou' | 'pyncmd' | 'joox' | 'kuwo' | 'bilibili';
|
||||||
|
|
||||||
interface SongData {
|
interface SongData {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -30,7 +30,7 @@ interface UnblockResult {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 所有可用平台
|
// 所有可用平台
|
||||||
export const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'kuwo', 'bilibili', 'youtube'];
|
export const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'kuwo', 'bilibili'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 音乐解析函数
|
* 音乐解析函数
|
||||||
@@ -46,12 +46,16 @@ const unblockMusic = async (
|
|||||||
retryCount = 1,
|
retryCount = 1,
|
||||||
enabledPlatforms?: Platform[]
|
enabledPlatforms?: Platform[]
|
||||||
): Promise<UnblockResult> => {
|
): Promise<UnblockResult> => {
|
||||||
const platforms = enabledPlatforms || ALL_PLATFORMS;
|
// 过滤 enabledPlatforms,确保只包含 ALL_PLATFORMS 中存在的平台
|
||||||
|
const filteredPlatforms = enabledPlatforms
|
||||||
|
? enabledPlatforms.filter(platform => ALL_PLATFORMS.includes(platform))
|
||||||
|
: ALL_PLATFORMS;
|
||||||
|
|
||||||
songData.album = songData.album || songData.al;
|
songData.album = songData.album || songData.al;
|
||||||
songData.artists = songData.artists || songData.ar;
|
songData.artists = songData.artists || songData.ar;
|
||||||
const retry = async (attempt: number): Promise<UnblockResult> => {
|
const retry = async (attempt: number): Promise<UnblockResult> => {
|
||||||
try {
|
try {
|
||||||
const data = await match(parseInt(String(id), 10), platforms,songData);
|
const data = await match(parseInt(String(id), 10), filteredPlatforms, songData);
|
||||||
const result: UnblockResult = {
|
const result: UnblockResult = {
|
||||||
data: {
|
data: {
|
||||||
data,
|
data,
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const props = defineProps({
|
|||||||
},
|
},
|
||||||
sources: {
|
sources: {
|
||||||
type: Array as () => Platform[],
|
type: Array as () => Platform[],
|
||||||
default: () => ['migu', 'kugou', 'pyncmd', 'bilibili', 'youtube']
|
default: () => ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo']
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -72,7 +72,6 @@ const musicSourceOptions = ref([
|
|||||||
{ label: 'pyncmd', value: 'pyncmd' },
|
{ label: 'pyncmd', value: 'pyncmd' },
|
||||||
{ label: '酷我音乐', value: 'kuwo' },
|
{ label: '酷我音乐', value: 'kuwo' },
|
||||||
{ label: 'Bilibili音乐', value: 'bilibili' },
|
{ label: 'Bilibili音乐', value: 'bilibili' },
|
||||||
{ label: 'YouTube', value: 'youtube' },
|
|
||||||
{ label: 'GD音乐台', value: 'gdmusic' }
|
{ label: 'GD音乐台', value: 'gdmusic' }
|
||||||
]);
|
]);
|
||||||
|
|
||||||
@@ -103,7 +102,7 @@ watch(
|
|||||||
|
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
// 确保至少选择一个音源
|
// 确保至少选择一个音源
|
||||||
const defaultPlatforms = ['migu', 'kugou', 'pyncmd', 'bilibili', 'youtube'];
|
const defaultPlatforms = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo'];
|
||||||
const valuesToEmit = selectedSources.value.length > 0
|
const valuesToEmit = selectedSources.value.length > 0
|
||||||
? [...new Set(selectedSources.value)]
|
? [...new Set(selectedSources.value)]
|
||||||
: defaultPlatforms;
|
: defaultPlatforms;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
// 音乐平台类型
|
// 音乐平台类型
|
||||||
export type Platform = 'qq' | 'migu' | 'kugou' | 'pyncmd' | 'joox' | 'kuwo' | 'bilibili' | 'youtube' | 'gdmusic';
|
export type Platform = 'qq' | 'migu' | 'kugou' | 'pyncmd' | 'joox' | 'kuwo' | 'bilibili' | 'gdmusic';
|
||||||
|
|
||||||
// 默认平台列表
|
// 默认平台列表
|
||||||
export const DEFAULT_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'youtube'];
|
export const DEFAULT_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo'];
|
||||||
@@ -486,7 +486,7 @@ import { type Platform } from '@/types/music';
|
|||||||
import config from '../../../../package.json';
|
import config from '../../../../package.json';
|
||||||
|
|
||||||
// 所有平台默认值
|
// 所有平台默认值
|
||||||
const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'youtube'];
|
const ALL_PLATFORMS: Platform[] = ['migu', 'kugou', 'pyncmd', 'bilibili', 'kuwo'];
|
||||||
|
|
||||||
const settingsStore = useSettingsStore();
|
const settingsStore = useSettingsStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
|||||||
Reference in New Issue
Block a user