
- 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.
29 lines
721 B
JavaScript
29 lines
721 B
JavaScript
angular.module('jamstash.queue.controller', ['jamstash.player.service'])
|
|
|
|
.controller('QueueController', ['$scope', 'globals', 'player',
|
|
function ($scope, globals, player) {
|
|
'use strict';
|
|
$scope.settings = globals.settings;
|
|
$scope.player = player;
|
|
$scope.itemType = 'pl'; // TODO: Hyz: What is this ?
|
|
|
|
$scope.playSong = function (song) {
|
|
player.play(song);
|
|
};
|
|
|
|
$scope.queueEmpty = function() {
|
|
player.emptyQueue();
|
|
};
|
|
|
|
$scope.queueShuffle = function() {
|
|
player.shuffleQueue();
|
|
};
|
|
|
|
$scope.addSongToQueue = function(song) {
|
|
player.addSong(song);
|
|
};
|
|
|
|
$scope.removeSongFromQueue = function(song) {
|
|
player.removeSong(song);
|
|
};
|
|
}]);
|