This repository was archived by the owner on Apr 12, 2020. It is now read-only.
Optimized the normalize search function...#11
Open
fan1200 wants to merge 1 commit into
Open
Conversation
…and many tags used in the titles like official music video, hd, radio edit, etc.
| }); | ||
|
|
||
| normalized = normalized.replace(/((ft. |& |feat. |and |& |vs | [xX] )(.*?)(?=-))/, ''); // remove featuring artist at the beginning | ||
| normalized = normalized.replace(/((ft. |& |feat. |and |& |vs | [xX] )(.*))/,'') // remove featuring artist and everything after at the end |
Owner
There was a problem hiding this comment.
I'm worried that this is too aggressive. For example, The Midnight - Lost & Found (The Midnight Remix) gets cleaned to just be the midnight - lost. Another example: G-Eazy x Bebe Rexha - Me, Myself & I becomes just g-eazy- me, myself
Perhaps try scoping this regex down a bit?
There was a problem hiding this comment.
Could this feature be set up to activate only in situations where no search results are returned?
Author
|
I now have 3 weeks off, maybe I can find the time to edit the code. Would be nice to see this feature in the live version since the live version doesn't show as much as mine. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
to remove featuring artists and many tags used in the titles like official music video, hd, radio edit, etc.
I finally had some spare time to optimize the normalization of the video titles. I did this with some regex expression which will remove unnecessary tags from the title. It does the following:
which will remove the last group in this case.
With these fixes I was able to cover most of the tracks of my Youtube playlists (almost everything) this was not possible with the live version. It has been tested with various Youtube playlists and some Reddit lists.