Skip to content

Conversation

AARP41298
Copy link
Contributor

@AARP41298 AARP41298 commented Apr 17, 2025

Hi
With the artist value i achive to resolve #3117
And prioritize lyrics improve a bit #3206
Ex. starseed was displaying the plain lyrics

This is my very first PR, let me know if somethings is wrong.

@JellyBrick JellyBrick added the enhancement New feature or request label Apr 21, 2025
@ArjixWasTaken
Copy link
Member

ArjixWasTaken commented Apr 21, 2025

Nice idea, but ontop of that I propose you construct an array of all the queries to be made, and iterate over it.
That way it is much easier to add fallback queries and expand on it in the future, and it is less repetitive.

e.g.

const queries = [`${info.artist} - ${info.title}`];
if (info.alternativeTitle) queries.push(`${info.artist} - ${info.alternativeTitle}`);
if (info.album) {
    queries.push(`${info.album} - ${info.title}`);
    if (info.alternativeTitle) queries.push(`${info.album} - ${info.alternativeTitle}`);
}

let lyrics = null;
for (const query of queries) {
    const results = await ...;

    lyrics = ...;
    if (lyrics) break;
}

...

heck, you may even gather all the search results from all the queries and do the filter on all of them

@AARP41298 AARP41298 requested a review from JellyBrick April 22, 2025 18:07
@AARP41298 AARP41298 requested a review from ArjixWasTaken April 23, 2025 20:34
@Laesx
Copy link
Contributor

Laesx commented Apr 23, 2025

To put my two cents here, I've done a quick test on your branch and the fixes from my PR seem to still work in the songs I tested, however I noticed the searching for LRCLIB seem to be much slower. Might just be me not noticing before though I'll look into it further if I have the time.

@AARP41298
Copy link
Contributor Author

AARP41298 commented Jun 4, 2025

TODO: Prioritize album name using jaroWinkler
Ex.
Gorillaz - Hong Kong
Played D-Sides version, showing Demon Days Live at the Manchester Opera House lyrics

BIGBANG - Fantastic Baby
Identify
Alive vs Still Alive vs 100 live versions of the song

EDIT:
BIGBANG - LOSER
Showing JP lyrics of the MADE SERIES album, insted of the KR ones

const weightDuration = 0.3;

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '*' and '-'. Use parentheses to clarify the intended order of operations.

const weightDuration = 0.3;

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '*' and '-'. Use parentheses to clarify the intended order of operations.

const weightDuration = 0.3;

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '-' and '*'. Use parentheses to clarify the intended order of operations.

const weightDuration = 0.3;

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '-' and '*'. Use parentheses to clarify the intended order of operations.

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
const scoreB =
weightAlbumRatio * arB! - weightDuration * normalizedDurationB;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '*' and '-'. Use parentheses to clarify the intended order of operations.

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
const scoreB =
weightAlbumRatio * arB! - weightDuration * normalizedDurationB;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '*' and '-'. Use parentheses to clarify the intended order of operations.

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
const scoreB =
weightAlbumRatio * arB! - weightDuration * normalizedDurationB;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '-' and '*'. Use parentheses to clarify the intended order of operations.

const scoreA =
weightAlbumRatio * arA! - weightDuration * normalizedDurationA;
const scoreB =
weightAlbumRatio * arB! - weightDuration * normalizedDurationB;
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ [eslint] <stylistic/no-mixed-operators> reported by reviewdog 🐶
Unexpected mix of '-' and '*'. Use parentheses to clarify the intended order of operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Enable lyrics on videos

4 participants