Skip to content
This repository has been archived by the owner on Feb 26, 2021. It is now read-only.

Commit

Permalink
Fix #458, default to spotify if no history is found
Browse files Browse the repository at this point in the history
  • Loading branch information
ianb committed Oct 22, 2019
1 parent 65c21a0 commit d3359e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension/background/serviceList.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ this.serviceList = (function() {
video: "youtube",
};

const DEFAULT_MUSIC_SERVICE = "spotify";

// Note these are maintained separately from the services in extension/services/*, because
// those are all loaded too late to be used here
exports.musicServiceNames = function() {
Expand Down Expand Up @@ -244,7 +246,7 @@ this.serviceList = (function() {
exports.detectServiceFromHistory = async function(services) {
const now = Date.now();
const oneMonth = now - 1000 * 60 * 60 * 24 * 30; // last 30 days
let best = null;
let best = DEFAULT_MUSIC_SERVICE;
let bestScore = 0;
for (const name in services) {
const service = services[name];
Expand Down

0 comments on commit d3359e9

Please sign in to comment.