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
440 stars 60 forks source link

Forcing creation of ID3 tag when APE tag exists #227

Closed m0nkge closed 9 months ago

m0nkge commented 10 months ago

The problem

I am trying to create ID3 2.3 tag with chapters to files with existing APE tags. When my code writes the chapters, the APE tag is updated but no ID3 tag is created. When no tag of any kind exists it creates the ID3 tag which is what I want. How can I force it to create an ID3 tag even if APE tag exists?

Environment

Details

Nothing further to add.

Code To Reproduce Issue [ Good To Have ]

    theTrack.Chapters = New System.Collections.Generic.List(Of ChapterInfo)
    For Each row As DataGridViewRow In dgvChapters.Rows
        Dim ch As ATL.ChapterInfo = New ATL.ChapterInfo()
        ' stuff happens here
        theTrack.Chapters.Add(ch)
    Next
    theTrack.Save()
m0nkge commented 10 months ago

Strangely, while it seems to be updating the APE tag (tag size changes), when rereading the metadata no chapters are reported. This is a side issue for me though. I really want to force the creation of ID3 2.3 tags as they are at the front of the file and helps the listener get the chapters without/while downloading the whole file.

Zeugma440 commented 10 months ago

Thanks for your feedback. The feature to force the creation of a given tag is missing but can be added painlessly.

I'll get back to you soon~

Zeugma440 commented 9 months ago

Track.Save has a new signature

public bool Save(MetaDataIOFactory.TagType? tagType = null, Action<float> writeProgress = null)

tagType = Tag type to save.

Adding an ID3v2.3 tag on a file with an APE tag should work like that :

ATL.Settings.ID3v2_tagSubVersion = 3; // Default behaviour is ID3v2.4
Track theTrack = new Track(_fileWithApe_);
theTrack.Save(MetaDataIOFactory.TagType.ID3V2);

Calling Track.Save() still behaves like before.

Are you okay with that ?

By the way, the issue with chapters is because APE... does not support chapters 😅 You should definitely use ID3v2 for that.

Zeugma440 commented 9 months ago

PS : There's nothing published yet; I'm waiting for your opinion about the new interface

m0nkge commented 9 months ago

Yeah, perfect. Thank you.

Zeugma440 commented 9 months ago

Available on today's v5.07