Album API now works with versioning system

This commit is contained in:
Josef Citrine 2016-08-29 15:36:38 +01:00 committed by Peter Deltchev
parent 775de16bfe
commit e6ee85d6d9

View file

@ -580,7 +580,7 @@ class Track extends Model implements Searchable, Commentable, Favouritable
*/
public function getFilesize($formatName)
{
$trackFile = $this->trackFiles->where('format', $formatName)->first();
$trackFile = $this->trackFiles()->where('format', $formatName)->first();
if ($trackFile) {
return (int) $trackFile->filesize;
@ -646,9 +646,9 @@ class Track extends Model implements Searchable, Commentable, Favouritable
}
protected function getMasterTrackFile() : TrackFile
public function getMasterTrackFile() : TrackFile
{
return $this->trackFiles->where('is_master', true)->first();
return $this->trackFiles()->where('is_master', true)->first();
}
public function getMasterFormatName() : string