Skip to content
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

fix(bookmarklet): display playable results hits first #282

Merged
merged 1 commit into from
Mar 12, 2020

Conversation

adrienjoly
Copy link
Member

No description provided.

@adrienjoly adrienjoly self-assigned this Mar 12, 2020
@adrienjoly adrienjoly added the bug label Mar 12, 2020
@adrienjoly adrienjoly merged commit 4518d11 into master Mar 12, 2020
@adrienjoly adrienjoly deleted the fix/bk-playable-first branch March 12, 2020 15:54
adrienjoly pushed a commit that referenced this pull request Mar 12, 2020
## [1.26.2](v1.26.1...v1.26.2) (2020-03-12)

### Bug Fixes

* display playable bookmarklet hits first ([#282](#282)) ([4518d11](4518d11))
adrienjoly added a commit that referenced this pull request Mar 13, 2020
Contributes to #262. Follow up of #281 and #282.

## What does this PR do / solve?

After YouTube reduced our API quota, we resorted to specifying "(YouTube track)" as the title of tracked extracted from YouTube pages using the bookmarklet, in order to save some quota.

This PR intends to determine the actual name of the track by extracting text from the DOM, and therefore to get rid of those "(YouTube track)" titles on newly added tracks.

## Overview of changes

- completely get rid of forced "(YouTube track)" titles 🥳
- add feat: "return a track with metadata from a YouTube page that lists that track as a link"
- add feat: "return a track with the expected name when that track was found as a link from a YouTube page" (i.e. remove noise from title)
- add feat: "return the page's track with metadata from a YouTube page when the same track is also listed in the page with less metadata"
- rename `detectPlayemStreams()` --> `detectPlayableStreams()` + integrate `YOUTUBE_PLAYER` (partially imported from PlayemJS, without the API query part) in the bookmarket, and use it also from tests => first step in progressively getting rid of Playem for track detection
- normalize the way text is extracted from DOM
- cleaning up logs from bookmarklet
- simplify logic and make code a little bit more readable overall

## How to test this PR?

```sh
$ nvm use
$ node_modules/.bin/mocha test/unit/bookmarklet-tests.js
$ docker-compose up --build -d
$ npm run docker:seed && node_modules/.bin/wdio wdio.conf.js
``` 

Also, you can test the bookmarklet manually, from your web browser, by following the instructions provided in the unit test file.
adrienjoly pushed a commit that referenced this pull request Mar 13, 2020
# [1.27.0](v1.26.4...v1.27.0) (2020-03-13)

### Features

* **bookmarklet:** extract youtube track names from page ([#285](#285)) ([9493f06](9493f06)), closes [#262](#262) [#281](#281) [#282](#282)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant