Author Topic: Discogs Tagger Plugin  (Read 10974 times)

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
you can include the disc number in the results appending that to the results:
MetaDataType.DiscNo
and MetaDataType.DiscCount if you wish

ganamide

  • Newbie
  • *
  • Posts: 13
DiscNo and DiscCount are currently being returned as single values. Would I be able to put many different TrackCount and DiscNo values using the same concatenation construct that is being used for TrackNo?

Here is an example using a master release that has two discs where the first disc has 4 tracks and the second one has 3 tracks. Let's give them the following position values 1-1, 1-2, 1-3, 1-4, 2-1, 2-2, 2-3.

The current plugin code would split the results into two discs and only return the first one with the following pairs of interest:

  key = MetaDataType.TrackNo,  value = "1 2 3 4"
  key = MetaDataType.TrackCount,  value = "4"
  key = MetaDataType.DiscNo,  value = "1"
  key = MetaDataType.DiscCount,  value = "2"

Would the plugin be able to return something like this instead for both discs in a single result?:

  key = MetaDataType.TrackNo,  value = "1 2 3 4 1 2 3"
  key = MetaDataType.TrackCount,  value = "4 4 4 4 3 3 3"
  key = MetaDataType.DiscNo,  value = "1 1 1 1 2 2 2"
  key = MetaDataType.DiscCount,  value = "2"

DiscCount is the only value that is the same for all tracks, so it can remain a single value. BTW, there are additional key/value pairs that I am leaving out of this example that would also be in the result, such as TrackTitle, Artist, and Duration, which of course would contain data for all 7 tracks in my 2 disc example.
Last Edit: November 23, 2016, 07:33:18 PM by ganamide

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
i can make changes for v3.1 to support your requirement.
The current MB version doesnt actually parse TrackNo, so to keep backwards compatibility i suggest TrackNo be loaded with either multiple track numbers for single discs or multiple disc and track numbers for multiple discs
eg.
for multi-disc
  key = MetaDataType.TrackNo,  value = "1-1 1-2 1-3 1-4 2-1 2-2 2-3"
MB could also support this for single disc but its not really necessary as it can be inferred like now
  key = MetaDataType.TrackNo,  value = "1 2 3 4"

track count could be inferred as is the case now


Let me know if thats acceptable and you are going to make the change and if so i will update v3.1 which is already released for testing

ganamide

  • Newbie
  • *
  • Posts: 13
That's acceptable. I assume you will be inferring both the TrackCount and the DiscCount in the multi-disc scenario, correct? I'm ready to make the change now.

ganamide

  • Newbie
  • *
  • Posts: 13
I guess I could just pass in the DiscCount as is already being done. Whatever works for you. Any idea when you can make the change to support the multi-disc result?

I finished designing an algorithm to convert most of the various discogs position number formats that could result from supporting different types of multiple disc and multiple format releases. It wasn't easy, and it won't cover every single case, but I think my design will work for 99.9% of them. If it all works out, the plugin will be able to split the following different types of position values into separate discs and tracks:

A1, A-1, CD1, CD1-1, ALPHA1, LP-A1, 12"-A1, 10'' A, LP A1

I will also be handling mixed media that often comes in box sets such as CD + Vinyl or CD + DVD. In order to do all this I will write code that detects disc or side changes, combines two consecutive sides into one disc (i.e. side A followed by side B tracks both go on one disc), and auto-number the discs and tracks based on order of appearance and not use the actual value in the position field.

Here is an example of how my changes will convert the following sequence of track positions from discogs format into DiscNo-TrackNo format:

Input :     A,   B1,  B2,  B3,  C1,  C2,    D,    E, CD1, CD2, CD3, CD4, DVD1-1, DVD1-2, DVD2
Output: 1-1, 1-2, 1-3, 1-4, 2-1, 2-2, 2-3, 3-1, 4-1,  4-2, 4-3,  4-4,       5-1,      5-2,   6-1

I think this conversion is the best way to handle it. What do you think? Would it make sense to display the TrackNo, TrackCount, DiscNo, and DiscCount columns in the track match up table? I've often found myself wondering what values the auto tagger found before committing to apply the tags.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
Any idea when you can make the change to support the multi-disc result?
i will look at it this weekend

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34312
http://musicbee.niblseed.com/V3_1/MusicBee31_Patched.zip

unzip into the folder MB is installed and replace the existing files

as discussed, if you populate the MetaDataType.TrackNo then mb will use the values for track number and if a "-" is included, it will split the value into a disc and track number.
Track count and disc count will be inferred from the values supplied

You should also supply a single disc number and disc count in the same way as its done now for backwards compatability

mbApiInterface.ApiRevision >= 50 indicates MB has this new functionality if you want to check if the new functionality is supported

edit:
also i recommend a small change to the internet connection code. I will PM you that later or tomorrow
Last Edit: November 26, 2016, 09:10:41 PM by Steven

ganamide

  • Newbie
  • *
  • Posts: 13
I got the latest 3.1 beta, made the connection change you recommended in the PM, and folded in my new code without the backward compatibility check (I'll do that after I get this working.) The disc#, discCount, and track# fields all seem to work. The only field that is not working for me is the trackCount, which is set to '1' for every single track in the box set. It looks like I am sending the correct multi-disc, multi-track format for trackNo field:

{[86, 1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-9 1-10 1-11 1-12 1-13 1-14 1-15 2-1 2-2 2-3 2-4 2-5 2-6 2-7 2-8 2-9 2-10 2-11 2-12 2-13 2-14 2-15 3-1 3-2 3-3 3-4 3-5 3-6 3-7 3-8 3-9 3-10 3-11 3-12 3-13 3-14 3-15 4-1 4-2 4-3 4-4 4-5 4-6 4-7 4-8 4-9 4-10 4-11 4-12 4-13 4-14 4-15 5-1 6-1 6-2]}

86 is the enum value for MetaDataType.TrackNo, which is the key in this case. The string of dashed pairs are <disc#>-<track#> values for all tracks in this 6 disc box set.