Plugin Development Questions (Database Related)

Discussion in 'Plugin Development' started by Melloware, October 15, 2010.

  1. Melloware

    Melloware Portal Pro

    Joined:
    October 26, 2007
    Messages:
    83
    Likes Received:
    1
    Occupation:
    Intelliremote Developer
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    I plan on developing a MediaPortal plugin but I have some questions first... I have scoured the WIKI and found bits of information here and there but I have some questions regarding plugin development.

    1. What database is used by MediaPortal? SQLLite? SQLServer? Custom? I have seen mention of all 3 in these forums and I am quite confused on where data is actually stored?

    2. I have seen reference to SQLLite in this import and call...

    Imports MediaPortal.Music.Database



    Dim results As SQLite.NET.SQLiteResultSet

    So it is SQLLite?

    3. Is there a Database SCHEMA somewhere? I would like to see everything available to query in the database.

    4. Is Music and Videos stored in two separate databases or all in the same SQLite database?

    5. Should I be developing against MP1 or MP2?

    6. Can I build a closed source plugin that is commercially licensed and for profit or does that violate MP agreements in any way?


    Thank you in advance for any guidance you can provide!
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. SilentException
    • Team MediaPortal

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    1. You choose what type of database to use. If you're developing TVServer plugin, chances are you're gonna use SQL server already used by TVService (MySQL or MS SQL). For MediaPortal plugin, SQLite is commonly used. It would be best for you to check out sources of existing highly used plug-ins like MP-TVSeries or MovingPictures or FanartHandler.

    2. See above :)

    3. Nope AFAIK, but you can use tools like SQLiteSpy [Delphi Inspiration] to help you understand and browse existing databases (as well as their schemes).

    4. Separate. See directory in users folder All Users\Application Data\Team MediaPortal\MediaPortal\database

    5. Depends :) Perhaps both. Smart thing would be to layer the plugin so that the back end could be reused in MP2. Then, only GUI part will have to be rewritten.

    6. Not sure, perhaps someone else will be smarter to answer this :) If I had to guess, I would say no.
     
  4. Melloware

    Melloware Portal Pro

    Joined:
    October 26, 2007
    Messages:
    83
    Likes Received:
    1
    Occupation:
    Intelliremote Developer
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Thanks for your responses!

    As for my plugin it would be music related mostly.

    So when you install MediaPortal it does not install a Music database by default with a schema? Every plugin creates their own DB?

    I figured there would be some preconfigured ARTIST, ALBUM, TRACK,GENRE tables with common ways to access them all as well as query. I guess I need to look at some existing music-based plugins to figure out how they work. Any recommendations on that?
     
  5. SilentException
    • Team MediaPortal

    SilentException Retired Team Member

    Joined:
    October 27, 2008
    Messages:
    2,617
    Likes Received:
    1,125
    Gender:
    Male
    Location:
    Rijeka, Croatia
    Ratings:
    +1,129 / 0
    Home Country:
    Croatia Croatia
    I'm not sure (I haven't done fresh install in a year) but I think that after installation, database is already there. But ofcourse, it's possible to create it later on (or update) using SQL statements.

    I would say best thing to look then is MediaPortal's source :) Under WindowPlugins there is whole Music part.
     
  6. Melloware

    Melloware Portal Pro

    Joined:
    October 26, 2007
    Messages:
    83
    Likes Received:
    1
    Occupation:
    Intelliremote Developer
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    That is great advice. I appreciate the feedback at least now I have a place to look!
     
  7. Albert
    • Team MediaPortal

    Albert MP2 Developer

    Joined:
    February 18, 2008
    Messages:
    1,297
    Likes Received:
    1,125
    Gender:
    Male
    Occupation:
    Dipl.-Inform.
    Location:
    Freiburg im Breisgau, Germany
    Ratings:
    +1,130 / 1
    Home Country:
    Germany Germany
    AW: Plugin Development Questions (Database Related)

    I can only tell you about MP2.
    In MP2, we currently use an SQL server CE, but all implementations must be independent from the actual database. The database access layer abstracts very much from the actual database so that it should be possible to develop code without the knowledge about the actual database. Furthermore, if your storage requirements are not very exceptional, the MediaLibrary should still satisfy your requirements as it is very flexible and extendible.

    To answer your question if you should develop for MP1 or 2, you should know that MP1 is the CURRENT MediaPortal version which will still be the main MediaPortal version for at least another half of a year. Sometime in 2011, we'll switch to MP2, which should be usable them. So if you start developing now, probably it's the best to develop for MP2. You'll need time to work into it.

    About the licensing, as far as I understand it, if you use MP as basis for your code, you also have to open your code. But I might be wrong. Read the GPL for further information.
     
  8. Melloware

    Melloware Portal Pro

    Joined:
    October 26, 2007
    Messages:
    83
    Likes Received:
    1
    Occupation:
    Intelliremote Developer
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
  9. Mike Lowrey

    Mike Lowrey Portal Pro

    Joined:
    February 4, 2009
    Messages:
    638
    Likes Received:
    125
    Location:
    Berlin
    Ratings:
    +125 / 0
    Home Country:
    Germany Germany
    In my opinion your text about wp and gpl don't fit to the problems when developing for media portal.

    Because in this case you have a reference to the basic libraries which may cause problems.

    For more details read the following part of the wikipedia article... GNU General Public License - Wikipedia, the free encyclopedia
     
  10. Melloware

    Melloware Portal Pro

    Joined:
    October 26, 2007
    Messages:
    83
    Likes Received:
    1
    Occupation:
    Intelliremote Developer
    Ratings:
    +1 / 0
    Home Country:
    United States of America United States of America
    Mike,

    I have read those points of view on libraries/plugins and GPL which brought me to come here and ask the questions. It is still very unclear even from that Wiki article some argue that dynamically linked libraries do not count others argue all libraries count.

    In this case it would be a dynamically linked library (MP Plugin) meaning it is linked at Runtime when the main MP app scans for plugins and loads them.

    I think the Wordpress example closely resembles this situation we are referring to which is why I posted it.

    1. WordPress is a GPL app and MediaPortal is a GPL app.

    2. Both Wordpress and MediaPortal offer a plugin/extension mechanism.

    3. According to that article commercial plugins may be written for a GPL application as long as they do not get packaged WITH the GPL app nor do I distribute the GPL main app in my plugin distribution. It is purely a standalone download.

    So I think the Wordpress example is 100% identical to this situation. The only difference I see is that Wordpress is PHP and MediaPortal is C#.

    I was hoping a member of the MP development team would clarify this. The fact that the GPL is so confusing and obtuse is the reason most open source projects stay away from it.....

    From the comments of that article...

    You make a good point, but it doesn’t adress the question of whether plugins are “derivative works”. If they are, they still have to be GPL-licensed even if not distributed together with WordPress.
    #
    Hackadelic
    August 8th, 2009 at 2:45 pm

    W-Shadow, basically the main (and actually only) argument that a plugin is “derivative work” is that it is calling platform code. IMO that’s a misconception. I just commented on the topic elsewhere, so I’ll simply quote myself here: :)

    Calling WP functions is essentially executing code, not deriving from it. You build every software in the context of some knowledge, and in case of WP plugins it is the knowledge about the WP API. That doesn’t mean you derive your plugin’s functionality from that of WordPress. That would be a ridiculous statement, no matter the lines of code. It would mean that interfacing with 3rd party software is “deriving” from it. Or that coding a PDF reader from scratch is work derived from Adobe’s PDF code, just because you rely on the PDF format definition (which IS your interface in that case).

    The point is, plugins are not derivative work (except they are indeed a variation of some WP code, and are not merely interfacing with it), even if they are dependent work.

    I’m not a lawyer though…


    So I think the argument comes down to is a plugin a "derivative" work or not? My head is spinning trying to find the answer but I feel like the answer might be YES it is and therefore a commercial plugins for MediaPortal are not viable.
     
  11. rekenaar
    • Team MediaPortal

    rekenaar Retired Team Member

    Joined:
    December 17, 2006
    Messages:
    4,421
    Likes Received:
    782
    Ratings:
    +785 / 0
    Home Country:
    South Africa South Africa
    I am also not sure about the legal stuff since I have not yet study the licencing...BUT...
    To be honest, I am not sure there will be a market for a commercial MP music plugin.

    Not sure how MP2 will handle it but for MP1, you have the build-in music database. You can create your own database-views and combining with the fanart-handler to get backdrops, it is already very nice. User just have to take the first step to switch from SHARES view to a DATABASE view.

    Combine the existing functionality with the great innovative ideas from our devs and community plugin-devs, spending free time on MP as hobby, then I am just wondering if it will be profitable for you.

    Please do not see this a negative feedback. Just sharing my opinion on the facts available to me. For all I know you have lots of secrets that will proof me wrong :D

    More reading:
    https://forum.team-mediaportal.com/listen-music-99/guide-music-section-mediaportal-77404/
    fanart-handler - Project Hosting on Google Code
     
Loading...

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!