mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2024-11-25 14:37:59 +01:00
#39: Fixed a typing issue with database results.
This commit is contained in:
parent
851dfff921
commit
c99ec8fc54
1 changed files with 3 additions and 3 deletions
|
@ -614,17 +614,17 @@ class Track extends Model
|
||||||
*/
|
*/
|
||||||
public function getStatusAttribute(){
|
public function getStatusAttribute(){
|
||||||
return $this->trackFiles->reduce(function($carry, $trackFile){
|
return $this->trackFiles->reduce(function($carry, $trackFile){
|
||||||
if($trackFile->status === TrackFile::STATUS_PROCESSING_ERROR) {
|
if((int) $trackFile->status === TrackFile::STATUS_PROCESSING_ERROR) {
|
||||||
return static::STATUS_ERROR;
|
return static::STATUS_ERROR;
|
||||||
|
|
||||||
} elseif (
|
} elseif (
|
||||||
$carry !== static::STATUS_ERROR &&
|
$carry !== static::STATUS_ERROR &&
|
||||||
$trackFile->status === TrackFile::STATUS_PROCESSING) {
|
(int) $trackFile->status === TrackFile::STATUS_PROCESSING) {
|
||||||
return static::STATUS_PROCESSING;
|
return static::STATUS_PROCESSING;
|
||||||
|
|
||||||
} elseif (
|
} elseif (
|
||||||
!in_array($carry, [static::STATUS_ERROR, static::STATUS_PROCESSING]) &&
|
!in_array($carry, [static::STATUS_ERROR, static::STATUS_PROCESSING]) &&
|
||||||
$trackFile->status === TrackFile::STATUS_NOT_BEING_PROCESSED
|
(int) $trackFile->status === TrackFile::STATUS_NOT_BEING_PROCESSED
|
||||||
) {
|
) {
|
||||||
return static::STATUS_COMPLETE;
|
return static::STATUS_COMPLETE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue