Skip to content

Commit e04d251

Browse files
committed
Merge pull request #45 from jaedb/feature/patches
Feature/patches
2 parents 1378236 + cee7b15 commit e04d251

46 files changed

Lines changed: 621 additions & 408 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.htaccess

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
Redirect 301 /index.html /src/index.html
1+
# If you've pulled Spotmop via GitHub, you can run this using any webserver
2+
# by navigating to localhost/src. Otherwise we'll redirect it to the Mopidy instance as per below
3+
4+
RewriteEngine On
5+
RewriteCond %{REQUEST_URI} !^/src
6+
RewriteRule (.*) http://%{HTTP_HOST}:6680/spotmop/ [R=301,L]

mopidy_spotmop/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
from mopidy import config, ext
1919

20-
__version__ = '2.5.1'
20+
__version__ = '2.5.3'
2121
__ext_name__ = 'spotmop'
2222
__verbosemode__ = False
2323

mopidy_spotmop/static/app/app.js

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ angular.module('spotmop', [
229229
* Spotify is online and authorized
230230
**/
231231
$scope.$on('spotmop:spotify:online', function(){
232+
$rootScope.spotifyOnline = true;
232233
SpotifyService.getMe()
233234
.then( function(response){
234235
$scope.spotifyUser = response;
@@ -552,15 +553,10 @@ angular.module('spotmop', [
552553

553554
// turn the trigger safety of
554555
dragging.safetyOff = true;
555-
556-
// setup the tracer, and make him sticky
557-
dragTracer
558-
.show()
559-
.css({
560-
top: event.clientY-10,
561-
left: event.clientX+10
562-
});
563-
556+
557+
// setup the tracer
558+
dragTracer.show();
559+
564560
$(document).find('.droppable').removeClass('dropping');
565561
$(document).find('.dropping-within').removeClass('dropping-within');
566562

@@ -569,21 +565,17 @@ angular.module('spotmop', [
569565
isMenuItem = true;
570566

571567
if( target && isMenuItem && target.attr('data-type') === 'queue' ){
572-
dragTracer.addClass('good').html('Add to queue');
573568
target.addClass('dropping');
574569
}else if( target && isMenuItem && target.attr('data-type') === 'library' ){
575-
dragTracer.addClass('good').html('Add to library');
576570
target.addClass('dropping');
577571
}else if( target && isMenuItem && target.attr('data-type') === 'playlists' ){
578-
dragTracer.addClass('good').html('Add to playlist');
579572
target.closest('.menu-item.playlists').addClass('dropping-within');
580573
target.addClass('dropping');
581574
}else if( target && isMenuItem && target.attr('data-type') === 'playlist' ){
582-
dragTracer.addClass('good').html('Add to playlist');
583575
target.addClass('dropping');
584576
target.closest('.menu-item.playlists').addClass('dropping-within');
585577
}else{
586-
dragTracer.removeClass('good').html('Dragging '+dragging.tracks.length+' track(s)');
578+
dragTracer.html('Dragging '+dragging.tracks.length+' track(s)');
587579
}
588580
}
589581
}

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

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ angular.module('spotmop.browse.artist.overview({', [])
4141
/**
4242
* Main controller
4343
**/
44-
.controller('ArtistController', function ( $scope, $rootScope, $timeout, $interval, $stateParams, $sce, SpotifyService, SettingsService, EchonestService, NotifyService ){
44+
.controller('ArtistController', function ( $scope, $rootScope, $timeout, $interval, $stateParams, $sce, SpotifyService, SettingsService, EchonestService, NotifyService, LastfmService ){
4545

4646
$scope.artist = {};
4747
$scope.tracklist = {type: 'track'};
@@ -69,10 +69,19 @@ angular.module('spotmop.browse.artist.overview({', [])
6969
*/
7070
}
7171

72-
// get the artist
72+
// get the artist from Spotify
7373
SpotifyService.getArtist( $stateParams.uri )
7474
.then( function( response ){
7575
$scope.artist = response;
76+
77+
/*
78+
// get the artist from LastFM
79+
// NOT CURRENTLY REQUIRED AS IT DOESN'T PROVIDE MUCH MORE USEFUL DATA
80+
LastfmService.artistInfo( response.name )
81+
.then( function( response ){
82+
console.log( response );
83+
});
84+
*/
7685
});
7786

7887
// figure out if we're following this playlist

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ angular.module('spotmop.browse.playlist', [])
144144
$scope.playlist.description = $sce.trustAsHtml( $scope.playlist.description );
145145

146146
// figure out if we're following this playlist
147-
SpotifyService.isFollowingPlaylist( $stateParams.uri, SettingsService.getSetting('spotifyuserid',null) )
147+
SpotifyService.isFollowingPlaylist( $stateParams.uri, SettingsService.getSetting('spotifyuser',{id: null}).id )
148148
.then( function( isFollowing ){
149149
$scope.following = $.parseJSON(isFollowing);
150150
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

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

14-
<span class="follow-unfollow" ng-show="playlist.owner.id !== spotifyUser.id" ng-class="{ 'following': following }">
14+
<span class="follow-unfollow" ng-show="playlist.owner.id != spotifyUser.id" ng-class="{ 'following': following }">
1515
<a class="button unfollow"
1616
ng-class="{destructive: hovering}"
1717
ng-click="unfollowPlaylist()"
@@ -26,7 +26,7 @@
2626
</a>
2727
</span>
2828

29-
<span class="owner-actions" ng-show="playlist.owner.id === spotifyUser.id">
29+
<span class="owner-actions" ng-show="playlist.owner.id == spotifyUser.id">
3030
<span ng-show="following">
3131
<a class="button"
3232
ng-click="editPlaylist( $scope )">

mopidy_spotmop/static/app/common/mainmenu.template.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
<a ui-sref="queue" class="droppable" data-type="queue">
44
<i class="fa fa-play"></i>
55
Now playing
6+
<span class="dragging-note">Add to queue</span>
67
</a>
78
</li>
89
<li class="menu-item top-level {{ linkingMode('search') }} mobile-show">
@@ -45,12 +46,14 @@
4546
<a ui-sref="library.tracks" class="droppable" data-type="library">
4647
<i class="fa fa-music"></i>
4748
Tracks
49+
<span class="dragging-note">Add to library</span>
4850
</a>
4951
</li>
5052
<li class="menu-item top-level {{ linkingMode(['library.artists', 'library.artist']) }}">
5153
<a ui-sref="library.artists" class="droppable" data-type="library">
5254
<i class="fa fa-user"></i>
5355
Artists
56+
<span class="dragging-note">Add to library</span>
5457
</a>
5558
</li>
5659
<li class="menu-item top-level playlists {{ linkingMode(['library.playlists', 'library.playlist']) }}">
@@ -60,7 +63,10 @@
6063
</a>
6164
<ul class="submenu playlists animate" ng-class="{ empty: playlistsMenu.length <= 0 }">
6265
<li ng-repeat="playlist in playlistsMenu" class="menu-item">
63-
<a href="{{ playlist.link }}" ng-bind="playlist.name" data-type="playlist" data-uri="{{ playlist.uri }}" class="droppable"></a>
66+
<a href="{{ playlist.link }}" data-type="playlist" data-uri="{{ playlist.uri }}" class="droppable">
67+
<span ng-bind="playlist.name"></span>
68+
<span class="dragging-note">Add to playlist</span>
69+
</a>
6470
</li>
6571
</ul>
6672
</li>

mopidy_spotmop/static/app/library/controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,10 +277,10 @@ angular.module('spotmop.library', [])
277277
DialogService.create('createPlaylist', $scope);
278278
}
279279

280-
$scope.playlists = [];
280+
$scope.playlists = { items: [] };
281281

282282
// if we've got a userid already in storage, use that
283-
var userid = SettingsService.getSetting('spotifyuserid',$scope.$parent.spotifyUser.id);
283+
var userid = SettingsService.getSetting('spotifyuser',{ id: null }).id;
284284

285285
SpotifyService.getPlaylists( userid )
286286
.then( function( response ){ // successful

mopidy_spotmop/static/app/library/playlists.template.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33

44
<div class="page-header mobile-show">
55
<span class="menu-reveal-trigger" ng-click="showMenu()"><i class="fa fa-bars"></i></span>
6-
<h1>Playlists</h1>
6+
<a class="create-playlist button pull-right"
7+
ng-click="createPlaylist()">
8+
<i class="fa fa-plus"></i>
9+
</a>
10+
<h1>Playlists</h1>
711
</div>
812

9-
<a class="button create-playlist float-right primary"
13+
<a class="button create-playlist float-right primary mobile-hide"
1014
ng-click="createPlaylist()">
1115
<span>New</span>
1216
</a>

mopidy_spotmop/static/app/services/dialog/createplaylist.template.html

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,31 @@
33
<h4 class="section-title dialog-title">Create playlist</h4>
44

55
<form>
6+
7+
<div class="field text large">
8+
<input name="name" placeholder="Playlist name" ng-model="playlistName" />
9+
</div>
10+
11+
<div class="field radio">
12+
<label>
13+
<input type="radio" name="public" value="true" ng-model="playlistPublic" checked="checked" />
14+
<span class="label">Public</span>
15+
</label>
16+
<label>
17+
<input type="radio" name="public" value="false" ng-model="playlistPublic" />
18+
<span class="label">Private</span>
19+
</label>
20+
<div class="clear"></div>
21+
</div>
622

7-
<input class="large" name="name" placeholder="Playlist name" ng-model="playlistName" />
8-
9-
<span class="actions">
10-
11-
<span class="button toggle-public" ng-click="togglePublic()">
12-
<i class="fa fa-lock fa-fw" ng-show="!playlistPublic"></i>
13-
<i class="fa fa-unlock fa-fw" ng-show="playlistPublic"></i>
14-
</span>
15-
16-
<span class="button save productive" ng-click="savePlaylist()" ng-hide="saving">
17-
<i class="fa fa-check"></i>
18-
</span>
19-
23+
<div class="actions">
24+
<span class="button save primary" ng-click="savePlaylist()" ng-hide="saving">
25+
<i class="fa fa-check"></i>&nbsp; Save
26+
</span>
2027
<span ng-show="saving" class="saving">
2128
<img src="assets/svg/spinner.svg" class="working" />
2229
</span>
30+
</div>
2331

2432
</form>
2533

0 commit comments

Comments
 (0)