Author Topic: Discogs Tagger Plugin  (Read 10975 times)

ganamide

  • Newbie
  • *
  • Posts: 13
Any progress on this plugin? It was working great the first day I used it, but since I didn't get the Discogs account registration email, my account was disabled until I emailed support to get it reactivated. Now this plugin refuses to work no matter how many times I reinstall it and re-authorize it. Very frustrating since Discogs is so much better than the other options and the Discogs plugin works just fine in Mp3tag so I know it's not a Discogs problem.

I am a programmer and I might be interested in taking a crack at fixing this plugin since it would be very useful.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
try deleting the file "discogs.token" in the musicbee appData folder

ganamide

  • Newbie
  • *
  • Posts: 13
Believe me, I tried that many times. I also applied latest MB patch and restarted my computer. Then I replaced the mb_Discogs.dll file with an older version, restarted MB and that didn't work. I gave up on it for about an hour, then put back the latest mb_Discogs.dll file and restarted. Now it works. I'm thinking the old code or settings got cached somewhere.

Still, it would be nice to make some improvements. Often times I get unexpected results when using the Album Auto-Tagger depending on the search criteria being used, especially when dealing with Various Artists album compilations. Adding the release id as others suggested would help a lot in this regard.

Another related topic is the individual track auto tagger. Would be great if we could preview the changes before applying them. I often want to replace existing tag fields based on the digital sound signature, but if the wrong song is detected I don't want to lose the existing tag values.

ganamide

  • Newbie
  • *
  • Posts: 13
Spoke too soon. I tried Album Auto-Tagger again on a large box set that I was having problems with and it no longer picks up Discogs result. I am thinking it has to do with the large number of files selected for the search. Is it possible that the plugin is sending multiple requests to Discogs based on how many files were selected? Seems like an inefficient way to do things, and it might lock us out for violating the Discogs API hit rate. The box set in question has 63 tracks. When I use Mp3tag program, I never have a problem getting results and it only takes a few seconds.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
you can easily tell what MB is doing by using fiddler2

ganamide

  • Newbie
  • *
  • Posts: 13
Thanks for the tip! Fiddler is a neat tool. I ran fiddler while doing the Album Auto-Tagger and I didn't see any web requests for Discogs despite it being enabled in the Tags (2) Preferences. I see requests going out to freedb and musicbrainz. When I run Mp3Tag, nothing gets logged in fiddler even though the queries work. Maybe they don't use http? Is there anything else I can do to debug my broken Discogs Tagger? I have lots of experience debugging C# applications in VS. Did some VB stuff a long time ago.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
Check the fiddler documentation. I think you need to temporarily configure mp3Tag to connect to a specific port that fiddler listens on while fiddler is running. Not sure why you cant see the discogs but try the same by configuring MB to connect via the same port

ganamide

  • Newbie
  • *
  • Posts: 13
I changed Mp3Tag proxy settings to go through fiddler and I can now see their requests going to api.discogs.com on port 443. I still don't see a similar request coming out of MB. I think the problem is either in MB or in the Discogs Tagger plugin for MB. Is there any logging we could enable to debug this problem further?

MusicBee is a great program and I really appreciate you making it and giving it away for free. I would love to help fix it or contribute in some other way. I am actually surprised you are giving such a feature rich and good looking program away for free. Have you thought about monetizing it or making it completely free and open source so that others can help fix it? I am willing to help you out in either direction.

Thanks, Chris.

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
i dont have time to maintain this plugin. I have sent you a PM with the plugin code if you want to fix or enhance it

ganamide

  • Newbie
  • *
  • Posts: 13
Thanks for the code.

I found a few issues that were specific to the box set I was trying to get data on:

1) Any release that contains at least one item in one of the following formats is skipped: PAL, Cassette, 7", 12", 45 RPM, Single Sided, Vinyl, LP, Minidisc.  My box set contained one 7" vinyl and 5 CDs, so all returned results were skipped.
2) A matching Album Artist and a matching Album Name are BOTH required. Many times I blank out the album artist field when I do a search and apparently this would prevent any result from being returned.

