Ai_GirlFriend/fix_song_audio_urls.sql
2026-03-06 18:59:17 +08:00

47 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 修复歌曲库中不存在的音频文件
-- 方案:临时禁用这些有问题的歌曲,或者更新为可用的音频 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;