It saves us a few requests and helps making Jamstash faster.
It's unlikely that the artists list or the music folders will change during a Jamstash session. It's also an easy cache to reset: the user only has to reload the page.
- subsonic-service no longer computes the offset, it gets it as an int param and uses it.
- subsonic-controller is now in charge of computing the offset given a 'prev', 'next' or undefined param. It no longer allows the offset to go in the negatives, which made no sense.
- subsonic-controller's scope's AutoAlbums array is now a map indexed by the type of auto-album. It also contains each item's offset so we no longer share the offset between auto-albums, which avoids weird behaviours.
- Plus some minor code style fixes.
Those are stricter now, especially the JSCS. I believe it will make our code easier to read in the end.
It'll take some time to comply to it, so we'll do it gradually as we modify things.
getSongs() does the same thing, at the only exception of Breadcrumbs management. Breadcrumbs will be refactored in a following commit.
Also removed getSongTemplate() which appears unused.
Please do a bower install and npm install to update.
* Adds a repeat directive to manage a 3-state repeat button
* Adds grunt tasks related to CSS and SVG, updates all npm packages
* fixtsquillario/Jamstash#212
* Refactors the way music folders are handled
* Fix Search
* Fix a bug that prevented you from changing your server
* Update Angular to 1.3.15
* Move starring songs to subsonic-service
* Removes the comments from the editorconfig file.
* Refactors subsonic's getSongs(), adds a recursiveGetSongs()
* Adds a way to play only one song from a list of songs
* When shuffling the playing queue, the currently playing song will always stay at the first position.
* Removes jquery.base64.js (unused), replaced jquery.dateFormat-1.0.js with its bower version
It will cycle through "repeat the playing queue", "repeat the playing song" and "don't repeat anything".
- Adds a custom "loop-single" icon based on iconic's loop icon.
- Removes the LoopQueue setting which is now the "queue" value of Repeat
- Moves the Repeat setting to player-service.js. That way, it does not depend on saving the settings in any way. It also allows us to remove a dependency from player-service.js.
- Adds a player css which will hold all the player-related styles
- Removes the former png icons (we can always find them back thanks to Git)
Please do a npm install to update your copy of the packages.
- Adds a grunt task to build up a sprite out of our own svg icons
- Adds a grunt task to copy iconic's svg icons from bower
- Adds a build step to concatenate CSS files. It leaves us free to split the CSS and thus have the minimum css in each directory.
- Adds open-iconic as a bower dependency. We were using their icons, now we can use their svg sprite directly.
- Adds ng-html2JsPreprocessor. A karma preprocessor that helps us test template-url dependent directives.
- Removes jshint from the gruntfile. jshint should be used directly in your editor, e.g. SublimeLinter (https://github.com/SublimeLinter/SublimeLinter-jshint) for SublimeText
- Removes the plugins declaration from karma.conf.js which is now apparently unnecessary.
- Second part of the fix for tsquillario/Jamstash#212 - Fixes getIndexes
- Moved loading / saving / deleting the selected music folder to persistence-service.
- Moved the request to get all the music folders to subsonic-service.
- Moved SelectedMusicFolder to subsonic-controller's scope from the rootScope
- Fixes a bug where we would send a '-1' music folder id to Subsonic, causing an SQL error when choosing "All Folders" and refreshing the Artists list.
If the new server had an older ApiVersion (e.g. 1.8.0 compared to 1.12.0), when saving the settings, the server would respond an error due to the api version and when dealing with that error, we didn't update the ApiVersion when we should have.
Please do a bower install and npm install to update.
Also updated both bower.json and package.json's licences to the correct one.
Also update karma-jasmine.
So that the separation between subsonic-service and subsonic-controller is clear: the service makes requests and deals with $http, the controller displays, add to the player queue, etc.
I've also added a recursive version of getSongs() which enables us to play all the songs in a directory recursively, e.g. all the songs of an artist regardless of their album.
- Adds unit-tests to the controller and service for getSongs() and recursiveGetSongs()
Use double-click to play a song and all the following songs, click on the play icon to play only this one song. Because it was annoying to double-click and then have to remove all other songs.
So that we don't end up at the end of the queue after we shuffle it.
- The queue controller will also scroll the queue up to the first element so the user notices the playing song stayed first
- Adds a unit test in archive-service to test that we do use utils.formatDate
- Minor changes in subsonic-service.js to use a variable name rather than "this", which can change
- We no longer use toString() if the album's artist info is missing.
- Moved date formatting to utils-service.js and added TODOs to use angular filters instead
- Cleaned up utils-service.js and remove unused functions
- We no longer exclude vendor js files in karma, so we can test our call to jquery.dateFormat
- Adds a way to upgrade users' local storage settings between versions
- persistence-service now also manages user settings and JamstashVersion
- Fixes bugs in almost all the requests when using Madsonic
When there is only one child, Madsonic does not return an array when Subsonic does.
I've added a check to always have the subsonic-response.directory.child as an array.
Adds 2 unit-tests: one for Subsonic's behaviour and one for Madsonic's
- When Volume has never been stored in local storage, it causes "non-finite value" errors in jPlayer. persistence-service will now return 1.0 if it's not set.
- Adds tests to checkVersion & checkVersionNewer: if the second version (older or required version) is undefined, it always returns true. This enables us to upgrade the settings even if there never was a Jamstash version stored in local storage.
- Adds unit tests that cover all cases.
- Adds call to parseVersionString() so we can pass it version string e.g. '1.0.1'
- persistence-service.js now also manages JamstashVersion. It is set in localStorage from app.js's constant, and not from the changelog so we don't have to add a version to the changelog to actually do stuff.
- persistence-service.js's upgradeToVersion() now only applies newer changesets. This ensures we won't erase users' settings with changesets at every new version, e.g. resetting songSearchType to song every time.
- upgradeToVersion() will also notify the user of the upgrade, which was formerly done in settings.js
- Adds an angular "value" that will contain an array of objects with version and change to be applied to the settings.
- Adds the possibility to run multiple changesets (e.g. upgrade from v1.0.0 to v1.0.2).
- Adds todos in the utils service for things related to version comparisons.
- settings.js now has its own module : 'jamstash.settings.controller'. This makes it easier to test it and identify what dependencies it has.
- Renames 'jamstash.settings' module into 'jamstash.settings.service'
- Adds an angular constant to hold the current Jamstash version in app.js.
- Adds a way to upgrade incrementally what was in localStorage : in 4.4.5, DefaultSearchType will no longer be an object but an int, so we must init it with an int value, otherwise a blank option will be displayed. We detect what version we are using and what version was stored using persistence-service.js and run the upgrade accordingly.
- Refactors almost completely persistence-service_test.js
- Unit-tests some of settings.js's methods.
We used to save the current queue, song and volume with a "jamstash" prefix.
We no longer used the previous non-prefixed values, which became unused.
While not overly annoying for volume or playlist, if we plan to use locker to manage our settings it could become much more problematic.
So we can move closer to consistent error-reporting and protocol usage.
- refactors subonic-controller's search().
- Adds a mapAlbumss() method to model-service.js. Just as mapSongs(), it maps an array of albums and returns it.
- Refactors the SearchTypes so their id is an int (0,1,2), just like we already expected it in subsonic-service. This means it might invalidate the existing setting saved in localStorage, so people would have an empty option selected by default until they save their settings.
- Adds unit-tests.
So we can move closer to consistent error-reporting and protocol usage.
- refactors subonic-controller's getPodcast().
- Also sets all the selected things (playlist, album, etc.) to null.
- Adds a mapPodcasts() method to model-service.js. Just as mapSongs(), it maps an array of podcast episodes and returns it.
- Adds unit-tests.