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