Adds a ping() function to the subsonic service, taking advantage of our new subsonicRequest wrapper. It works with both JSON and JSONP, catches errors, etc.
Errors from an incorrect parameter (missing password) or unreachable server should now be displayed to the user.
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
I have now to fix the functions that called it from the scope (random autoplaylist and others)
This fixes the problem with AutoPlay not updating : since $q's promises are integrated with scope, we now see immediately the new songs being added.
They now use the new subsonicRequest() method which frees us from having to rebuild the complete URL with all the params. It handles JSONP/JSON and it also does most of the error-handling, so we can focus on displaying more specific messages in every request.
- Renamed playingIndex and playingSong in player-service.js to "private variables" starting with '_'. They only are public for testing purposes and are not meant to be manipulated directly.
- AutoPlay still has a problem with scope apply. Since it's asynchronous, the directive needs to know when it's finisehd to use scope apply... That means more subsonic refactoring.
- Adds unit tests for Repeat song and Loop Queue
- Adds back a special function in the player Service to manage the end of a song.
- 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.
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
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/services/subsonic-service_test.js (Browse further)