Commit graph

13 commits

Author SHA1 Message Date
Hyzual
8b3a12f052 Moves drag & drop support from main-controller.js to queue.js
Adds a indexOfSong method to player-service. It is used in play, nextTrack and previousTrack so the player can adapt to changes to the queue order. Previously it wasn't taken into account and when we changed the order of the queue (through drag & drop or shuffle), the next song wasn't what we expected it to be.
2015-01-17 19:15:10 +01:00
Hyzual
0646b02e94 When playing, adding or displaying a random playlist, it is correctly shown as selected 2015-01-17 19:15:08 +01:00
Hyzual
33f1a88d6b Adds the generic requestSongs function to subsonic.js.
It handles displaying, adding or playing songs, whatever their source. It also handles error notifications for subsonic, http or service errors.

- Changes all calls to getRandomSongs in the template so they provide the 'display' parameter and do not provide any param when they aren't needed.
- Adds genre and folder parameters to getRandomSongs
- getRandomStarredSongs now maps the songs (using model) before returning them
2015-01-17 19:15:08 +01:00
Hyzual
19661f463b Fixes the communication between the player directive and the player service
- Adds a "playEnded()" function specifically for jplayer to call when the currently playing song ends. It uses $rootScope.$apply() to notify the directive that the song has changed.
- Shows the player controls' css.
- Marks the tests relating the "playing" status of the song as pending.
- Further uses the Player service in the subsonic view
2015-01-17 19:13:41 +01:00
Hyzual
88b1e6a6e6 Rewrites the entire player component.
Not finished ! This is still work in progress and fairly broken in this commit.
The jquery jplayer is now wrapped in an angular directive.
The queue is no longer being managed in rootScope but is a part of the player service. It can be accessed like before and emptied / filled.
The player controller also uses the player service now.
2015-01-17 19:13:40 +01:00
Hyzual
e51961c167 Starts rewriting the player service.
The API is simplified: we can play a song, restart the currently playing song, load a song (that'll be used only by local storage), play the next track or the previous track.

As a result, I changed all the calls to playSong(false, song) which are now just play(song)
2015-01-17 19:13:40 +01:00
Hyzual
226a768987 Renamed all controlles from 'Ctrl' to 'Controller' to better follow angular best practices. 2015-01-17 19:13:40 +01:00
Hyzual
e5846e30f9 Removes the player functions from the rootScope.
However, saving track's position is broken.
Some are still there because of problems I don't know how to solve, e.g. circular dependency between notifications and player.
Uses the queue controller for the sidebar queue.
Moves loadTrackPosition to the main controller.
2015-01-17 19:12:56 +01:00
Hyzual
91f3674a31 Adds the sortable directive to the song list when displaying a playlist.
This allows to sort the playlist's songs as we want using drag & drop.
2014-11-15 13:48:28 +01:00
Hyzual
193ac3af1f Corrects various small errors.
E.g. undefined variables

Conflicts:
	app/common/player-service.js
	app/index.html
2014-11-09 16:23:44 +01:00
Hyzual
a9b4150272 Adds the complete subsonic ctrl function getRandomStarredSongs.
It has one parameter with 3 possible values :
- display: to display in the view,
- add: adds to the queue
- play: plays the first song and adds to the queue.

It is now called from the subsonic template.

All these are tested, errors from the server (both subsonic and http) are relayed to the user through notifications.

Conflicts:
	app/subsonic/subsonic.html
2014-11-09 16:21:14 +01:00
Hyzual
e18fbe2c5b Refactors the subsonic service test with jasmine promise matchers.
It makes them easier to read.

Conflicts:
	bower.json
2014-11-09 16:12:29 +01:00
Hyzual
a1d48bbd30 Reorganizes the entire app to follow Google's best practice recommendations for Angular App Structure.
see: https://docs.google.com/document/d/1XXMvReO8-Awi1EZXAXS4PzDzdNvV6pGcuaF4Q9821Es/pub

The files are now grouped by view / component.
Tests are located beside tested js files. The Grunt build will be responsible for only distributing actual files without the tests.
Each partial is at the same level as the js files related to it.
Ideally css files should be at the same level, maybe I'll refactor this later.

Moves all non-bower plugins to app/vendor.
Moves all images to app/images and styles to app/styles.
Merges the test and non-test jshintrc files.

Adds all the Jamstash contributors to the package.json file while I was refactoring.

Conflicts:
	app/app.js
	app/images/vgrabber.gif
	app/images/vgrabber2-active.gif
	app/images/vgrabber2-normal.gif
	app/index.html
2014-11-09 16:10:34 +01:00
Renamed from test/controllers/subsonic_test.js (Browse further)