Skip to content

Commit

Permalink
finessed previous revision
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Nov 25, 2024
1 parent 06a1ac9 commit 90dd8cf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand All @@ -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;
Expand Down

0 comments on commit 90dd8cf

Please sign in to comment.