From 90dd8cf9060252e71ecbe720cdb7c7ab9ec07523 Mon Sep 17 00:00:00 2001 From: Jim Mason Date: Mon, 25 Nov 2024 16:30:38 +0000 Subject: [PATCH] finessed previous revision --- ui/Editor.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ui/Editor.php b/ui/Editor.php index fd02f541..351699a4 100644 --- a/ui/Editor.php +++ b/ui/Editor.php @@ -310,8 +310,8 @@ private function prefillTracks() { // where (22) is an optional suffix. // We want only the last word, exclusive the suffix // (in this case, 'Wilson'). - $artist = isset($track->extraartists) && - preg_match('/(\w+)(?:\s\(\d+\))?$/', $track->extraartists[0]->name, $matches) ? $matches[1] . ': ' : ''; + $artist = isset($track->artists) && + preg_match('/(\w+)(?:\s\(\d+\))?$/', $track->artists[0]->name, $matches) ? $matches[1] . ': ' : ''; foreach($track->sub_tracks as $track) { $entry = []; @@ -329,8 +329,9 @@ private function prefillTracks() { continue; // see comment above about the artist name format - $artist = isset($track->extraartists) && - preg_match('/(\w+)(?:\s\(\d+\))?$/', $track->extraartists[0]->name, $matches) ? $matches[1] . ': ' : ''; + $artist = isset($_GET["artist"]) && + isset($track->artists) && + preg_match('/(\w+)(?:\s\(\d+\))?$/', $track->artists[0]->name, $matches) ? $matches[1] . ': ' : ''; $entry = []; $entry["seq"] = ++$seq;