47 lines
1.1 KiB
MySQL
47 lines
1.1 KiB
MySQL
|
|
-- 修复歌曲库中不存在的音频文件
|
|||
|
|
-- 方案:临时禁用这些有问题的歌曲,或者更新为可用的音频 URL
|
|||
|
|
|
|||
|
|
-- 1. 查看当前有问题的歌曲(audio_url 包含 20260126 或 20260117)
|
|||
|
|
SELECT
|
|||
|
|
id,
|
|||
|
|
title,
|
|||
|
|
artist,
|
|||
|
|
audio_url,
|
|||
|
|
status,
|
|||
|
|
gender
|
|||
|
|
FROM nf_song_library
|
|||
|
|
WHERE deletetime IS NULL
|
|||
|
|
AND (audio_url LIKE '%/20260126/%' OR audio_url LIKE '%/20260117/%')
|
|||
|
|
ORDER BY id;
|
|||
|
|
|
|||
|
|
-- 2. 临时禁用这些歌曲(推荐方案)
|
|||
|
|
-- 取消下面的注释来执行
|
|||
|
|
/*
|
|||
|
|
UPDATE nf_song_library
|
|||
|
|
SET status = 0
|
|||
|
|
WHERE deletetime IS NULL
|
|||
|
|
AND (audio_url LIKE '%/20260126/%' OR audio_url LIKE '%/20260117/%');
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
-- 3. 或者使用外部 URL(如果有的话)
|
|||
|
|
-- 例如:使用 www.bensound.com 的测试音频
|
|||
|
|
/*
|
|||
|
|
UPDATE nf_song_library
|
|||
|
|
SET audio_url = 'https://www.bensound.com/bensound-music/bensound-dreams.mp3'
|
|||
|
|
WHERE id = 11 AND title = 'Dreams';
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
-- 4. 查看可用的歌曲(使用外部 URL 的)
|
|||
|
|
SELECT
|
|||
|
|
id,
|
|||
|
|
title,
|
|||
|
|
artist,
|
|||
|
|
audio_url,
|
|||
|
|
status,
|
|||
|
|
gender
|
|||
|
|
FROM nf_song_library
|
|||
|
|
WHERE deletetime IS NULL
|
|||
|
|
AND status = 1
|
|||
|
|
AND (audio_url LIKE 'http%' AND audio_url NOT LIKE '%/uploads/%')
|
|||
|
|
ORDER BY id;
|