From 9cb13ee535e4ae8638ada14afa743e9cc0e8cf52 Mon Sep 17 00:00:00 2001 From: Peter Deltchev Date: Mon, 7 Sep 2015 17:42:05 -0700 Subject: [PATCH] T357: The importer no longer assumes that a title tag is present. --- app/commands/ImportMLPMA.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/app/commands/ImportMLPMA.php b/app/commands/ImportMLPMA.php index 3bdfeb35..79f0bdd6 100644 --- a/app/commands/ImportMLPMA.php +++ b/app/commands/ImportMLPMA.php @@ -189,7 +189,15 @@ class ImportMLPMA extends Command { //========================================================================================================== - // Determine the genre + // Fill in the title tag if it's missing. + //========================================================================================================== + if (!$parsedTags['title']) { + $parsedTags['title'] = $file->getBasename($file->getExtension()); + } + + + //========================================================================================================== + // Determine the genre. //========================================================================================================== $genreName = $parsedTags['genre']; $this->info('Genre: '.$genreName); @@ -401,8 +409,8 @@ class ImportMLPMA extends Command { return [ [ - 'title' => $tags['title'][0], - 'artist' => $tags['artist'][0], + 'title' => isset($tags['title']) ? $tags['title'][0] : null, + 'artist' => isset($tags['artist']) ? $tags['artist'][0] : null, 'band' => isset($tags['band']) ? $tags['band'][0] : null, 'genre' => isset($tags['genre']) ? $tags['genre'][0] : null, 'track_number' => isset($tags['track_number']) ? $tags['track_number'][0] : null, @@ -429,8 +437,8 @@ class ImportMLPMA extends Command { return [ [ - 'title' => $tags['title'][0], - 'artist' => $tags['artist'][0], + 'title' => isset($tags['title']) ? $tags['title'][0] : null, + 'artist' => isset($tags['artist']) ? $tags['artist'][0] : null, 'band' => isset($tags['band']) ? $tags['band'][0] : null, 'album_artist' => isset($tags['album_artist']) ? $tags['album_artist'][0] : null, 'genre' => isset($tags['genre']) ? $tags['genre'][0] : null,