Need a little help with plugin development (1 Viewer)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Nice progress (y)

    Some recommendations: you can use the exisiting generic convenience methods to access the Aspect properties, like example here:
    C#:
          // First check if we already have a complete match from a previous MDE
          string title;
          int tvDbId;
          int seasonNumber;
          IEnumerable<int> episodeNumbers;
          if (MediaItemAspect.TryGetAttribute(extractedAspectData, MediaAspect.ATTR_TITLE, out title) &&
              MediaItemAspect.TryGetAttribute(extractedAspectData, SeriesAspect.ATTR_TVDB_ID, out tvDbId) &&
              MediaItemAspect.TryGetAttribute(extractedAspectData, SeriesAspect.ATTR_SEASON, out seasonNumber) &&
              (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: https://github.com/MediaPortal/Medi...cac4#diff-3b121ade264ac0615b32cfe61ef8aca2R42. 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: http://wiki.team-mediaportal.com/2_...cepts/Metadata_system/1_MediaAspects/5_Series and in the code parts that deal with those aspects.

    One last question: The results i'm getting are ok, but i was wondering why some fields are empty. Especially the TvDbID. It is always null, and that is in my case the query argument :-(
    But i think there is something wrong, because Mediaportal has imported these episodes and if i take a look in the local directories, i can see what it has downloaded from thetvdb, and there are folders with the TvDbIds, but they are missing in the database. Is this a bug in MP2 ? If so, i can try to fix that.
    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) :)
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,554
    3,936
    Lehmden
    Home Country
    Germany Germany
    Hi.
    the TvDbIds are (mostly) filled.
    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.
     

    Kasimir9735

    Portal Pro
    July 19, 2010
    36
    30
    53
    Wetter (Ruhr)
    Home Country
    Germany Germany
    Hi.
    the TvDbIds are (mostly) filled.
    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.


    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 S04E12.xxx" 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.
     

    Users who are viewing this thread

    Top Bottom