From e6ee85d6d98f9b71c250e457ecc15fa4cea0beb8 Mon Sep 17 00:00:00 2001 From: Josef Citrine Date: Mon, 29 Aug 2016 15:36:38 +0100 Subject: [PATCH] Album API now works with versioning system --- app/Models/Track.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Models/Track.php b/app/Models/Track.php index cd489ae3..cf8de179 100644 --- a/app/Models/Track.php +++ b/app/Models/Track.php @@ -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