Skip to content

Commit

Permalink
finessed extra artist
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketMan committed Nov 25, 2024
1 parent 90dd8cf commit d5262b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/Editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,14 +330,14 @@ private function prefillTracks() {

// see comment above about the artist name format
$artist = isset($_GET["artist"]) &&
isset($track->artists) &&
preg_match('/(\w+)(?:\s\(\d+\))?$/', $track->artists[0]->name, $matches) ? $matches[1] . ': ' : '';
isset($track->extraartists) &&
preg_match('/(\w+)(?:\s\(\d+\))?$/', $track->extraartists[0]->name, $matches) ? " ({$matches[1]})" : '';

$entry = [];
$entry["seq"] = ++$seq;
$entry["oseq"] = trim($track->position);
$entry["time"] = trim($track->duration);
$entry["title"] = mb_substr($artist . trim($track->title), 0, PlaylistEntry::MAX_FIELD_LENGTH);
$entry["title"] = mb_substr(trim($track->title) . $artist, 0, PlaylistEntry::MAX_FIELD_LENGTH);
// strip optional numeric suffix from artist name
if($track->artists &&
preg_match('/^(.+?)(?:\s\(\d+\))?$/', $track->artists[0]->name, $matches))
Expand Down

0 comments on commit d5262b3

Please sign in to comment.