3.4 fix album link
This commit is contained in:
parent
fb989567cc
commit
ffa8f67835
4 changed files with 39 additions and 26 deletions
|
@ -229,30 +229,13 @@ function SubsonicCtrl($scope, $rootScope, $location, $window, $routeParams, util
|
|||
});
|
||||
};
|
||||
$scope.getAlbumByTag = function (id) { // Gets Album by ID3 tag
|
||||
$.ajax({
|
||||
url: globals.BaseURL() + '/getAlbum.view?' + globals.BaseParams() + '&id=' + id,
|
||||
method: 'GET',
|
||||
dataType: globals.settings.Protocol,
|
||||
timeout: globals.settings.Timeout,
|
||||
success: function (data) {
|
||||
if (typeof data["subsonic-response"].album != 'undefined') {
|
||||
subsonic.content.album = [];
|
||||
subsonic.song = [];
|
||||
|
||||
//subsonic.content.album.push(map.mapAlbum(data["subsonic-response"].album));
|
||||
|
||||
var items = [];
|
||||
if (data["subsonic-response"].album.song.length > 0) {
|
||||
items = data["subsonic-response"].album.song;
|
||||
} else {
|
||||
items[0] = data["subsonic-response"].album.song;
|
||||
}
|
||||
angular.forEach(items, function (item, key) {
|
||||
subsonic.song.push(map.mapSong(item));
|
||||
});
|
||||
$scope.$apply();
|
||||
}
|
||||
}
|
||||
subsonic.getAlbumByTag(id).then(function (data) {
|
||||
$scope.album = data.album;
|
||||
$scope.song = data.song;
|
||||
$scope.BreadCrumbs = data.breadcrumb;
|
||||
$scope.selectedAutoAlbum = data.selectedAutoAlbum;
|
||||
$scope.selectedArtist = data.selectedArtist;
|
||||
$scope.selectedPlaylist = data.selectedPlaylist;
|
||||
});
|
||||
};
|
||||
$scope.search = function () {
|
||||
|
|
|
@ -356,6 +356,9 @@ function AppCtrl($scope, $rootScope, $document, $window, $location, $cookieStore
|
|||
$scope.isActive = function (route) {
|
||||
return route === $location.path();
|
||||
};
|
||||
$rootScope.getSplitPosition = function (scope, elm) {
|
||||
alert(elm.getBoundingClientRect().left);
|
||||
};
|
||||
$scope.getMusicFolders = function () {
|
||||
$.ajax({
|
||||
url: globals.BaseURL() + '/getMusicFolders.view?' + globals.BaseParams(),
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
<a href="" class="button" id="action_DeletePlaylist" title="Delete Selected Playlist" ng-click="deletePlaylist()">Delete</a>
|
||||
<a href="" class="button" id="action_SavePlaylist" title="Save Playlist" ng-click="savePlaylist()">Save</a>
|
||||
<a href="" class="button" id="action_RemoveSongs" title="Remove selected song(s) from playlist" ng-click="songsRemoveSelected()">Remove Song(s)</a>
|
||||
|
||||
|
|
||||
</div>
|
||||
<a href="" class="button" id="action_PlayAlbum" title="Play Album" ng-click="playAll()"><img src="images/play_gl_6x8.png"></a>
|
||||
<a href="" class="button" id="action_SelectAll" title="Select All" ng-click="selectAll()">All</a>
|
||||
|
|
|
@ -695,10 +695,37 @@ JamStash.factory('subsonic', function ($rootScope, $http, $q, globals, utils, ma
|
|||
if (SelectedAlbumSort.id != "default") {
|
||||
sortSubsonicAlbums(SelectedAlbumSort.id);
|
||||
}
|
||||
deferred.resolve(content);
|
||||
} else {
|
||||
notifications.updateMessage('No Albums Returned :(', true);
|
||||
}
|
||||
deferred.resolve(content);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
},
|
||||
getAlbumByTag: function (id) { // Gets Album by ID3 tag
|
||||
var deferred = $q.defer();
|
||||
$.ajax({
|
||||
url: globals.BaseURL() + '/getAlbum.view?' + globals.BaseParams() + '&id=' + id,
|
||||
method: 'GET',
|
||||
dataType: globals.settings.Protocol,
|
||||
timeout: globals.settings.Timeout,
|
||||
success: function (data) {
|
||||
if (typeof data["subsonic-response"].album != 'undefined') {
|
||||
content.album = [];
|
||||
content.song = [];
|
||||
|
||||
var items = [];
|
||||
if (data["subsonic-response"].album.song.length > 0) {
|
||||
items = data["subsonic-response"].album.song;
|
||||
} else {
|
||||
items[0] = data["subsonic-response"].album.song;
|
||||
}
|
||||
angular.forEach(items, function (item, key) {
|
||||
content.song.push(map.mapSong(item));
|
||||
});
|
||||
}
|
||||
deferred.resolve(content);
|
||||
}
|
||||
});
|
||||
return deferred.promise;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue