home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Need a little help with plugin development
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="morpheus_xx" data-source="post: 1187204" data-attributes="member: 48495"><p>I suggest to use a higher level approach to load items from the media library:</p><p>While you could do raw SQL commands, you would have to consider many inbuilt concepts. An important information: the table names are not fixed: if a so called MediaAspect gets extended (and thus a new AspectID), a new database table will be created.</p><p></p><p>What you should do is to add a reference to MP2 core components (MediaLibrary) and then do a query like:</p><p><a href="https://github.com/MediaPortal/MediaPortal-2/blob/master/MediaPortal/Source/UI/FanArt/FanArtService/MediaItemThumbs.cs#L54-L80" target="_blank">https://github.com/MediaPortal/MediaPortal-2/blob/master/MediaPortal/Source/UI/FanArt/FanArtService/MediaItemThumbs.cs#L54-L80</a></p><p></p><p>This example loads thumbnail data, but you can easily include the SeriesAspect for loading (which contains Series and Episode infos).</p><p></p><p>The reason is, that the Episode information is a 1:n entry. One single file can have multiple episodes (often done by TV broadcasters, combining episodes). When loading data by IMediaLibrary, you don't need to manually take care about this.</p><p></p><p></p><p>This is included in ProviderResourceAspect.</p><p></p><p>Please take a look at the linked example above, I'm happy to provide further assistance <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /></p></blockquote><p></p>
[QUOTE="morpheus_xx, post: 1187204, member: 48495"] I suggest to use a higher level approach to load items from the media library: While you could do raw SQL commands, you would have to consider many inbuilt concepts. An important information: the table names are not fixed: if a so called MediaAspect gets extended (and thus a new AspectID), a new database table will be created. What you should do is to add a reference to MP2 core components (MediaLibrary) and then do a query like: [URL]https://github.com/MediaPortal/MediaPortal-2/blob/master/MediaPortal/Source/UI/FanArt/FanArtService/MediaItemThumbs.cs#L54-L80[/URL] This example loads thumbnail data, but you can easily include the SeriesAspect for loading (which contains Series and Episode infos). The reason is, that the Episode information is a 1:n entry. One single file can have multiple episodes (often done by TV broadcasters, combining episodes). When loading data by IMediaLibrary, you don't need to manually take care about this. This is included in ProviderResourceAspect. Please take a look at the linked example above, I'm happy to provide further assistance :) [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Need a little help with plugin development
Contact us
RSS
Top
Bottom