Commit graph

15 commits

Author SHA1 Message Date
Hyzual
6e19277371 Refactor subsonic-service.js to improve readability
To comply with https://github.com/johnpapa/angular-styleguide#style-y052
+ Minor changes
2015-07-07 22:10:35 +02:00
Hyzual
bcda18e913 Updated bower deps to their latest versions
Please run bower update in your repository
Updated Angular, jQuery, jQuery-UI, jasmine-fixtures, jPlayer and angular-locker
2015-07-07 22:10:35 +02:00
Hyzual
66478bf67e Changed the localStorage key used to store the genre playlists names
I am aware that this means "wiping" users' choices of genre playlists, but consider the following :
- Previously, all they could choose from was a static list, whereas now one can choose from every genre available on the Subsonic server.
- We can't know what genres are available on the server when we're getting the saved value from localStorage. So a mapping might be possible but way too costly for a list of names that will only take a few clicks to recreate anyway.
2015-07-07 22:10:22 +02:00
Hyzual
48da0ee7f0 Enable removing genre auto-playlists from the list
- Added an svg "X" icon to enable removing auto-playlists
- Notice that the background-color and color change are done too, and since it's SVG, it takes only one image and some CSS to do both.
- Added a subsonic.css file. It is intended (long term) to have all subsonic view-related CSS styles.
- persistence-service now manages the selected genre auto-playlists names instead of utils.getValue().
- Rewrote persistence-service.js to comply with https://github.com/johnpapa/angular-styleguide#style-y052
- Rewrote many test descriptions in persistence-service_test.js to follow these recommendations : http://gojko.net/2015/02/25/how-to-get-the-most-out-of-given-when-then/
2015-07-07 22:10:21 +02:00
Hyzual
5d35c2bd1a Replaced Underscore with Lodash
Lodash has more useful functions and is more regularly updated.
2015-07-07 22:06:59 +02:00
Hyzual
e43c4c7655 Refactors the way music folders are handled
- 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.
2015-05-21 23:54:43 +02:00
Hyzual
a6854e33f6 Fixes the "non-finite value" error when volume has never been set
- 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.
2015-03-26 21:26:53 +01:00
Hyzual
fb65ae48bf Removes the angular constant jamstashVersion, goes back to using the json changelog as latest version
- 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.
2015-03-24 18:36:55 +01:00
Hyzual
fe6c10bc4a Rewrites checkVersion and checkVersionNewer in utils-service.js, refines upgradeToVersion
- 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
2015-03-24 18:36:55 +01:00
Hyzual
ae703c1542 Refines the changesets mechanism.
- 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.
2015-03-24 18:36:54 +01:00
Hyzual
a97e5159bc Uses angular-locker to store settings in localStorage
- 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.
2015-03-24 18:36:54 +01:00
Hyzual
3905c5f3d6 Updates angular-locker to v1.2.x and removes the "jamstash" namespace from the locker-managed objects
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.
2015-03-24 18:36:53 +01:00
Hyzual
a85865371c Adds back setting the volume up / down using the keyboard
- Adds a volume field to the player service. It is set directly, no need for get/set...
- Adds a watcher in player-directive to set jPlayer's volume accordingly
- Adds turnVolumeUp and turnVolumeDown methods to the main scope. For the moment they are fine there, we'll maybe move them to the player service if they are called by anything else.
- Adds get/save/delete for the volume in the persistence service.
2015-02-08 22:46:47 +01:00
Hyzual
2e004a5f59 Adds deleting the queue and song from localStorage.
Adds a watch on the saveTrackPosition setting to start dynamically saving the position.
2015-01-17 19:15:07 +01:00
Hyzual
42830bbdbf Extracts everything related to localStorage in common/persistence-service.js
That way, whenever we want to use something else (like a JSON file, or a DB) we will only have to change persistence-service.js
- Migrated the unit tests there too.
- Added replay in case of jPlayer error.
2015-01-17 19:15:07 +01:00