rg: artist only if credit differs

This commit is contained in:
2025-07-23 23:20:16 +02:00
parent 744dca7c1d
commit 6731d47b49
3 changed files with 8 additions and 4 deletions

View File

@@ -3,7 +3,6 @@ BEGIN { OFS="\t" }
{
line_type=""
line_sectype=""
line_release=format_release
line_year=""
gsub("&", "\\\\&")
id = $1
@@ -11,7 +10,8 @@ BEGIN { OFS="\t" }
sectype = $3
year = substr($4, 1, 4) + 0
title = $5
artist = $6
artistcredit = $6
line_release = artist==artistcredit ? format_release : format_release_w_artist
switch (type) {
case "Single": line_type=format_single; break
case "Album": line_type=format_album; break
@@ -45,7 +45,7 @@ BEGIN { OFS="\t" }
line_sectype = sprintf(format_secondary, line_sectype)
}
sub("<<title>>", title, line_release)
sub("<<artist>>", artist, line_release)
sub("<<artist>>", artistcredit, line_release)
line_year = year ? format_year : ""
sub("<<year>>", year, line_year)
sort = year ? year : 0