Skip to content

Commit ef88527

Browse files
committed
Edit check for playlists, local and spotify
1 parent 78a3bfd commit ef88527

8 files changed

Lines changed: 28 additions & 20 deletions

File tree

mopidy_spotmop/static/app-annotated.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31199,11 +31199,13 @@ angular.module('spotmop.browse.playlist', [])
3119931199
$scope.totalTime = 0;
3120031200
$scope.following = false;
3120131201
$scope.canEdit = function(){
31202-
if( $scope.origin == 'spotify' && typeof(playlist) !== 'undefined' && typeof(playlist.owner) !== 'undefined' ){
31203-
return ( playlist.owner.id == spotifyUser.id );
31204-
}else if( $scope.origin == 'm3u' ){
31205-
return true;
31202+
if( $scope.origin == 'm3u' ) return true;
31203+
if( $scope.origin == 'spotify' ){
31204+
if( typeof( $scope.playlist ) !== 'undefined' && typeof( $scope.playlist.owner ) !== 'undefined' ){
31205+
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotifyuser.id') );
31206+
}
3120631207
}
31208+
return false;
3120731209
}
3120831210

3120931211
$scope.deletePlaylist = function(){

mopidy_spotmop/static/app.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31199,11 +31199,13 @@ angular.module('spotmop.browse.playlist', [])
3119931199
$scope.totalTime = 0;
3120031200
$scope.following = false;
3120131201
$scope.canEdit = function(){
31202-
if( $scope.origin == 'spotify' && typeof(playlist) !== 'undefined' && typeof(playlist.owner) !== 'undefined' ){
31203-
return ( playlist.owner.id == spotifyUser.id );
31204-
}else if( $scope.origin == 'm3u' ){
31205-
return true;
31202+
if( $scope.origin == 'm3u' ) return true;
31203+
if( $scope.origin == 'spotify' ){
31204+
if( typeof( $scope.playlist ) !== 'undefined' && typeof( $scope.playlist.owner ) !== 'undefined' ){
31205+
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotifyuser.id') );
31206+
}
3120631207
}
31208+
return false;
3120731209
}
3120831210

3120931211
$scope.deletePlaylist = function(){

mopidy_spotmop/static/app.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mopidy_spotmop/static/app.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

mopidy_spotmop/static/app/browse/playlist/controller.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ angular.module('spotmop.browse.playlist', [])
2828
$scope.totalTime = 0;
2929
$scope.following = false;
3030
$scope.canEdit = function(){
31-
if( $scope.origin == 'spotify' && typeof(playlist) !== 'undefined' && typeof(playlist.owner) !== 'undefined' ){
32-
return ( playlist.owner.id == spotifyUser.id );
33-
}else if( $scope.origin == 'm3u' ){
34-
return true;
31+
if( $scope.origin == 'm3u' ) return true;
32+
if( $scope.origin == 'spotify' ){
33+
if( typeof( $scope.playlist ) !== 'undefined' && typeof( $scope.playlist.owner ) !== 'undefined' ){
34+
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotifyuser.id') );
35+
}
3536
}
37+
return false;
3638
}
3739

3840
$scope.deletePlaylist = function(){

mopidy_spotmop/static/app/browse/playlist/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h2 class="description" ng-bind-html="playlist.description" ng-show="playlist.de
1717
</div>
1818

1919
</div>
20-
20+
2121
<div class="buttons">
2222

2323
<a class="button primary" ng-click="playPlaylist()"><i class="fa fa-play"></i>&nbsp; Play</a>

src/app/browse/playlist/controller.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ angular.module('spotmop.browse.playlist', [])
2828
$scope.totalTime = 0;
2929
$scope.following = false;
3030
$scope.canEdit = function(){
31-
if( $scope.origin == 'spotify' && typeof(playlist) !== 'undefined' && typeof(playlist.owner) !== 'undefined' ){
32-
return ( playlist.owner.id == spotifyUser.id );
33-
}else if( $scope.origin == 'm3u' ){
34-
return true;
31+
if( $scope.origin == 'm3u' ) return true;
32+
if( $scope.origin == 'spotify' ){
33+
if( typeof( $scope.playlist ) !== 'undefined' && typeof( $scope.playlist.owner ) !== 'undefined' ){
34+
return ( $scope.playlist.owner.id == SettingsService.getSetting('spotifyuser.id') );
35+
}
3536
}
37+
return false;
3638
}
3739

3840
$scope.deletePlaylist = function(){

src/app/browse/playlist/template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ <h2 class="description" ng-bind-html="playlist.description" ng-show="playlist.de
1717
</div>
1818

1919
</div>
20-
20+
2121
<div class="buttons">
2222

2323
<a class="button primary" ng-click="playPlaylist()"><i class="fa fa-play"></i>&nbsp; Play</a>

0 commit comments

Comments
 (0)