diff --git a/app/Models/File.php b/app/Models/File.php index bff9de31..cb6ea3cd 100644 --- a/app/Models/File.php +++ b/app/Models/File.php @@ -121,7 +121,7 @@ class File // getID3's 'part_of_a_compilation' value can either be null, ['0'], or ['1'] // We convert it into a boolean here. - $props['part_of_a_compilation'] = !!array_get($comments, 'part_of_a_compilation', [false])[0]; + $props['part_of_a_compilation'] = (bool) array_get($comments, 'part_of_a_compilation', [false])[0]; // We prefer id3v2 tags over others. if (!$artist = array_get($info, 'tags.id3v2.artist', [null])[0]) { @@ -190,7 +190,7 @@ class File // Otherwise, re-use the existing model value. $artist = isset($info['artist']) ? Artist::get($info['artist']) : $this->song->album->artist; - $isCompilation = !!array_get($info, 'part_of_a_compilation'); + $isCompilation = (bool) array_get($info, 'part_of_a_compilation'); // If the "album" tag is specified, use it. // Otherwise, re-use the existing model value. @@ -199,7 +199,7 @@ class File : $this->song->album; } else { // The file is newly added. - $isCompilation = !!array_get($info, 'part_of_a_compilation'); + $isCompilation = (bool) array_get($info, 'part_of_a_compilation'); $artist = Artist::get($info['artist']); $album = Album::get($artist, $info['album'], $isCompilation); } diff --git a/database/migrations/2016_04_15_121215_add_is_complilation_into_albums.php b/database/migrations/2016_04_15_121215_add_is_complilation_into_albums.php index b38a4330..1016901e 100644 --- a/database/migrations/2016_04_15_121215_add_is_complilation_into_albums.php +++ b/database/migrations/2016_04_15_121215_add_is_complilation_into_albums.php @@ -1,7 +1,7 @@