Skip to content
This repository was archived by the owner on Jul 17, 2026. It is now read-only.

Dev fixerr - #773

Merged
imsyy merged 7 commits into
devfrom
dev-fixerr
Jan 26, 2026
Merged

imsyy merged 7 commits into
devfrom
dev-fixerr

Conversation

@kazukokawagawa

Copy link
Copy Markdown
Collaborator

No description provided.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @kazukokawagawa, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on improving the stability of lyric parsing by cleaning TTML content and significantly enhancing the debugging experience for audio source resolution. The added logging will provide developers with a clearer understanding of how song URLs and qualities are determined and fetched, making it easier to troubleshoot playback issues.

Highlights

  • TTML Lyric Parsing Improvement: Modified LyricManager.ts to strip newline characters and surrounding whitespace from TTML content before parsing. This change is applied both when returning cleaned TTML and when parsing local TTML lyrics, aiming to prevent parsing errors caused by extraneous whitespace.
  • Enhanced Song Quality Debugging: Introduced multiple console.log statements with a [QualityDebug] prefix across SongManager.ts. These logs provide detailed insights into the song quality determination process, URL retrieval attempts (official, unlocked, cached), and fallback mechanisms, which will aid in diagnosing audio source issues.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request appears to fix an issue with TTML lyric parsing by removing newlines before parsing. However, this fix introduces some code duplication. Additionally, a number of debugging console.log statements have been added to SongManager.ts, which should be removed before this is merged into a main branch. My review includes a suggestion to refactor for code reuse and comments to remove the debug logs.

Comment thread src/core/player/LyricManager.ts Outdated
const ttmlContent = typeof ttml === "string" ? ttml : "";
if (ttmlContent) {
ttmlLines = parseTTML(ttmlContent).lines || [];
ttmlLines = parseTTML(ttmlContent.replace(/\n\s*/g, "")).lines || [];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

There's an opportunity to avoid code duplication here. The logic ttmlContent.replace(/\n\s*/g, "") was also added to cleanTTMLTranslations in this PR. Instead of repeating the replacement here, you could reuse cleanTTMLTranslations to ensure consistency and better maintainability.

Suggested change
ttmlLines = parseTTML(ttmlContent.replace(/\n\s*/g, "")).lines || [];
ttmlLines = parseTTML(this.cleanTTMLTranslations(ttmlContent)).lines || [];
Comment thread src/core/player/SongManager.ts Outdated
const finalUrl = isTrial && !settingStore.playSongDemo ? null : normalizedUrl;
// 获取音质
const quality = handleSongQuality(songData, "online");
console.log(`[QualityDebug] getOnlineUrl quality determined: ${quality} for song ${id}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

Comment thread src/core/player/SongManager.ts Outdated
public getUnlockSongUrl = async (song: SongType): Promise<AudioSource> => {
const settingStore = useSettingStore();
const songId = song.id;
console.log(`[QualityDebug] getUnlockSongUrl called for song ${songId}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

Comment thread src/core/player/SongManager.ts Outdated
// 优先检查本地缓存
const cachedUrl = await this.checkLocalCache(songId);
if (cachedUrl) {
console.log(`[QualityDebug] getUnlockSongUrl found in local cache: ${cachedUrl}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

if (unlockUrl && (unlockUrl.includes(".flac") || unlockUrl.includes(".wav"))) {
quality = QualityType.SQ;
}
console.log(`最终音质判断:详细输出:`, { unlockUrl, quality });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

Comment thread src/core/player/SongManager.ts Outdated
*/
public getAudioSource = async (song: SongType): Promise<AudioSource> => {
const settingStore = useSettingStore();
console.log(`[QualityDebug] getAudioSource called for song ${song.id} (${song.name})`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

Comment thread src/core/player/SongManager.ts Outdated
// 如果官方链接有效且非试听(或者用户接受试听)
if (officialUrl && (!isTrial || (isTrial && settingStore.playSongDemo))) {
if (isTrial) window.$message.warning("当前歌曲仅可试听");
console.log(`[QualityDebug] Using official URL. Quality: ${quality}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

Comment thread src/core/player/SongManager.ts Outdated
Comment on lines +373 to +374
console.log(`🔓 [${songId}] 解锁成功`, unlockUrl);
console.log(`[QualityDebug] Using unlocked URL. Quality: ${unlockUrl.quality}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These lines appear to be for debugging. Logging the entire unlockUrl object should be avoided in production code. Please remove the new debug log and consider reverting the other log to its original state.

Suggested change
console.log(`🔓 [${songId}] 解锁成功`, unlockUrl);
console.log(`[QualityDebug] Using unlocked URL. Quality: ${unlockUrl.quality}`);
console.log(`🔓 [${songId}] 解锁成功`);
Comment thread src/core/player/SongManager.ts Outdated
const fallbackUrl = await this.checkLocalCache(songId);
if (fallbackUrl) {
console.log(`🚀 [${songId}] 网络请求失败,使用本地缓存兜底`);
console.log(`[QualityDebug] Fallback to cache (network fail). URL: ${fallbackUrl}`);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This appears to be a debug log. It's best to remove these before merging to keep the console clean in production.

@imsyy
imsyy merged commit e0380ad into dev Jan 26, 2026
4 checks passed
@kazukokawagawa
kazukokawagawa deleted the dev-fixerr branch January 27, 2026 05:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants