mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-02-16 18:14:23 +01:00
#4: Fixed an error in the cache polling callback.
This commit is contained in:
parent
c28c887e29
commit
2d93ed0ef4
4 changed files with 17 additions and 4 deletions
|
@ -136,6 +136,7 @@ class UploadTrackCommand extends CommandBase
|
|||
$trackFile = new TrackFile();
|
||||
$trackFile->is_master = $name === 'FLAC' ? true : false;
|
||||
$trackFile->format = $name;
|
||||
|
||||
if (in_array($name, Track::$CacheableFormats) && $trackFile->is_master == false) {
|
||||
$trackFile->is_cacheable = true;
|
||||
} else {
|
||||
|
|
|
@ -49,7 +49,11 @@ angular.module('ponyfm').controller "album", [
|
|||
if $scope.albumUrl == 'error'
|
||||
$scope.isInProgress = false
|
||||
else if $scope.albumUrl == 'pending'
|
||||
$timeout $scope.getCachedAlbum(id, format), 5000
|
||||
# $timeout takes a callback function
|
||||
# https://stackoverflow.com/a/23391203/3225811
|
||||
$timeout(
|
||||
$scope.getCachedAlbum(id, format)
|
||||
, 5000)
|
||||
else
|
||||
$scope.isInProgress = false
|
||||
$window.open $scope.albumUrl
|
||||
|
|
|
@ -43,7 +43,11 @@ angular.module('ponyfm').controller 'playlist', [
|
|||
if $scope.playlistUrl == 'error'
|
||||
$scope.isInProgress = false
|
||||
else if $scope.playlistUrl == 'pending'
|
||||
$timeout $scope.getCachedPlaylist(id, format), 5000
|
||||
# $timeout takes a callback function
|
||||
# https://stackoverflow.com/a/23391203/3225811
|
||||
$timeout(
|
||||
() ->$scope.getCachedPlaylist(id, format)
|
||||
, 5000)
|
||||
else
|
||||
$scope.isInProgress = false
|
||||
$window.open $scope.playlistUrl
|
||||
|
|
|
@ -81,8 +81,12 @@ angular.module('ponyfm').controller "track", [
|
|||
if $scope.trackUrl == 'error'
|
||||
$scope.isInProgress = false
|
||||
else if $scope.trackUrl == 'pending'
|
||||
$timeout $scope.getCachedTrack(id, format), 5000
|
||||
# $timeout takes a callback function
|
||||
# https://stackoverflow.com/a/23391203/3225811
|
||||
$timeout(
|
||||
()-> $scope.getCachedTrack(id, format)
|
||||
, 5000)
|
||||
else
|
||||
$scope.isInProgress = false
|
||||
$window.location = $scope.trackUrl#, '_blank'
|
||||
$window.location = $scope.trackUrl
|
||||
]
|
||||
|
|
Loading…
Reference in a new issue