Adds back scrobbling and loading a track and the queue from localStorage.

- Splits loadTrackPosition into two functions : one for the track (which isn't finished), one for the queue.
- Adds main-controller.js' first unit tests for both these functions.
- Adds scrobbling functionnality. It is now a part of the Subsonic service, since we it's Subsonic that ultimately does the scroblling.
- Adds unit tests for both the service and the directive. The test for updatetime was crazy hard to do because I had to find a way to trigger my own fake event and it wasn't permitted by jplayer.
- Adds the load function to the player, it is used only when loading a song from localStorage.
- Removes ng-click from play/pause in the player template. jPlayer adds its own handlers on them, no need to do it twice.
This commit is contained in:
Hyzual 2014-12-21 20:25:54 +01:00
parent 59762ae423
commit 834e67946c
10 changed files with 447 additions and 187 deletions

View file

@ -8,7 +8,6 @@ angular.module('jamstash.queue.controller', ['jamstash.player.service'])
$scope.itemType = 'pl'; // TODO: Hyz: What is this ?
$scope.playSong = function (song) {
console.log('Queue Controller - playSong()', song);
player.play(song);
};