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,
'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)
];
}

View file

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