I propose to change these rules to:

1) Don't skip any release because of the listed format. Just because something was on vinyl doesn't mean it can't be used as metadata for a digital copy of the same.
2) Only require a similarly matching Album Artist if it was not empty in the search form

Do you agree with these changes, or do you have any other suggestions?

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313
i am happy for you to do as you wish. If you want to open-source it then i just ask you dont make the api key and secret available.
Last Edit: November 22, 2016, 08:17:13 PM by Steven

ganamide

  • Newbie
  • *
  • Posts: 13
Hi Steven,

I am trying to further modify the discogs plugin to work with the box set, however, it looks like the plugin was not designed to handle box sets, and instead treats each release as a single disc. There is some code that handles splitting tracks by disc, but in the end only the first disc gets returned by the plugin to MB.

I want to ask before I spend much more time on this if MB will be able to handle a result from function GetReleaseInformation with multiple discs in it, and if so, how would this look? I would prefer if the result that the plugin returned was a flat array of tracks which contain tags for track#, track count, disc#, and disc count, in addition to the other standard tags. This would let a user map all the tracks in a box set at once instead of working with individual discs one at a time.

On a related note, I noticed that discogs can have non-numeric track# tags, such as "A", "A1", "CD1-1", etc. I guess they call them positions, and most of these strange ones seem to be related to non digital media. I wonder if I should leave these alone or convert them all into integers starting with 1.

Thanks,
Chris

Steven

  • Administrator
  • Sr. Member
  • *****
  • Posts: 34313

I want to ask before I spend much more time on this if MB will be able to handle a result from function GetReleaseInformation with multiple discs in it, and if so, how would this look? I would prefer if the result that the plugin returned was a flat array of tracks which contain tags for track#, track count, disc#, and disc count, in addition to the other standard tags. This would let a user map all the tracks in a box set at once instead of working with individual discs one at a time.
the "QueryReleases" function allows you to return multiple results and is already the case as implemented, so i guess i am not understanding your question. Did you try? and if its a problem, show an example

ganamide

  • Newbie
  • *
  • Posts: 13
I was actually talking about "GetReleaseInformation" function, which appears to return all the tracks for the selected release. If you take a look inside this function you will see a call to a private function called "GetReleaseDiscs" that does most of the parsing, and returns "List(Of RequestResponse)".  What I was referring to is that only the first item of this list is actually used in "GetReleaseInformation":

  result = GetReleaseDiscs(lastQueryResults(index))(0)

Notice the last zero? So even if I fix "GetReleaseDiscs" to return a list of all discs in the box set, only the first one gets passed back to MB. Since I don't have the code to MB I can't tell what it's expecting. I can only guess based on what the plugin is currently returning, or I could spend time trying different things to see what works. Right now it looks like calls to "GetReleaseInformation" are expecting a single disc.

I guess I'll try setting track#, track count, disc#, and disc count tags on each track and return all tracks as if they belong to the same 'disc' as returned by "GetReleaseDiscs".

ganamide

  • Newbie
  • *
  • Posts: 13
After looking at GetReleaseDiscs some more, I realized that what I wanted to do might not be possible without changes to MB. I was a bit surprised to find that the tags for multiple tracks are concatenated together for each tag type. For example, adding the track number for each track after the first is done with the following line:

  item.Tags(MetaDataType.TrackNo) &= ChrW(0) & trackNo

So for a 9 track disc we end up returning a Key Value pair that looks something like:

  key = MetaDataType.TrackNo,  value = "1 2 3 4 5 6 7 8 9"

Or should that look more like this and MB parses the hyphens into disc-track?:

  key = MetaDataType.TrackNo,  value = "1-1 1-2 1-3 1-4 1-5 1-6 1-7 1-8 1-9"

I just don't see how I could return a list of track entries that would span multiple discs using the current data structure. I was hoping for something more along the lines of returning a collection of Track records, each record having its own set of tags.
Last Edit: November 23, 2016, 10:30:05 AM by ganamide