From 88b57a631a3628dcf053f5353cf911653528889b Mon Sep 17 00:00:00 2001 From: Kelvin Zhang Date: Thu, 29 Oct 2015 14:36:13 +0000 Subject: [PATCH] Update models with isCached --- app/Album.php | 3 ++- app/Track.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Album.php b/app/Album.php index d71cc1fb..3a2b627a 100644 --- a/app/Album.php +++ b/app/Album.php @@ -99,7 +99,8 @@ class Album extends Model 'name' => $name, 'extension' => $format['extension'], '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) ]; } diff --git a/app/Track.php b/app/Track.php index 7e06db09..51ff35d8 100644 --- a/app/Track.php +++ b/app/Track.php @@ -235,7 +235,8 @@ class Track extends Model 'name' => $trackFile->format, 'extension' => $trackFile->extension, 'url' => $trackFile->url, - 'size' => $trackFile->size + 'size' => $trackFile->size, + 'isCacheable' => $trackFile->is_cacheable ]; }