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!

Metadata agents for exported XBMC library

1246771

Comments

  • WurtzelSeppWurtzelSepp Posts: 12Members
    edited June 2012
    Hi and First n1 Work

    but ... in the TV Shows Plugin

    first it didn't work i got just the title ... so i took a closer look and i just changed

    class xbmcnfo(Agent.TV_Shows):
    name = 'XBMC TV .nfo Importer'
    primary_provider = True
    languages = [Locale.Language.English]
    >>>> languages = [Locale.Language.NoLanguage]

    and now it works fine hope this will helb anyone who isnt English using this Plugin
  • gboudreaugboudreau Posts: 72Members, Plex Pass Plex Pass

    Hi and First n1 Work

    but ... in the TV Shows Plugin

    first it didn't work i got just the title ... so i took a closer look and i just changed

    class xbmcnfo(Agent.TV_Shows):
    name = 'XBMC TV .nfo Importer'
    primary_provider = True
    languages = [Locale.Language.English]
    >>>> languages = [Locale.Language.NoLanguage]

    and now it works fine hope this will helb anyone who isnt English using this Plugin

    I changed the file at the source. The packages in the first post are now updated.
    I changed this in the Movies plugin, but I guess I forgot do to the same change in the TV Shows plugin. All if well now. Thanks.
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    Hi Guillaume,

    after several weeks of using my PLEX, I updated the server to the newest version (0.9.6.4) and added some movies. After updating the metadata, I got just crap :angry: :(

    I deleted all my installation, installed PMS and your importer in the most actual versions again and started from scratch, but I couldn't get your importer working.

    What am I doing?
    I generate a new collection and add just one folder for testing (the nfo, tbn files are properly edited (worked before - nothing changed there).

    Heres the configuration:
    PLEX-XBMC_1.JPG

    And that is what I get ;-(
    PLEX-XBMC_2.JPG

    Attached, please find all the logs. Do you have any glue what is going wrong here?
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    next try:

    I cleaned everything up again and this time, I used a different folder with another collection (which also worked before).

    Here are some screenshots:

    PLEX-XBMC_4.JPG
    PLEX-XBMC_5.JPG
    PLEX-XBMC_3.JPG


    interestingly, your log finds an ERROR:

    2012-06-22 11:17:21,720 (164c) : CRITICAL (core:337) - Exception in the update function of agent named 'XBMC .nfo Importer', called with guid 'com.plexapp.agents.xbmcnfo://tt?lang=xn' (most recent call last):
    File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 895, in _update
    agent.update(obj, media, lang)
    File "C:\Users\Administrator\AppData\Local\Plex Media Server\Plug-ins\XBMC .nfo Importer.bundle\Contents\Code\__init__.py", line 219, in update
    if fanartData:
    UnboundLocalError: local variable 'fanartData' referenced before assignment


    The relevant part in the script is:

    #(local) fanart
    if fanartData:
    metadata.art[fanartFilename] = Proxy.Media(fanartData)
    Log("++++++++++++++++++++++++")


    Is this just with me?

    I marked the two lines out and tried it again. The ERROR is gone, but the effect is the same:

    I have three movies with the same poster / Metadata (at least some of it).
    These are:

    IMAX - Bugs - Abenteuer im Regenwald
    IMAX - Deep Sea
    IMAX - Hurricane Bayou

    As you can see in the screenshot in the first spoiler, they all show up the the PMS as "IMAX: Hurrikan über Louisiana", but with the poster of Bugs

    In the log I find several ERRORS:

    2012-06-22 11:42:17,578 (17e0) : DEBUG (core:890) - No shared code to load
    2012-06-22 11:42:17,578 (188c) : CRITICAL (core:337) - Function named 'Start' couldn't be found in the current environment
    2012-06-22 11:42:17,578 (188c) : INFO (core:472) - Started plug-in
    2012-06-22 11:42:17,578 (188c) : DEBUG (socketinterface:137) - Starting socket server
    2012-06-22 11:42:17,578 (188c) : DEBUG (core:337) - Created a thread named 'start'
    2012-06-22 11:42:17,578 (188c) : INFO (socketinterface:161) - Socket server started on port 50260
    2012-06-22 11:42:17,578 (188c) : INFO (pipeinterface:28) - Entering run loop
    2012-06-22 11:42:17,578 (188c) : DEBUG (core:337) - Handling request GET /:/prefixes
    2012-06-22 11:42:17,578 (188c) : DEBUG (core:337) - Response: 200

    2012-06-22 11:42:39,950 (1504) : DEBUG (core:337) - Handling request GET /:/plugins/com.plexapp.agents.xbmcnfo/messaging/function/X0FnZW50S2l0OlVwZGF0ZU1ldGFkYXRh/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKNwpzMgp4bnM0CmxhbmdiMXM1CmZvcmNlbnMxMApwYXJlbnRHVUlEczUKTW92aWVzMTAKbWVkaWFfdHlwZXMzCjE5NnM0CmRiaWRzNDYKY29tLnBsZXhhcHAuYWdlbnRzLnhibWNuZm86Ly90dDAxOTM5MjU%40bGFuZz14bnM0Cmd1aWRzOQp0dDAxOTM5MjVzMgppZHIwCg__
    2012-06-22 11:42:39,950 (1504) : DEBUG (model:32) - Loading model with GUID com.plexapp.agents.xbmcnfo://tt0193925?lang=xn
    2012-06-22 11:42:39,950 (1504) : ERROR (model:194) - Cannot read model from C:\Users\Administrator\AppData\Local\Plex Media Server\Metadata\Movies\e\d94e05fd034930d6c7693706de540b595367e13.bundle\Contents\com.plexapp.agents.xbmcnfo
    2012-06-22 11:42:39,950 (1504) : DEBUG (core:337) - Requesting 'http://127.0.0.1:32400/library/metadata/196/tree'
    2012-06-22 11:42:39,964 (1504) : INFO (core:337) - Update called for Movie with id = 196

    but interestingly the last error is not just related to the three wrong movies


    Attached, please find the following files:
    The whole log
    The NFOs of the three wrong movies + a working one (IMAX Extreme)
    The XML download of "<IP-PMS>:32400/library/sections/11/all"

    Within this last XML there you can see, that the Metadata of one of the wrong movies is totally crap:

    <Video ratingKey="189" key="/library/metadata/189" studio="Eurovideo Bildprogramm GmbH" type="movie" title="IMAX: Hurrikan über Louisiana" originalTitle="Hurricane on the Bayou" contentRating="o.A." summary="Der Film zeigt jenseits aller Schlagzeilen das Herz von Louisiana – vor, während und nach den überraschenden Zerstörungen durch den Hurrikan Katrina. Begeben Sie sich gemeinsam mit den Musiklegenden Fats Domino, Aaron Neville, Dr. John u. v. a. auf eine musikalische Reise durch die lebenswichtigen Sumpfgebiete und fühlen Sie den Puls von New Orleans." rating="6" year="2008" thumb="/library/metadata/189/thumb?t=1340358168" art="/library/metadata/189/art?t=1340358168" duration="2520000" originallyAvailableAt="2008-01-01" addedAt="1340358133" updatedAt="1340358168">
    <Media id="189" duration="2402400" bitrate="10577" width="1920" height="1080" aspectRatio="1.78" audioChannels="6" audioCodec="dca" videoCodec="h264" videoResolution="1080" container="mkv" videoFrameRate="24p"><Part key="/library/parts/189/file.mkv" duration="2402400" file="F:\Videos\Collections\IMAX\IMAX - Bugs - Abenteuer im Regenwald\IMAX - Bugs - Abenteuer im Regenwald.mkv" size="3176552847" container="mkv"/></Media>
    <Genre tag="Dokumentation"/>
    <Director tag="Greg MacGillivray"/>
    <Country tag="USA"/>
    <Role tag="Bear Badeaux"/>
    <Role tag="Tab Benoit"/>
    <Role tag="Chubby Carrier"/>
    </Video>



    It seems, that there is anything totally going wrong here. I couldn't see any problem or difference in the NFOs.

    It would be really really great, if you could help

    Thanks in advance

    myhtpc
  • gboudreaugboudreau Posts: 72Members, Plex Pass Plex Pass
    edited June 2012
    Try to use the desktop (not web) Media Manager, and in the Metadata Agents Settings (the cogwheel in the toolbar at the top), enable Local Media Assets, and move it above the .nfo importer:

    Screen%20Shot%202012-06-24%20at%2011.22.16%20.png
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    I use the Windows PMS and unfortunately, there isn't a desktop manager yet.

    Within the item XBMC nfo. importer in the scrappe rlisting, I just habe your scapper, nothing else.
  • gboudreaugboudreau Posts: 72Members, Plex Pass Plex Pass
    edited June 2012
    myhtpc wrote:

    I use the Windows PMS and unfortunately, there isn't a desktop manager yet.

    Within the item XBMC nfo. importer in the scrappe rlisting, I just habe your scapper, nothing else.

    That's the problem. The Local Media Assets option needs to be enabled. I don't know why it doesn't appear in the web options and it does in the native client.

    I think you can shut down your Plex server, change a XML file, and restart it to have the Local Media Assets option enabled for my .nfo importer.

    Look for this file (I don't know where on Windows): .../Plug-in Support/Metadata Combination/com.plexapp.agents.xbmcnfo/Movies.xml
    Here's what I have in mine:

    &lt;?xml version='1.0' encoding='utf8'?&gt;
    &lt;combine class="Movie"&gt;
      &lt;sources&gt;
        &lt;agent&gt;com.plexapp.agents.localmedia&lt;/agent&gt;
        &lt;agent&gt;com.plexapp.agents.xbmcnfo&lt;/agent&gt;
      &lt;/sources&gt;
    &lt;/combine&gt;
    

    Create the com.plexapp.agents.xbmcnfo folder and Movies.xml file if they don't exist.
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    thanks for your input. Will check Tomorrow, as I am not at my PC.

    Keep you updated Tomorrow.
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    after 4 hours of searching, testing, reinstalling and almost shortly before throwing my server out of the window, I identified the problem - It's the IMDB-ID!

    In the second test-series, the three movies which didn't work, had a "tt" in the id.field:

    &lt;watched&gt;False&lt;/watched&gt;
         &lt;id&gt;tt&lt;/id&gt;
         &lt;genre&gt;Dokumentation&lt;/genre&gt;
    


    Your script is generating a media.id from this field

    # IMDB id
    try: media.id = nfoXML.xpath('./id')[0].text
    except: pass
    


    which caused the problem as all movies got the same media.id

    I marked the two lines out and now it works ;-)

    Would it be possible to modify/enhance this section in a way, that "tt" will be ignored (like if ... <> "tt", then ...).
    Sorry, but I have no glue about python to write this code for myself;-(

    All the Best

    myhtpc
  • gboudreaugboudreau Posts: 72Members, Plex Pass Plex Pass
    myhtpc wrote:

    after 4 hours of searching, testing, reinstalling and almost shortly before throwing my server out of the window, I identified the problem - It's the IMDB-ID!

    In the second test-series, the three movies which didn't work, had a "tt" in the id.field:

    &lt;watched&gt;False&lt;/watched&gt;
         &lt;id&gt;tt&lt;/id&gt;
         &lt;genre&gt;Dokumentation&lt;/genre&gt;
    


    Your script is generating a media.id from this field

    # IMDB id
    try: media.id = nfoXML.xpath('./id')[0].text
    except: pass
    


    which caused the problem as all movies got the same media.id

    I marked the two lines out and now it works ;-)

    Would it be possible to modify/enhance this section in a way, that "tt" will be ignored (like if ... <> "tt", then ...).
    Sorry, but I have no glue about python to write this code for myself;-(

    All the Best

    myhtpc

    Just committed a fix. Re-download to get it.
    Also fixed the fanartData & posterData problem.
  • myhtpcmyhtpc Posts: 96Members, Plex Pass Plex Pass
    Guillaume Boudreau you rock.

    All works fine now ;-)
  • mklinkermklinker Posts: 2Members, Plex Pass Plex Pass
    First off, thanks for all the work you've already put into this project; without it I'm not sure I'd be using Plex right now. Unfortunately I'm stuck running PMS on a windows box right now and I believe my main problem is not being able to enable the Local Media Assets scanner for the xbmcnfo agent. I can't even get it to show up at all, I only have a disabled, checked option for the xbmc nfo scanner. Everything works great in the getting the metadata out of the nfo file, my problem is with the poster art. I have placed dvd cover art in my file structure but whenever I scan a directory the wide banners are displayed instead.

    I have confirmed that everything works fine with the Mac desktop version of PMS by installing the server onto my macbook and scanning in the same directory. Once I had enabled the local media assets everything worked great, the nfo data was read and my local pictures were displayed. I know this may be outside the scope of the plugin developer, but do you have any more hints on how to enable this scanner on the Windows/Web version of PMS, with both Movies and TV Shows as well.

    Any help would be appreciated, and thanks again for all you've already contributed.
  • gboudreaugboudreau Posts: 72Members, Plex Pass Plex Pass
    mklinker wrote:

    First off, thanks for all the work you've already put into this project; without it I'm not sure I'd be using Plex right now. Unfortunately I'm stuck running PMS on a windows box right now and I believe my main problem is not being able to enable the Local Media Assets scanner for the xbmcnfo agent. I can't even get it to show up at all, I only have a disabled, checked option for the xbmc nfo scanner. Everything works great in the getting the metadata out of the nfo file, my problem is with the poster art. I have placed dvd cover art in my file structure but whenever I scan a directory the wide banners are displayed instead.

    I have confirmed that everything works fine with the Mac desktop version of PMS by installing the server onto my macbook and scanning in the same directory. Once I had enabled the local media assets everything worked great, the nfo data was read and my local pictures were displayed. I know this may be outside the scope of the plugin developer, but do you have any more hints on how to enable this scanner on the Windows/Web version of PMS, with both Movies and TV Shows as well.

    Any help would be appreciated, and thanks again for all you've already contributed.

    See #69 above on how to manually edit a XML (text) file to include the Local Media Assets option.
    Let me know where you found that file, and it you had to create the file and folder (if they existed or not); I'll update the instructions in my first post following your feedback.
  • mklinkermklinker Posts: 2Members, Plex Pass Plex Pass
    edited June 2012

    See #69 above on how to manually edit a XML (text) file to include the Local Media Assets option.
    Let me know where you found that file, and it you had to create the file and folder (if they existed or not); I'll update the instructions in my first post following your feedback.


    Ahh, sorry for not being clear on that. I did follow the instructions, even tried the file supplied by another user, but still no luck. I did have to create the directory as well as the file. The path is (Win7):

    C:\Users\<username>\AppData\Local\Plex Media Server\Plug-In Support\Metadata Combination\

    and the contents of file 'Movies.xml' is as follows:

    &lt;?xml version='1.0' encoding='utf8'?&gt;
    &lt;combine class="Movie"&gt;
      &lt;sources&gt;
    	&lt;agent&gt;com.plexapp.agents.localmedia&lt;/agent&gt;
            &lt;agent&gt;com.plexapp.agents.xbmcnfo&lt;/agent&gt;
      &lt;/sources&gt;
    &lt;/combine&gt;
    



    One thing, and correct me because I'm guessing, this would only impact the Movie scanner, so part of my question is; even if/when this works correctly for movies, how would I go about doing the same thing for TV Shows?

    Thanks again for all the help, it's much appreciated!
  • peterwemmpeterwemm Posts: 18Members, Plex Pass Plex Pass
    I think I may be able to shed some light on the subject.

    If you look at:
    Library/Application Support/Plex Media Server/Plug-ins/LocalMedia.bundle/Contents/Code/__init__.py
    (or its equivalent on windows, C:\Users\<you>\AppData\Local\Plex Media Server\Plug-ins\...)

    you will find two troubling lines:
    class localMediaMovie(Agent.Movies):
      name = 'Local Media Assets (Movies)'
    ...
      contributes_to = ['com.plexapp.agents.imdb', 'com.plexapp.agents.none']
    


    and

    class localMediaTV(Agent.TV_Shows):
      name = 'Local Media Assets (TV)'
    ...
      contributes_to = ['com.plexapp.agents.thetvdb', 'com.plexapp.agents.none']
    


    In a nutshell, it won't send contribute metadata to the xbmc import method any more. Nothing you do to Movies.xml or TV_Shows.xml is going to connect the two any more and "Local" will never appear. Presumably something has changed in later versions of Plex, and the metadata graph is built dynamically now.

    On my copy, I changed the first so that:
      contributes_to = ['com.plexapp.agents.imdb', 'com.plexapp.agents.xbmcnfo', 'com.plexapp.agents.none']
    


    and the second:
      contributes_to = ['com.plexapp.agents.thetvdb', 'com.plexapp.agents.xbmcnfotv', 'com.plexapp.agents.none']
    


    With this change I was able to see the "Local Media(TV)" and "Local Media(Movies)" on the preferences dialog for the metadata. You can check the box and make sure they're moved above XBMC.

    Repeat.. the change was to LocalMedia.bundle and not the xbmc agent plugins!

    My main interest is to avoid a duplicate thetvdb.com lookup for a large media library. I already have a complete set of local metadata so it's wasteful to have Plex re-query and download the data again. Particularly when thetvdb.com is melting or having serious issues.

    I can tell that it's working because of differences in the gathered metadata. eg: no paragraph breaks in descriptive text or missing genre/rating data. My XMBC source data is missing season thumbnails for some shows only, and they don't show up when imported to plex.

    I'm not entirely sure if that's an 'export to xbmc' issue or something else. I'm looking into it.
  • WurtzelSeppWurtzelSepp Posts: 12Members
    edited July 2012
    hi

    first again tx 4 the awsum work

    i got a second folder with series in it sometimes same series with an other season
    i am trying to scann the mediqa but i get




    INFO (logkit:16) - X:...\ALF\Season01\ALF.S01E01.Hallo, da bin ich.avi
    : CRITICAL (core:541) - Exception in the search function of agent named 'XBMC TV .nfo Importer', called with keyword arguments {'openSubtitlesHash': 'd347dd11dbe2d402', 'episode': '24', 'episodic': '1', 'show': 'Alf', 'season': '3', 'filename': 'X:%...5CALF%2ES03E24%2EDer%20Tramp%2Eavi', 'plexHash': '81c9...4fc0b60623', 'duration': '13...728', 'id': '9960'} (most recent call last):
    File "C:...\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 918, in _search
    agent.search(results, media, lang)
    File "C:...\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py", line 25, in search
    path = os.path.dirname(path1)
    AttributeError: 'module' object has no attribute 'path'


    the example series isnt double or but gives an error and i cant figure out why cause in info he says he got the path and then not (line 25)?!
    pleas help me

    tx Sepp
  • gboudreaugboudreau Posts: 72Members, Plex Pass Plex Pass

    hi

    first again tx 4 the awsum work

    i got a second folder with series in it sometimes same series with an other season
    i am trying to scann the mediqa but i get

    INFO (logkit:16) - X:...\ALF\Season01\ALF.S01E01.Hallo, da bin ich.avi
    : CRITICAL (core:541) - Exception in the search function of agent named 'XBMC TV .nfo Importer', called with keyword arguments {'openSubtitlesHash': 'd347dd11dbe2d402', 'episode': '24', 'episodic': '1', 'show': 'Alf', 'season': '3', 'filename': 'X:%...5CALF%2ES03E24%2EDer%20Tramp%2Eavi', 'plexHash': '81c9...4fc0b60623', 'duration': '13...728', 'id': '9960'} (most recent call last):
    File "C:...\Plex Media Server\Plug-ins\Framework.bundle\Contents\Resources\Versions\2\Python\Framework\api\agentkit.py", line 918, in _search
    agent.search(results, media, lang)
    File "C:...\Plex Media Server\Plug-ins\XBMCnfoTV.bundle\Contents\Code\__init__.py", line 25, in search
    path = os.path.dirname(path1)
    AttributeError: 'module' object has no attribute 'path'

    the example series isnt double or but gives an error and i cant figure out why cause in info he says he got the path and then not (line 25)?!
    pleas help me

    tx Sepp

    That error seems to point to a problem with your Python... It's saying that os.path doesn't exists... which isn't right.

    That line didn't change since the very first version of the plugin, so I don't see why it would have worked before, and wouldn't work now.
    There's also no reason why this would work in a folder, and not in another. os.path exists or it doesn't; it doesn't exist just sometimes!
    Maybe you ought to post this error in a new post, for developers to look at.
    Maybe a new thread titled "os.path.dirname call returns AttributeError: 'module' object has no attribute 'path'".
    Elan (or another dev?) might be able to chip in with an idea why that could happen...
  • WurtzelSeppWurtzelSepp Posts: 12Members
    Hi again Thanks for ur answer

    so i restarted reinstalled phyton ....

    nothing worked kicked old ones out of the lib updated to the newest beta nothing

    finaly i erased all of plex reinstalled it and now it scans and seems to work

    i dont realy understand why or the problem cause i have taken the phytonconsole and ... tryed the code he wanted to execute and it worked but so it seems solved

    tip: u can create an symlink to get ur plex database on an other haddrive ....
  • WurtzelSeppWurtzelSepp Posts: 12Members
    ok scan complete now everything seems to work exept : the tv show season pictures aren't displayed all episodes searies pics are working well but the other dont

    someone with the same problem ??? i am using plex 9.6.5

    tx seppl
  • TheLexusTheLexus Posts: 28Members, Plex Pass
    I run into the same problems with xmbcnfo.

    I tried to modify the source of LocalMedia.bundle and to add the Movies.xml file but i cannot get the LocalMedia Checkbox at the web media manager settings.
Sign In or Register to comment.