mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-12-10 17:07:30 +00:00
Added checks to the youtube rank results method, see https://github.com/KRTirtho/spotube/discussions/1186
This commit is contained in:
parent
5d0b5e69a5
commit
56219c43d2
@ -178,13 +178,23 @@ class YoutubeSourcedTrack extends SourcedTrack {
|
||||
}
|
||||
}
|
||||
|
||||
final titleSameAsTrackName =
|
||||
sibling.title.toLowerCase() == track.name?.toLowerCase();
|
||||
|
||||
final titleContainsTrackName =
|
||||
sibling.title.toLowerCase().contains(track.name!.toLowerCase());
|
||||
|
||||
final trackNameContainsTitle =
|
||||
track.name!.toLowerCase().contains(sibling.title.toLowerCase());
|
||||
|
||||
final hasOfficialFlag =
|
||||
officialMusicRegex.hasMatch(sibling.title.toLowerCase());
|
||||
|
||||
if (titleContainsTrackName) {
|
||||
if (titleSameAsTrackName) {
|
||||
score += 1;
|
||||
}
|
||||
|
||||
if (titleContainsTrackName || trackNameContainsTitle) {
|
||||
score += 3;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user