Update models with isCached

This commit is contained in:
Kelvin Zhang 2015-10-29 14:36:13 +00:00
parent 4876775f31
commit 88b57a631a
2 changed files with 4 additions and 2 deletions

View file

@ -99,7 +99,8 @@ class Album extends Model
'name' => $name, 'name' => $name,
'extension' => $format['extension'], 'extension' => $format['extension'],
'url' => $album->getDownloadUrl($name), 'url' => $album->getDownloadUrl($name),
'size' => Helpers::formatBytes($album->getFilesize($name)) 'size' => Helpers::formatBytes($album->getFilesize($name)),
'isCacheable' => (in_array($name, array_keys(Track::$CacheableFormats)) ? true : false)
]; ];
} }

View file

@ -235,7 +235,8 @@ class Track extends Model
'name' => $trackFile->format, 'name' => $trackFile->format,
'extension' => $trackFile->extension, 'extension' => $trackFile->extension,
'url' => $trackFile->url, 'url' => $trackFile->url,
'size' => $trackFile->size 'size' => $trackFile->size,
'isCacheable' => $trackFile->is_cacheable
]; ];
} }