We will be performing plex.tv database server maintenance starting 22:00 Pacific Time on Thursday, June 22 (05:00 GMT, June 23). It is expected to last ~1.5 hours. See http://status.plex.tv/incidents/w98nwqyk43pv
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

[Release] Musicbrainz Agent

EtherManEtherMan Members Posts: 63 ✭✭
The first public release of my package of music agents.

If you have any idea on other sources please dont hesitate to suggest them and I'll try my best to add one. Doesnt have to be a site that has an API or anything, but it WILL have to allow the use of the information for this purpose for free. That means I will not be making one for AllMusic for the time being. I might at some point later, but if so, I'd have to solve their restrictions on number of searches per key first.

If anyone wants to make their own secondary agents to this, I should tell that it uses the MBID as the ID field. In the case of albums, the MBID of the specific release. It also adds the link to discogs listed on musicbrainz if one exist. So id[0:36 == MBID. id[36:] == discogs link. Im doing this because discogs does not support searching by MBID. Im doing this because I treat diffrent releases of the same album as truely diffrent.

Should also say, any information listed with [] in the search box should be stripped as soon as metadata is fetched. It's used for disambiguation between diffrent artists named the same, and diffrent album releases. For artists the information should be a few worded description. For Albums, it will be a 2 letter country code and the release label.

Id appriciate any bugs and requests be added to the github pages of the respective agent (once more are released) or the primary Musicbrainz agent if you dont know which agent is causing an issue.

EDIT: Released the Discogs agent.
EDIT2: Released the LastFM agent.

======
Musicbrainz
Status: Beta1
https://github.com/Ether009/Musicbrainz
Musicbrainz.bundle.zip
======
Musicbrainz_Discogs
Status: Beta1
https://github.com/Ether009/Musicbrainz_Discogs
brainzDiscogs.bundle.zip
======
Musicbrainz_LastFM
Status: Beta1
https://github.com/Ether009/Musicbrainz_LastFM
brainzfm.bundle.zip
======
Musicbrainz_Home_Theater_Backdrops
Status: Coming Soon
======
Musicbrainz_Wikipedia
Status: Planned (Not Started)
«1

Comments

  • vignotvignot Members Posts: 7
    Hi EtherMan,

    thank you for the release. It's working well, plus I learned a few thing by reading your code.

    Anyway :
    - some of my artists are not matched, or are matched but no summary or profile is fectched. I didn't look at the cause yet.
    - my ID3 tags are overriden by album metada from the Album Agent (I checked the Discog one).

    So I've added :
    accepts_from = ['com.plexapp.agents.localmedia']
    

    In the MusicbrainzAgent(Agent.Album) and put the "Local Media Assets (Albums)" on top.

    Anyway, it still doesn't match everything like I would like so I will go on developping my Discogs agent as a primary. Just for fun ;)

    A few thing you should improve :
    - the summary fetched from Discogs contains some tags like [A=blablabl], they should be stripped off.
    - when several artists have the same name, Discogs list them with number.
    Exemple : Sublime, Sublime (2), Sublime (3), etc
    That's not really nice to keep these names in Plex listing.

    Pierre
  • EtherManEtherMan Members Posts: 63 ✭✭
    vignot wrote:

    Hi EtherMan,

    thank you for the release. It's working well, plus I learned a few thing by reading your code.

    Anyway :
    - some of my artists are not matched, or are matched but no summary or profile is fectched. I didn't look at the cause yet.
    - my ID3 tags are overriden by album metada from the Album Agent (I checked the Discog one).

    So I've added :
    accepts_from = ['com.plexapp.agents.localmedia']
    

    In the MusicbrainzAgent(Agent.Album) and put the "Local Media Assets (Albums)" on top.

    Anyway, it still doesn't match everything like I would like so I will go on developping my Discogs agent as a primary. Just for fun ;)

    A few thing you should improve :
    - the summary fetched from Discogs contains some tags like [A=blablabl], they should be stripped off.
    - when several artists have the same name, Discogs list them with number.
    Exemple : Sublime, Sublime (2), Sublime (3), etc
    That's not really nice to keep these names in Plex listing.

    Pierre



    "- some of my artists are not matched, or are matched but no summary or profile is fectched. I didn't look at the cause yet."

    It uses matching against Musicbrainz.org. If it's not automatching, it's likely because artist name in your ID3 tag is not 100% the same as written on the sites. Because it's set to half the score that resulted from the search. So say if you searched for the artist "Weird Al" Yankovic, it'll get a hit on musicbrainz with Weird Al Yankovic with 100 in score even. But since that's not exactly the same as "Weird Al" Yankovic, it will half the score, so to plex, the score is 50, which is below the 80 score needed to match it automaticly. That means it will need manual matching. Im looking into ways to make that smoother by taking more things into consideration for scoring, but for now, it's kindof low priority as long as manual matching works :)

    "- my ID3 tags are overriden by album metada from the Album Agent (I checked the Discog one)."

    Indeed they are. The ID3 tags are used ONLY for providing the initial matching. Beyond that, it fetches all data from remote. Im doing that by design but sure, adding local to accept_from should solve that for those that want that. I'll make sure to update the repo with that asap. Thank you.

    "- the summary fetched from Discogs contains some tags like [A=blablabl], they should be stripped off."

    Yes and no :) I might make that into a setting or something that's off by default. I know that PMC doesnt really handle it so there it looks ugly, but I kindof like having the links in the info myself when viewing it in the browser.

    "- when several artists have the same name, Discogs list them with number."

    It's not something that can be fixed by me. As an example. If I search the discogs site for the artist Mojo, I get http://www.discogs.com/artist/Mojo+(11) as one of the hits. That's Mojo (11). My agent doesnt use that however, but rather it searches on musicbrainz, where it finds several artists named Mojo, one of which have the disambiguation tag of Dubstep... That's the artist Im looking for, so I select that in the "fix incorrect match" because the auto matching will match against the french rapper named Mojo. Now the agent fetches the information for the Mojo Dubstep artist, and finds that there's a link there to the discogs page. It can now fetch the discogs page and there is sees that the artist name is Mojo (11). Now see the reason it cant be fixed, is because unlike musicbrainz, discogs doesnt actually give ANY sort of information as to if that (11) is because of multiple artists or if it's actually part of the artist name. Stripping that away will result in some artists getting it stripped away incorrectly. Basicly, I would LOVE to fix this... But it's not really something in my hands. I'd love to fix it so information from Last.FM isnt combining artists of the same name as well, but also an issue that's sadly, out of my hands. What you can do to avoid getting problems with it, is that you dont set Discogs as the top agent but rather set Musicbrainz or LastFM there instead. That makes them set the name instead of Discogs, and both those will list the names without such tags added to the names.
  • vignotvignot Members Posts: 7
    About the last point, yes, you're right... because you make the search MusicBrainz.
    When doing a search with Discogs you get that :

    >wget "http://api.discogs.com/search?t=artist&q=sublime" -Osublime

    { "resp":
    { "status": true,
    "search":
    { "searchresults":
    { "numResults": "1960", "start": "1", "end": "50",
    "results": [
    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime",
    "summary": "Progressive house / trance project."},

    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%285%29",
    "summary": ""},

    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%283%29",
    "summary": ""},

    {"thumb": "http://s.discogss.com/image/A-150-98600-1304762762.jpeg",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%282%29",
    "summary": "An influential California punk/ska rock band, existed between 1988 and 1996. Sublime disbanded after their singer Brad Nowell died of a heroin overdose on May 25, 1996, only two months before their self-titled album, which is often considered a landmark ska album, was released. In 2009, the surviving members Bud Gaugh and Eric Wilson attempted to reform Sublime with Rome Ramirez as their new singer and guitarist, but due to a lawsuit, the band was forced to change their name to Sublime With Rome. "},

    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%284%29",
    "summary": ""},
    ... ]
    }}}}

    So you can get the artists name "stripped off"... if you match the artist against Discogs directly.
    Or you can get it with a second request, which is definitly not the idea of the year.

    Pierre
  • EtherManEtherMan Members Posts: 63 ✭✭
    vignot wrote:

    About the last point, yes, you're right... because you make the search MusicBrainz.
    When doing a search with Discogs you get that :

    >wget "http://api.discogs.com/search?t=artist&q=sublime" -Osublime

    { "resp":
    { "status": true,
    "search":
    { "searchresults":
    { "numResults": "1960", "start": "1", "end": "50",
    "results": [
    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime",
    "summary": "Progressive house / trance project."},

    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%285%29",
    "summary": ""},

    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%283%29",
    "summary": ""},

    {"thumb": "http://s.discogss.com/image/A-150-98600-1304762762.jpeg",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%282%29",
    "summary": "An influential California punk/ska rock band, existed between 1988 and 1996. Sublime disbanded after their singer Brad Nowell died of a heroin overdose on May 25, 1996, only two months before their self-titled album, which is often considered a landmark ska album, was released. In 2009, the surviving members Bud Gaugh and Eric Wilson attempted to reform Sublime with Rome Ramirez as their new singer and guitarist, but due to a lawsuit, the band was forced to change their name to Sublime With Rome. "},

    {"thumb": "http://s.discogss.com/images/record150.png",
    "title": "Sublime",
    "type": "artist",
    "uri": "http://www.discogs.com/artist/Sublime+%284%29",
    "summary": ""},
    ... ]
    }}}}

    So you can get the artists name "stripped off"... if you match the artist against Discogs directly.
    Or you can get it with a second request, which is definitly not the idea of the year.

    Pierre



    No no... I could make it strip it off for Sublime... Because there isnt a Sublime (2) as an actual name... However just stripping away the (x) from a name would wreak havoc for albums like () (yes there is actually an album named just ()... It's even a quite popular album at that). And it would completely break artists like (sic) and even artists like Greg, (P'****) and so on... As for your search there... It's irrelevant, but let's assume it isnt for a moment... Have you actually looked at what the name is on the actual pages for each of those hits? Such as http://api.discogs.com/artist/Sublime+(2) ? Look at the name field of that artist... Basicly the only way to get the actual artist name from discogs, is during the search... But discogs is a secondary agent for me, not a primary agent. Meaning that if I perform a search for metadata, because multiple artists share name... Then how the HELL am I supposed to match out the name that's relevant? The name Im after could be any of the hits, or none of them...

    So, stripping isnt an option since it breaks other artists...
    Search isnt an option because it's not a primary agent...
    The only remaining option, is for Discogs to not print the numbers as actual parts of artist names.. Until they change that, there's really not much I can do in the agent, unless you can come up with a surefire algorithm for knowing when that parenthesis is being added by discogs or an actual part of the name.
  • xinutelxinutel Members, Plex Pass Posts: 3
    I installed the musicbrainz.bundle folder to my PMS Plug-ins folder and restarted PMS but I don't see the it in my Channel list or as an available agent. What did I miss?

    regards,
    Eric
  • EtherManEtherMan Members Posts: 63 ✭✭
    xinutel wrote:

    I installed the musicbrainz.bundle folder to my PMS Plug-ins folder and restarted PMS but I don't see the it in my Channel list or as an available agent. What did I miss?

    regards,
    Eric


    Most likely, you've put it in the wrong plugins folder. And obviously it wouldnt show up in the Channel list (whatever made you think it would show there?) but it should show as an available agent. Have you looked at the logs?
  • balderlokebalderloke Members Posts: 3 ✭✭
    xinutel wrote:

    I installed the musicbrainz.bundle folder to my PMS Plug-ins folder and restarted PMS but I don't see the it in my Channel list or as an available agent. What did I miss?

    regards,
    Eric


    also make sure that owner:group for files in installed bundle is set to plex:plex or whatever you have plex running under...
  • snickerssnickers Members, Plex Pass Posts: 582 Plex Pass
    edited February 2013
    hey. almost a great plugin. great to see discogs and last.fm together.
    but without Home-Theater-Backdrops or Local Media Assets (for me) it causes a really large "Unknown Artists" folder which wasn't there with last.fm only
  • EtherManEtherMan Members Posts: 63 ✭✭
    snikay wrote:

    hey. almost a great plugin. great to see discogs and last.fm together.
    but without Home-Theater-Backdrops or Local Media Assets (for me) it causes a really large "Unknown Artists" folder which wasn't there with last.fm only


    It's on its way. Im reworking the agent into a single agent (XBMC style) because of the mess that is the Plex API. I was orginally planning for a late Jan release of that, but I've gotten really busy at work due to starting our W8/2012 migration earlier than planned and that's right now scheduled to run until middle of march which means I wont have much time to do any coding until then, which means it'll probably be a late march release instead. The combined agent will be Last.FM, Discogs, Musicbrainz, HTBackdrops, Wikipedia and Local. And it will allow to do artist and album matching on any of the services, amd evem do a search diffrently for album and artist if you wish :)
  • snickerssnickers Members, Plex Pass Posts: 582 Plex Pass
    wow, that sounds really cool ! thanks for your work! really appreciate this.
    btw. how does your agents work? Does your Plugin take advantage of the original Agents? Or is it a complete rewrite?
  • EtherManEtherMan Members Posts: 63 ✭✭
    snikay wrote:

    wow, that sounds really cool ! thanks for your work! really appreciate this.
    btw. how does your agents work? Does your Plugin take advantage of the original Agents? Or is it a complete rewrite?


    All my agents are complete rewrites. IMO the current agents are all a complete mess when it comes to music.
  • snickerssnickers Members, Plex Pass Posts: 582 Plex Pass

    is the next version still planned to be released in march ? 

  • jdc0730jdc0730 Members, Plex Pass Posts: 38 Plex Pass

    Just tried out the metadata agent and had a question.  There is a large number of artists that didn't match.  In some cases, that makes sense but in a number of others there is only one exact match when I "fix incorrect match".  Regardless, there are a couple of these cases where the desired choice is not available in the list to choose.  Some examples are Asia, Bush, and dada.  

    Also, what is the recommendation for albums with multiple artists?  (e.g. Ben Harper & Charlie Musselwhite)

    No knowing out the Plex Scanner works, is it not position to use the embedded MBz ID if found?

    Thanks for the great work!

    Jeff

  • halkonhalkon Members, Plex Pass Posts: 43 Plex Pass

    Just wanted to let you know I've been following the work of this guy: http://www.onemusicapi.com/  I actually use his music organizer at http://www.blisshq.com 

    Either way once I saw that you had versions for musicbrainz and discogs, I figured this might actually benefit you.

    Just sharing nothing else. 

  • snickerssnickers Members, Plex Pass Posts: 582 Plex Pass

    Hey EtherMan, are u still planning an update? :/

    halkon, i don't think this is interesting, because it costs 150$ a month O_o

  • evievi Members, Plex Pass Posts: 50 Plex Pass

    Definitely interested in this. Thanks EtherMan

  • EtherManEtherMan Members Posts: 63 ✭✭

    Well, been a while now and while I still plan on doing this, I've halted development until the API itself is fixed. Havnt had time to check the latest release of server now but the version that was used now for a long time, was broken, for music and since no dev even so much as acknowledged the bug, I decided to halt until I atleast know it WILL be fixed and not become one of those issues that just stays there forever and ever like some other major issues (a/v sync issues, Im looking at you ;)

  • kccourierkccourier Members, Plex Pass Posts: 49 Plex Pass
    EtherMan wrote on June 15 2013, 10:10 PM: »

    Well, been a while now and while I still plan on doing this, I've halted development until the API itself is fixed. Havnt had time to check the latest release of server now but the version that was used now for a long time, was broken, for music and since no dev even so much as acknowledged the bug, I decided to halt until I atleast know it WILL be fixed and not become one of those issues that just stays there forever and ever like some other major issues (a/v sync issues, Im looking at you ;)

    Are you still in halted development mode or are you working on updating the 3 agents?  I really do hope you continue development on these agents.

    I'm not sure if the agents are not showing up on my system because I have them installed into the wrong folder or if they simply just don't work with the current PMS release.  I have them in C:\Users\myusername\AppData\Local\Plex Media Server\Plug-ins which is the same folder where all the other bundles I have installed are at so it should be the correct folder.  When I pull up the Settings>Agents>Artists or Settings>Agents>Albums they are nowhere to be found.  They also do not appear when I select Channels>View All>Directory>More...>All Available Plug-ins.

    I have Version 0.9.7.28 of PMS running on Windows 7

    Thanks in advance

  • kccourierkccourier Members, Plex Pass Posts: 49 Plex Pass

    Ok, I'm just a little braindead at the moment.  The reason they weren't showing up for me is I didn't rename them to end in .bundle after unzipping the 3 folders.  More than likely "xinutel" did exactly the same thing.  I feel so stupid...

  • kccourierkccourier Members, Plex Pass Posts: 49 Plex Pass

    WOW!!!!  I am overall very pleased with the results now that I have managed to scan my entire library using the Musicbrainz bundle..

    I'm still not sure how to fix a problem where it can't distinguish between two different albums with the same name.  One example would be Cheap Trick's 1977 debut album which keeps getting matched as the 1997 Cheap Trick release which is a completely different album.  How can I unmatch only the tracks from the '77 release to correctly match that release without unmatching the tracks from the '97 release?

«1
Sign In or Register to comment.