Skip to content

Commit

Permalink
Merge pull request #149 from jaedb/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
jaedb authored Sep 28, 2016
2 parents ffbed1a + 579a1b1 commit 0f793b9
Show file tree
Hide file tree
Showing 27 changed files with 80 additions and 84 deletions.
2 changes: 1 addition & 1 deletion mopidy_spotmop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from frontend import SpotmopFrontend

logger = logging.getLogger(__name__)
__version__ = '2.10.0'
__version__ = '2.10.1'

##
# Core extension class
Expand Down
33 changes: 16 additions & 17 deletions mopidy_spotmop/static/app-annotated.js
Original file line number Diff line number Diff line change
Expand Up @@ -29867,7 +29867,7 @@ angular.module('spotmop', [
$scope.playlists = function(){
return PlaylistManagerService.myPlaylists();
}
$scope.spotifyUser = {};
$scope.settings = SettingsService;
$scope.menuCollapsable = false;
$scope.reloadApp = function(){
window.location.reload();
Expand Down Expand Up @@ -30113,7 +30113,7 @@ angular.module('spotmop', [

$scope.$on('spotmop:spotify:authenticationChanged', function( event, newMethod ){
if( newMethod == 'client' ){
Analytics.trackEvent('Spotify', 'Authorized', $scope.spotifyUser.id);
Analytics.trackEvent('Spotify', 'Authorized', SettingsService.getSetting('spotify.user.id'));
}
});

Expand Down Expand Up @@ -30611,7 +30611,7 @@ angular.module('spotmop.browse.artist', [])
// figure out if we're following this playlist
if( $scope.spotify.isAuthorized() ){

var spotifyuserid = SettingsService.getSetting('spotifyuser.id');
var spotifyuserid = SettingsService.getSetting('spotify.user.id');
if( !spotifyuserid ) return false;

SpotifyService.isFollowingArtist( $stateParams.uri, spotifyuserid )
Expand Down Expand Up @@ -31200,7 +31200,7 @@ angular.module('spotmop.browse.playlist', [])
if( $scope.origin == 'm3u' ) return true;
if( $scope.origin == 'spotify' ){
if( typeof( $scope.playlist ) !== 'undefined' && typeof( $scope.playlist.owner ) !== 'undefined' ){
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotifyuser.id') );
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotify.user.id') );
}
}
return false;
Expand All @@ -31219,23 +31219,20 @@ angular.module('spotmop.browse.playlist', [])
.then( function(response){
$scope.following = true;
NotifyService.notify( 'Following playlist' );
$scope.updatePlaylists();
});
}
$scope.unfollowPlaylist = function(){
SpotifyService.unfollowPlaylist( uri )
.then( function(response){
$scope.following = false;
NotifyService.notify( 'Playlist removed' );
$scope.updatePlaylists();
});
}
$scope.recoverPlaylist = function(){
SpotifyService.followPlaylist( uri )
.then( function(response){
$scope.following = true;
NotifyService.notify( 'Playlist recovered' );
$scope.updatePlaylists();
});
}
$scope.editPlaylist = function(){
Expand Down Expand Up @@ -31293,7 +31290,7 @@ angular.module('spotmop.browse.playlist', [])

// figure out if we're following this playlist
if( $scope.spotify.isAuthorized() ){
SpotifyService.isFollowingPlaylist( $stateParams.uri, SettingsService.getSetting('spotifyuser',{id: null}).id )
SpotifyService.isFollowingPlaylist( $stateParams.uri, SettingsService.getSetting('spotify.user.id') )
.then( function( isFollowing ){
$scope.following = $.parseJSON(isFollowing);
});
Expand Down Expand Up @@ -31385,7 +31382,7 @@ angular.module('spotmop.browse.playlist', [])

var playlisturi = $state.params.uri;
var playlistOwnerID = SpotifyService.getFromUri('userid', playlisturi);
var currentUserID = SettingsService.getSetting('spotifyuser.id');
var currentUserID = SettingsService.getSetting('spotify.user.id');

if( $scope.origin == 'spotify' ){
if( playlistOwnerID != currentUserID ){
Expand Down Expand Up @@ -33882,7 +33879,7 @@ angular.module('spotmop.library', [])
$scope.tracklist = {tracks: [], type: 'track'};

// if we've got a userid already in storage, use that
var userid = SettingsService.getSetting('spotifyuserid',$scope.$parent.spotifyUser.id);
var userid = SettingsService.getSetting('spotify.user.id');

SpotifyService.getMyTracks( userid )
.then( function( response ){ // successful
Expand Down Expand Up @@ -34015,7 +34012,7 @@ angular.module('spotmop.library', [])
$scope.artists = [];

// if we've got a userid already in storage, use that
var userid = SettingsService.getSetting('spotifyuserid',$scope.$parent.spotifyUser.id);
var userid = SettingsService.getSetting('spotify.user.id');

SpotifyService.getMyArtists( userid )
.then( function( response ){
Expand Down Expand Up @@ -34103,7 +34100,7 @@ angular.module('spotmop.library', [])
$scope.albums = { items: [] };

// if we've got a userid already in storage, use that
var userid = SettingsService.getSetting('spotifyuser.id');
var userid = SettingsService.getSetting('spotif.user.id');

// if we have full spotify authorization
if( $scope.spotify.isAuthorized() ){
Expand Down Expand Up @@ -35833,7 +35830,7 @@ angular.module('spotmop.services.dialog', [])
// spotify playlist
if( $scope.scheme == 'spotify' ){
SpotifyService.createPlaylist(
$scope.$parent.spotifyUser.id,
SettingsService.getSetting('spotify.user.id'),
{ name: $scope.playlistName, public: $scope.playlistPublic }
)
.then( function(response){
Expand Down Expand Up @@ -36476,7 +36473,7 @@ angular.module('spotmop.services.mopidy', [
if( !name ) name = 'User';

var icon = '';
var spotifyuser = SettingsService.getSetting('spotifyuser');
var spotifyuser = SettingsService.getSetting('spotify.user');
if( spotifyuser ) icon = spotifyuser.images[0].url;

PusherService.broadcast({
Expand Down Expand Up @@ -36777,7 +36774,7 @@ angular.module('spotmop.services.playlistManager', [])
digestSpotifyPlaylists( response );
});
}else{
var userid = SettingsService.getSetting('spotifyuser.id');
var userid = SettingsService.getSetting('spotify.user.id');
SpotifyService.getPlaylists( userid, 50 )
.then( function(response){
digestSpotifyPlaylists( response );
Expand Down Expand Up @@ -36831,7 +36828,7 @@ angular.module('spotmop.services.playlistManager', [])
var playlist = playlists[i];
var origin = $filter('assetOrigin')(playlist.uri);
if( origin == 'spotify' ){
var user = SettingsService.getSetting('spotifyuser.id');
var user = SettingsService.getSetting('spotify.user.id');
if( SpotifyService.isAuthorized() && playlist.uri.startsWith('spotify:user:'+user) ){
myPlaylists.push( playlist );
}
Expand Down Expand Up @@ -36955,7 +36952,7 @@ angular.module('spotmop.services.playlistManager', [])
case 'spotify':

var playlistOwnerID = SpotifyService.getFromUri('userid', uri);
var currentUserID = SettingsService.getSetting('spotifyuser.id');
var currentUserID = SettingsService.getSetting('spotify.user.id');

if( playlistOwnerID != currentUserID ){
NotifyService.error('Cannot modify to a playlist you don\'t own');
Expand Down Expand Up @@ -39084,6 +39081,8 @@ angular.module('spotmop.services.settings', [])
case 3:
if( typeof($localStorage[settingElements[0]]) === 'undefined' )
return null;
if( typeof($localStorage[settingElements[0]][settingElements[1]]) === 'undefined' )
return null;
if( typeof($localStorage[settingElements[0]][settingElements[1]][settingElements[2]]) === 'undefined' )
return null;
return $localStorage[settingElements[0]][settingElements[1]][settingElements[2]];
Expand Down
33 changes: 16 additions & 17 deletions mopidy_spotmop/static/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29867,7 +29867,7 @@ angular.module('spotmop', [
$scope.playlists = function(){
return PlaylistManagerService.myPlaylists();
}
$scope.spotifyUser = {};
$scope.settings = SettingsService;
$scope.menuCollapsable = false;
$scope.reloadApp = function(){
window.location.reload();
Expand Down Expand Up @@ -30113,7 +30113,7 @@ angular.module('spotmop', [

$scope.$on('spotmop:spotify:authenticationChanged', function( event, newMethod ){
if( newMethod == 'client' ){
Analytics.trackEvent('Spotify', 'Authorized', $scope.spotifyUser.id);
Analytics.trackEvent('Spotify', 'Authorized', SettingsService.getSetting('spotify.user.id'));
}
});

Expand Down Expand Up @@ -30611,7 +30611,7 @@ angular.module('spotmop.browse.artist', [])
// figure out if we're following this playlist
if( $scope.spotify.isAuthorized() ){

var spotifyuserid = SettingsService.getSetting('spotifyuser.id');
var spotifyuserid = SettingsService.getSetting('spotify.user.id');
if( !spotifyuserid ) return false;

SpotifyService.isFollowingArtist( $stateParams.uri, spotifyuserid )
Expand Down Expand Up @@ -31200,7 +31200,7 @@ angular.module('spotmop.browse.playlist', [])
if( $scope.origin == 'm3u' ) return true;
if( $scope.origin == 'spotify' ){
if( typeof( $scope.playlist ) !== 'undefined' && typeof( $scope.playlist.owner ) !== 'undefined' ){
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotifyuser.id') );
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotify.user.id') );
}
}
return false;
Expand All @@ -31219,23 +31219,20 @@ angular.module('spotmop.browse.playlist', [])
.then( function(response){
$scope.following = true;
NotifyService.notify( 'Following playlist' );
$scope.updatePlaylists();
});
}
$scope.unfollowPlaylist = function(){
SpotifyService.unfollowPlaylist( uri )
.then( function(response){
$scope.following = false;
NotifyService.notify( 'Playlist removed' );
$scope.updatePlaylists();
});
}
$scope.recoverPlaylist = function(){
SpotifyService.followPlaylist( uri )
.then( function(response){
$scope.following = true;
NotifyService.notify( 'Playlist recovered' );
$scope.updatePlaylists();
});
}
$scope.editPlaylist = function(){
Expand Down Expand Up @@ -31293,7 +31290,7 @@ angular.module('spotmop.browse.playlist', [])

// figure out if we're following this playlist
if( $scope.spotify.isAuthorized() ){
SpotifyService.isFollowingPlaylist( $stateParams.uri, SettingsService.getSetting('spotifyuser',{id: null}).id )
SpotifyService.isFollowingPlaylist( $stateParams.uri, SettingsService.getSetting('spotify.user.id') )
.then( function( isFollowing ){
$scope.following = $.parseJSON(isFollowing);
});
Expand Down Expand Up @@ -31385,7 +31382,7 @@ angular.module('spotmop.browse.playlist', [])

var playlisturi = $state.params.uri;
var playlistOwnerID = SpotifyService.getFromUri('userid', playlisturi);
var currentUserID = SettingsService.getSetting('spotifyuser.id');
var currentUserID = SettingsService.getSetting('spotify.user.id');

if( $scope.origin == 'spotify' ){
if( playlistOwnerID != currentUserID ){
Expand Down Expand Up @@ -33882,7 +33879,7 @@ angular.module('spotmop.library', [])
$scope.tracklist = {tracks: [], type: 'track'};

// if we've got a userid already in storage, use that
var userid = SettingsService.getSetting('spotifyuserid',$scope.$parent.spotifyUser.id);
var userid = SettingsService.getSetting('spotify.user.id');

SpotifyService.getMyTracks( userid )
.then( function( response ){ // successful
Expand Down Expand Up @@ -34015,7 +34012,7 @@ angular.module('spotmop.library', [])
$scope.artists = [];

// if we've got a userid already in storage, use that
var userid = SettingsService.getSetting('spotifyuserid',$scope.$parent.spotifyUser.id);
var userid = SettingsService.getSetting('spotify.user.id');

SpotifyService.getMyArtists( userid )
.then( function( response ){
Expand Down Expand Up @@ -34103,7 +34100,7 @@ angular.module('spotmop.library', [])
$scope.albums = { items: [] };

// if we've got a userid already in storage, use that
var userid = SettingsService.getSetting('spotifyuser.id');
var userid = SettingsService.getSetting('spotif.user.id');

// if we have full spotify authorization
if( $scope.spotify.isAuthorized() ){
Expand Down Expand Up @@ -35833,7 +35830,7 @@ angular.module('spotmop.services.dialog', [])
// spotify playlist
if( $scope.scheme == 'spotify' ){
SpotifyService.createPlaylist(
$scope.$parent.spotifyUser.id,
SettingsService.getSetting('spotify.user.id'),
{ name: $scope.playlistName, public: $scope.playlistPublic }
)
.then( function(response){
Expand Down Expand Up @@ -36476,7 +36473,7 @@ angular.module('spotmop.services.mopidy', [
if( !name ) name = 'User';

var icon = '';
var spotifyuser = SettingsService.getSetting('spotifyuser');
var spotifyuser = SettingsService.getSetting('spotify.user');
if( spotifyuser ) icon = spotifyuser.images[0].url;

PusherService.broadcast({
Expand Down Expand Up @@ -36777,7 +36774,7 @@ angular.module('spotmop.services.playlistManager', [])
digestSpotifyPlaylists( response );
});
}else{
var userid = SettingsService.getSetting('spotifyuser.id');
var userid = SettingsService.getSetting('spotify.user.id');
SpotifyService.getPlaylists( userid, 50 )
.then( function(response){
digestSpotifyPlaylists( response );
Expand Down Expand Up @@ -36831,7 +36828,7 @@ angular.module('spotmop.services.playlistManager', [])
var playlist = playlists[i];
var origin = $filter('assetOrigin')(playlist.uri);
if( origin == 'spotify' ){
var user = SettingsService.getSetting('spotifyuser.id');
var user = SettingsService.getSetting('spotify.user.id');
if( SpotifyService.isAuthorized() && playlist.uri.startsWith('spotify:user:'+user) ){
myPlaylists.push( playlist );
}
Expand Down Expand Up @@ -36955,7 +36952,7 @@ angular.module('spotmop.services.playlistManager', [])
case 'spotify':

var playlistOwnerID = SpotifyService.getFromUri('userid', uri);
var currentUserID = SettingsService.getSetting('spotifyuser.id');
var currentUserID = SettingsService.getSetting('spotify.user.id');

if( playlistOwnerID != currentUserID ){
NotifyService.error('Cannot modify to a playlist you don\'t own');
Expand Down Expand Up @@ -39084,6 +39081,8 @@ angular.module('spotmop.services.settings', [])
case 3:
if( typeof($localStorage[settingElements[0]]) === 'undefined' )
return null;
if( typeof($localStorage[settingElements[0]][settingElements[1]]) === 'undefined' )
return null;
if( typeof($localStorage[settingElements[0]][settingElements[1]][settingElements[2]]) === 'undefined' )
return null;
return $localStorage[settingElements[0]][settingElements[1]][settingElements[2]];
Expand Down
12 changes: 6 additions & 6 deletions mopidy_spotmop/static/app.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion mopidy_spotmop/static/app.min.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions mopidy_spotmop/static/app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ angular.module('spotmop', [
$scope.playlists = function(){
return PlaylistManagerService.myPlaylists();
}
$scope.spotifyUser = {};
$scope.settings = SettingsService;
$scope.menuCollapsable = false;
$scope.reloadApp = function(){
window.location.reload();
Expand Down Expand Up @@ -343,7 +343,7 @@ angular.module('spotmop', [

$scope.$on('spotmop:spotify:authenticationChanged', function( event, newMethod ){
if( newMethod == 'client' ){
Analytics.trackEvent('Spotify', 'Authorized', $scope.spotifyUser.id);
Analytics.trackEvent('Spotify', 'Authorized', SettingsService.getSetting('spotify.user.id'));
}
});

Expand Down
2 changes: 1 addition & 1 deletion mopidy_spotmop/static/app/browse/artist/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ angular.module('spotmop.browse.artist', [])
// figure out if we're following this playlist
if( $scope.spotify.isAuthorized() ){

var spotifyuserid = SettingsService.getSetting('spotifyuser.id');
var spotifyuserid = SettingsService.getSetting('spotify.user.id');
if( !spotifyuserid ) return false;

SpotifyService.isFollowingArtist( $stateParams.uri, spotifyuserid )
Expand Down
Loading

0 comments on commit 0f793b9

Please sign in to comment.