#4: Fixed an error in the cache polling callback.

This commit is contained in:
Peter Deltchev 2015-11-09 22:29:02 -08:00
parent c28c887e29
commit 2d93ed0ef4
4 changed files with 17 additions and 4 deletions

View file

@ -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 {

View file

@ -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

View file

@ -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

View file

@ -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
]