renaming utility: Support album artist
This commit is contained in:
parent
e9ded173f1
commit
8cbde0fdb5
|
@ -46,10 +46,11 @@ TAGEDITOR_JS_VALUE &operator<<(TAGEDITOR_JS_VALUE &diagObject, const Diagnostics
|
|||
TAGEDITOR_JS_VALUE &operator<<(TAGEDITOR_JS_VALUE &tagObject, const Tag &tag)
|
||||
{
|
||||
// add text fields
|
||||
static const char *fieldNames[] = { "title", "artist", "album", "year", "comment", "genre", "encoder", "language", "description", nullptr };
|
||||
static const KnownField fields[] = { KnownField::Title, KnownField::Artist, KnownField::Album, KnownField::Year, KnownField::Comment,
|
||||
KnownField::Genre, KnownField::Encoder, KnownField::Language, KnownField::Description };
|
||||
const char **fieldName = fieldNames;
|
||||
static const char *const fieldNames[]
|
||||
= { "title", "artist", "albumartist", "album", "year", "comment", "genre", "encoder", "language", "description", nullptr };
|
||||
static const KnownField fields[] = { KnownField::Title, KnownField::Artist, KnownField::AlbumArtist, KnownField::Album, KnownField::Year,
|
||||
KnownField::Comment, KnownField::Genre, KnownField::Encoder, KnownField::Language, KnownField::Description };
|
||||
const char *const *fieldName = fieldNames;
|
||||
const KnownField *field = fields;
|
||||
for (; *fieldName; ++fieldName, ++field) {
|
||||
try {
|
||||
|
|
|
@ -114,8 +114,11 @@ if (fileInfo.currentSuffix === "tmp") {
|
|||
// define an array for the fields to be joined later
|
||||
var fields = []
|
||||
|
||||
// get the artist, remove invalid characters and add it to fields array
|
||||
var artist = validFileName(tag.artist)
|
||||
// get the artist (preferably album artist), remove invalid characters and add it to fields array
|
||||
var artist = validFileName(tag.albumartist)
|
||||
if (artist.length === 0) {
|
||||
artist = validFileName(tag.artist)
|
||||
}
|
||||
if (includeArtist && !isPartOfCollection(tag) && notEmpty(artist)) {
|
||||
fields.push(artist)
|
||||
}
|
||||
|
@ -183,7 +186,10 @@ if (!distDir) {
|
|||
return
|
||||
}
|
||||
var path = [distDir]
|
||||
var artist = validDirectoryName(tag.artist)
|
||||
var artist = validDirectoryName(tag.albumartist)
|
||||
if (artist.length === 0) {
|
||||
artist = validDirectoryName(tag.artist)
|
||||
}
|
||||
if (isPartOfCollection(tag)) {
|
||||
path.push(collectionsDir)
|
||||
} else if (isMiscFile(tag)) {
|
||||
|
|
Loading…
Reference in New Issue