Skip to content
This repository has been archived by the owner on May 16, 2022. It is now read-only.

Commit

Permalink
good job :thumbs_up:
Browse files Browse the repository at this point in the history
  • Loading branch information
davipatury committed Aug 27, 2020
1 parent 93ff9ef commit ef20af1
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/apis/TuneIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const API_URL = 'https://opml.radiotime.com'

class TuneInAPI {
static get (id) {
return this.request('/Tune.ashx', { id }).then(({ body: [ result ]}) => result)
return this.request('/Tune.ashx', { id }).then(({ body: [result] }) => result)
}

// Internal
Expand Down
2 changes: 1 addition & 1 deletion src/apis/Youtube.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class YoutubeAPI {

static getBestThumbnail (thumbnails) {
if (!thumbnails) return {}
return [ 'maxres', 'high', 'medium', 'standard', 'default' ].find(q => thumbnails[q])
return ['maxres', 'high', 'medium', 'standard', 'default'].find(q => thumbnails[q])
}

// Internal
Expand Down
6 changes: 3 additions & 3 deletions src/apis/YoutubeMusic.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class YoutubeMusicAPI {

// Internal
static async request (endpoint, body) {
const [ key, name, version ] = await this.getKeys()
const [key, name, version] = await this.getKeys()
const qParams = new URLSearchParams({ key, alt: 'json' })
return fetch(API_URL + endpoint + `?${qParams.toString()}`, {
method: 'POST',
Expand Down Expand Up @@ -102,8 +102,8 @@ class YoutubeMusicAPI {
const [, key] = /INNERTUBE_API_KEY":"([0-9a-zA-Z_-]+?)"/ig.exec(body)
const [, clientName] = /INNERTUBE_CONTEXT_CLIENT_NAME":([0-9]+?),/ig.exec(body)
const [, clientVersion] = /INNERTUBE_CONTEXT_CLIENT_VERSION":"([0-9\\.]+?)"/ig.exec(body) || /INNERTUBE_CONTEXT_CLIENT_VERSION":"([0-9.]+?)"/ig.exec(body)
this.keys = [ key, clientName, clientVersion ]

this.keys = [key, clientName, clientVersion]
return this.keys
}

Expand Down
2 changes: 1 addition & 1 deletion src/structures/providers/SongProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SongProvider {
}
return new Playlist(tracks.map(({ track, info }) => new Song(track, info)), playlistInfo, this)
} else if (tracks.length) {
const [ { track, info } ] = tracks
const [{ track, info }] = tracks
return new Song(track, info)
}
})
Expand Down
12 changes: 6 additions & 6 deletions src/structures/providers/spotify/SpotifyProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const PLAYLIST_REGEX = [
class SpotifyProvider {
static get (provider, identifier) {
return Promise.all([
this.getTrack,
this.getAlbum,
this.getPlaylist
]
.map(f => f(provider, identifier)))
.then(r => r.find(v => v)) // Find a valid match
this.getTrack,
this.getAlbum,
this.getPlaylist
]
.map(f => f(provider, identifier)))
.then(r => r.find(v => v)) // Find a valid match
}

static async getTrack (provider, identifier) {
Expand Down

0 comments on commit ef20af1

Please sign in to comment.