Skip to content

feat(lyrics-plus): optimize lyrics convert performance & improved code quality #3311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

Lseoksee
Copy link
Contributor

@Lseoksee Lseoksee commented Feb 14, 2025

Changes

lyrics Convert Performance Improvement

  • Introduced caching for converted lyrics and optimized the process by ensuring that only the selected Display Mode is applied instead of converting into all formats for a single language.

Unifying Convert and Translation Code

  • Improved code consistency between Convert and Translation functionalities.

improved Lyrics Mode Select

  • If the lyrics are not in lockMode, the last used mode for that lyrics is stored in memory.
    When the lyrics are reloaded, they will automatically switch to the saved mode.

Remove Korean-To-Korean Conversion

  • Converting lyrics detected as Korean back into Korean is unnecessary. Only romaja conversion will be retained.

Provider Label Update for Spotify Official Lyrics

  • Previously, Spotify's official lyrics provider was displayed as musixmatch; this has now been changed to Spotify.

Please let me know if you have any feedback on this.

New Features

  • Added a function in Lyrics Config to clear cached lyrics from memory.
  • Added an option to delete individual locally saved lyrics.
    • Pressing the Save Lyrics button again will remove the stored lyrics.

@Lseoksee Lseoksee changed the title feat(lyrics-plus): Optimize Convert performance and improved overall code quality feat(lyrics-plus): optimize lyrics convert performance & improved code quality Feb 14, 2025
@rxri rxri requested a review from Copilot February 14, 2025 13:09
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.

Files not reviewed (1)
  • CustomApps/lyrics-plus/OptionsMenu.js: Evaluated as low risk
Comments suppressed due to low confidence (3)

CustomApps/lyrics-plus/Translator.js:48

  • The call to injectExternals inside the setInterval seems redundant and could lead to performance issues. Consider checking if the external scripts are already loaded before calling this function.
this.injectExternals(language);

CustomApps/lyrics-plus/Translator.js:53

  • The clearInterval and resolve calls should be inside the if (this.finished[lan]) block to ensure they are only executed when the condition is met.
clearInterval(interval);

CustomApps/lyrics-plus/Utils.js:12

  • The element 'p1' is not a valid HTML element. It should be 'p'.
return react.createElement("p1", null, reactChildren);

@rxri rxri merged commit 2e4f3ad into spicetify:main Feb 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants