Need a little help with plugin development | Page 2

Discussion in 'Plugin Development' started by Kasimir9735, June 9, 2016.

  1. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    March 24, 2007
    Likes Received:
    +6,798 / 11
    Home Country:
    Germany Germany
    Show System Specs
    Nice progress (y)

    Some recommendations: you can use the exisiting generic convenience methods to access the Aspect properties, like example here:
    Code (C#):
    1.       // First check if we already have a complete match from a previous MDE
    2.       string title;
    3.       int tvDbId;
    4.       int seasonNumber;
    5.       IEnumerable<int> episodeNumbers;
    6.       if (MediaItemAspect.TryGetAttribute(extractedAspectData, MediaAspect.ATTR_TITLE, out title) &&
    7.           MediaItemAspect.TryGetAttribute(extractedAspectData, SeriesAspect.ATTR_TVDB_ID, out tvDbId) &&
    8.           MediaItemAspect.TryGetAttribute(extractedAspectData, SeriesAspect.ATTR_SEASON, out seasonNumber) &&
    9.           (episodeNumbers = extractedAspectData[SeriesAspect.ASPECT_ID].GetCollectionAttribute<int>(SeriesAspect.ATTR_EPISODE)) != null)
    For the GUI wrappers there are also implementation for each aspect (code auto generated), here. (This would match your scenario).

    Then there is also the other way around, the class SeriesInfo has a method to fill the aspects here. We could add a reverse method (aspect data to SeriesInfo class). This would help other devs as well.

    I recently modified the client side search in this commit: It's not yet merged to dev/master, but included in recent weekly builds. This is the example for loading a series by name filters.

    Regarding the other required information for your idea. You have to include more AspectIds in the media query:
    • MediaAspect: the "master data", in principle only ID, title, mimetype.
    • VideoAspect: contains video related info like resolution, video and audio formats
    • ProviderResourceAspect: contains the path for the media item
    More information can be found in the wiki: and in the code parts that deal with those aspects.

    For my local data the result is ok, the TvDbIds are (mostly) filled. This needs more checks and of course we would be happy if you contribute fixes to MP2 (y) :)
  2. Google AdSense Guest Advertisement

    to hide all adverts.
  3. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    December 17, 2010
    Likes Received:
    +3,618 / 28
    Home Country:
    Germany Germany
    Show System Specs
    In older versions of MP2 I often had this issue. But since Matroska Tags and .nfo support for series is working this never happend again. So I'm pretty sure it must be related to the online MDE somewhere.
  4. Kasimir9735

    Kasimir9735 Portal Pro

    July 19, 2010
    Likes Received:
    Wetter (Ruhr)
    +23 / 0
    Home Country:
    Germany Germany

    Yes, you're right. I've found a bug in SeriesTvDbMatcher. If there is no .nfo and no Tags and you simply have the Filename for example "American Horror Story" the following attributes are not filled: ImdbId, TvdbId and FirstAired. I've fixed this and tested it. Works now. I'm trying to submit a patch, but first have to read how to do it.
    • Like Like x 2
    • Thank You! Thank You! x 2

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.


  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!