Zeugma440 / atldotnet

Fully managed, portable and easy-to-use C# library to read and edit audio data and metadata (tags) from various audio formats, playlists and CUE sheets
MIT License
442 stars 60 forks source link

some ixml tags in ixml standard are not supported #201

Closed drunkenQCat closed 1 year ago

drunkenQCat commented 1 year ago

The problem

According to ixml standard, there shuold be such two tags:

tr.AdditionalFields["ixml.TAKE_TYPE"] = (item.okTk == TkStatus.bad) ? "NO_GOOD" : ""; // Default value is empty
tr.AdditionalFields["ixml.WILD_TRACK"] = (item.tkNote.Contains("wild")) ? "TRUE" : "FALSE";

but when I run tr.Save, the tags are disappeared. I find that the tags are written as :

Key = ixml.TAKE_TYPE.WILD_TRACK, Value = FALSE

as I run the code again, the tags are written as:

Key = ixml.TAKE_TYPE.WILD_TRACK, Value = FALSE
Key = ixml.TAKE_TYPE.TAKE_TYPE.WILD_TRACK, Value = FALSE

then when I tried to modify the code like this:

void WriteAdditional(Track tr, string tag, string content)
    {
        if (tr.AdditionalFields.ContainsKey(tag)) tr.AdditionalFields[tag] = content;
        else tr.AdditionalFields.Add(tag, content);
    }
WriteAdditional(tr, "ixml.TAKE_TYPE", (item.okTk == TkStatus.bad) ? "NO_GOOD" : "DEFAULT"); // Just make a default value for it

it finally works.

Environment