- March 24, 2007
- 12,073
- 7,459
- Home Country
- Germany
- Moderator
- #11
Nice progress
Some recommendations: you can use the exisiting generic convenience methods to access the Aspect properties, like example here:
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:
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
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 MP2One 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.