gchudov / cuetools.net

CD image processing suite with optimized lossless encoders in C#
http://cue.tools/
Other
478 stars 51 forks source link

weird behaviour with semicolons in Genre-Tag #222

Open bubmann opened 1 year ago

bubmann commented 1 year ago

when "write basic tags from CUE data" is enabled, the Genre-Tag gets copied in a fashion that ... "breaks" the semicolon. It won't be recognized by foobar2000 correctly, so that e.g. the tag "Leftfield; Abstract; IDM" isn't recognized as 3 strings, but only one. editing the tag by hand in any fashion restores the correct resolution. when the option is disabled, the genre tag gets copied correctly

experienced with FLACCL

c72578 commented 1 year ago

@bubmann Thanks for your report. Could you please provide further details for reproducing the issue?

c72578 commented 1 year ago

@bubmann Could you please post a screenshot of your CUETools Advanced Settings - Tagging, when the issue as you describe it occurs? e.g.: Advanced_Settings_Tagging

How does it look in foobar2000, when the issue occurs?

so that e.g. the tag "Leftfield; Abstract; IDM" isn't recognized as 3 strings, but only one

e.g.: foobar_Genre_Classical_foo_bar

bubmann commented 1 year ago

first: I now get the feeling that this is more of a foobar2000 issue, and how it handles multi-value fields, because using the discogs-plugin to create multi-value fields without intervention works flawlessly, but when I change them by hand in the discogs-tagger-dialogue I get the same issue ... the tags are interpreted as a single string instead of an array of strings. maybe it's tag editor handles semi-colons strangely and somehow distinguishes between a "real" ASCII one and it's own multi-value-seperator? I had a look at your source and the foobar2000 SDK, but my attempt at an information technology bachelor was quite some time ago ... (if it's not too much trouble I'd like a hint at to where the actual tagging logic is localized in your code, and where the modes are set in the interface, I tried searching for the setting names and some keywords in Visual Studio and didn't get very far. only found some references to the tagging library. CUETools is a program I've come to use very regularly and I'd like to contribute if I can)

now to answer your questions: the program used to create the files was either EAC, CUETools or foobar2000, but the program to last write the tags was always foobar2000. I try to tag everything according to my scheme and only then convert with CUETools, so that the filenames and contents of the cuefile are in order with the final result. the source file format is usually FLAC. the program to edit by hand and "restore" would be foobar2000 again. the version of CUETools used is 2.2.2

now to the pictures ... this also a perfect example of https://github.com/gchudov/cuetools.net/issues/221

in this case, the source format is seperate FLAC-tracks with a cuefile

these settings settings1

yield these results: genre not split, tracknumber written with a leading zero (probably just copied from the CUE, not the FLAC?) settings1result1 settings1result2

while these settings settings2

yield these results: genre split correctly, but tracknumber not written at all settings2result1 settings2result2

c72578 commented 1 year ago

@bubmann Thanks for the additional info. In both "Properties" screenshots the Genre looks the same: IDM; Neofolk. Could you please provide more details, where the Genre issue occurs? Which version of foobar2000 are you using?

bubmann commented 1 year ago

yes, that is my point. it DOES look the same in the preferences, but it isn't. weird behaviour. have a look at the columns_UI screenshots ... the Genre tag for both is looking the same, but the UI is rendering the one with a semicolon because it does not recognize it as a splitting operator. the second one is producing a correctly split multi-value with a comma. same problem for the medialibrary, where it would get it's own entry IDM; Neofolk in the genre view instead of being listed under Neofolk and IDM respectively

oh and I just tested how that works for either embedded mode or Image+CUE ... Image+CUE does exhibit the same behaviour, but embedded mode does not and behaves correctly with "Write basic tags from CUE data" either on or off

c72578 commented 1 year ago

Here is some background info concerning the foobar2000 topic: „Fields with semicolons written by other programs are not split“: https://hydrogenaud.io/index.php?topic=76655.0

c72578 commented 1 year ago

metaflac --list shows what happens, e.g.:

So, in case of foobar2000 edited files, the Genre tag is added multiple times to the flac file and only shown in the file Properties as if it was using the semicolon.

c72578 commented 1 year ago

@bubmann, could you please post the output from metaflac [1] for one of the original flac files (before converting it using CUETools), e.g.: track 02, Eustachian Tube

Please modify the filename, so that it fits yours: metaflac.exe --list "02. Eustachian Tube.flac"

At least the whole METADATA block, which contains ALBUM, ARTIST, DATE, GENRE etc.

[1] https://github.com/xiph/flac/releases/download/1.4.2/flac-1.4.2-win.zip

bubmann commented 1 year ago

can confirm, the Genre-tags are indeed two fields. so foobar2000 is not using multi-value-fields but aggregated fields

(pay no attention to the vendor string, I used this file for my example converts, it is the "original")

METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 476
  vendor string: CUETools FLACCL 2.2.2
  comments: 20
    comment[0]: ALBUM=Cerebro Spin
    comment[1]: ALBUMARTIST=Melodium
    comment[2]: ARTIST=Melodium
    comment[3]: CATALOG=ADR71
    comment[4]: DATE=2008
    comment[5]: DISCNUMBER=1
    comment[6]: DISCOGS_RELEASE_ID=1562710
    comment[7]: GENRE=IDM
    comment[8]: GENRE=Neofolk
    comment[9]: ORGANIZATION=Audio Dregs
    comment[10]: RELEASETYPE=Album
    comment[11]: SOURCE=CD+LOG
    comment[12]: TITLE=Eustachian Tube
    comment[13]: DISCTOTAL=1
    comment[14]: TRACKTOTAL=11
    comment[15]: TRACKNUMBER=2
    comment[16]: replaygain_album_gain=-6.27 dB
    comment[17]: replaygain_album_peak=1.001725
    comment[18]: replaygain_track_gain=-4.81 dB
    comment[19]: replaygain_track_peak=0.982312

just hazarding a guess right now, but looks like when "basic tags are written from CUE data" is active, as you // first, use cue sheet information in your CUETools:Processor, the whole Genre-string is put into one field. not using the CUE, the Genre is usually already conveniently segregated

probably the crucial difference is fileInfo.Tag.Genres = new string[] { Metadata.Genre }; versus the following assignment for a missing Genre-entry in the CUE fileInfo.Tag.Genres = sourceFileInfo.Tag.Genres;

feeling eager, might fork later. I feel those 5 semesters of C# coming back to me, slowly ...