diff --git a/CHANGELOG.md b/CHANGELOG.md index 53bca18..0bac1ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## v0.4.2 + +- [x] If tags list was empty, force reload on update to v0.4.x +- [x] Show loading indicator when searching tracks +- [x] Translate "Successful login on Shazam" message + +## v0.4.1 + +- [x] Add Content Scripts to bundle + ## v0.4.0 - [x] Store tags in IndexedDB instead of Local Storage diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 987a828..5c924e0 100755 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -4,6 +4,11 @@ "description":"The description of the application, displayed in the web store." }, + "shazamLoginSuccessOpenAgain": { + "message": "Shazam login is successful. Please open Shazify again.", + "description": "" + }, + "introWelcome": { "message": "Welcome", "description": "" diff --git a/_locales/fr/messages.json b/_locales/fr/messages.json index 5d4f1bf..78f6832 100644 --- a/_locales/fr/messages.json +++ b/_locales/fr/messages.json @@ -4,6 +4,11 @@ "description":"The description of the application, displayed in the web store." }, + "shazamLoginSuccessOpenAgain": { + "message": "La connexion à Shazam a bien fonctionné. Veuillez ouvrir à nouveau Shazify.", + "description": "" + }, + "introWelcome": { "message": "Bienvenue", "description": "" diff --git a/manifest.json b/manifest.json index f2c4380..0ee5242 100755 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAopSL/q/2d97dHxCQ1w26B4EONSEo4CZZYFqu3MlJKA5ifSXkyoNSlkG6afDuNoXmiTWFCAawRgGwuO3yi0QvfeMJpz+M9nXnt8PQsVP10Mb7o3SHIihxIXRMFAJvggvHW4NCuDznJixpo2ixEeCL8LGkS0ZL93MgYtEOuaGPdcBTiAUya3Nr3mdkn+nTHldQvthassiDYZystDTuKwkf0vTZkDCyWC8bfI7xZTxQ6IFcS2WQgUm0ix5hgv+qyOQzOwh26R6BQmZTFj7YiSqhgZsZRebhMcn+hxd8kSegS1ZAcKv/oS63Ej5/IAB5NijrPXR3zivQZ6oIJjr+xMOU9wIDAQAB", "name": "Shazify", - "version": "0.4.1", + "version": "0.4.2", "manifest_version": 2, "description": "__MSG_appDesc__", "homepage_url": "http://www.leeroy.me", diff --git a/package.json b/package.json index 73c24dc..354c5a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "chrome-shazify", - "version": "0.4.1", + "version": "0.4.2", "author": "Leeroy Brun ", "private": true, "description": "Easily sync your Shazam tracks with a Spotify playlist", diff --git a/src/background/UpdateService.js b/src/background/UpdateService.js index 26a83cd..20f2d33 100644 --- a/src/background/UpdateService.js +++ b/src/background/UpdateService.js @@ -30,6 +30,8 @@ var initVersion = parseInt(initVersionTxt); var finalVersion = parseInt(finalVersionTxt); + Logger.info('[Updater] Init version : '+ initVersion +' | Final version : '+ finalVersion); + var startIndex = null; var endIndex = null; @@ -149,7 +151,7 @@ var oldTagsStorage = new StorageHelper('Tags', 'local'); oldTagsStorage.get(['tagsList', 'lastUpdate'], function(items) { - if(items.tagsList) { + if(items.tagsList && items.tagsList.length) { async.eachLimit(items.tagsList, 5, function(oldTag, cbe) { Logger.info('[Update] Moving tag '+ oldTag.shazamId +' to DB...'); @@ -179,10 +181,28 @@ return onceDone(items.lastUpdate); }); } else { - return onceDone(items.lastUpdate); + // If tags list was emtpy, we set last update to 0 to force reloading + return onceDone(0); + } + }); + }}, + // v0.04.02 + {'version': 402, 'perform': function(callback) { + Logger.info('[Update] Checking if we have any tag in DB, or force update...'); + + Tags.count(function(err, count) { + if(count === 0) { + Logger.info('[Update] No tags found, force update...'); + + Tags.data.clearCache(); + Tags.data.set({ 'lastUpdate': 0 }, function() { + Tags.load(); + + return callback(); + }); } }); - }} + }} ] }; diff --git a/src/contentscripts/shazam.css b/src/contentscripts/shazam.css index c79cafd..6e9c8bc 100644 --- a/src/contentscripts/shazam.css +++ b/src/contentscripts/shazam.css @@ -27,7 +27,7 @@ /* The Close Button */ .shazify-modal-close { - color: #000000; + color: #ffffff; position: absolute; right:15px; top:15px; diff --git a/src/contentscripts/shazamLocalStorage.js b/src/contentscripts/shazamLocalStorage.js index 73473fb..87b5701 100644 --- a/src/contentscripts/shazamLocalStorage.js +++ b/src/contentscripts/shazamLocalStorage.js @@ -75,7 +75,7 @@ function getAndSendLocalStorage() { } else { console.log('inid seems fine! Congrats! You are now logged in on Shazam.'); - openModalOnlyOnce('Shazify: Login is successful! Please open Shazify again.'); + openModalOnlyOnce('Shazify: '+ chrome.i18n.getMessage('shazamLoginSuccessOpenAgain')); } }); diff --git a/src/popup/js/controllers/TagsCtrl.js b/src/popup/js/controllers/TagsCtrl.js index 5d73330..505a8a0 100644 --- a/src/popup/js/controllers/TagsCtrl.js +++ b/src/popup/js/controllers/TagsCtrl.js @@ -169,6 +169,8 @@ angular.module('Shazify').controller('TagsCtrl', function($scope, $location, $in }, send: function() { + $scope.loading = true; + SpotifyService.genQuery($scope.newSearch.query.track, $scope.newSearch.query.artist, function(query) { SpotifyService.searchTracks(query, function(err, tracks) { if(err) { @@ -186,6 +188,8 @@ angular.module('Shazify').controller('TagsCtrl', function($scope, $location, $in } } } + + $scope.loading = false; }); }); }, diff --git a/src/popup/js/services/SpotifyService.js b/src/popup/js/services/SpotifyService.js index f762e74..9d6498e 100644 --- a/src/popup/js/services/SpotifyService.js +++ b/src/popup/js/services/SpotifyService.js @@ -3,7 +3,6 @@ angular.module('Shazify').factory('SpotifyService', function($timeout, $interval searchTracks: function(query, callback) { BackgroundService.Spotify.findTracks(query, function(err, tracks) { $timeout(function() { - console.log(err, tracks); callback(err, tracks); }, 0); });