[Pending] Extend TVServer database types to allow SQLite via Gentle Framework (1 Viewer)

grahamd

Portal Member
March 24, 2008
6
4
United Kingdom United Kingdom
I'm scratching my own itch here, but being a long time TVServer user I would like to see if there's any interest in TVServer being extended to support SQLite as a database as well as the MySQL/SQLServer options? Is there any technical reason why that's not been done before?

I'm preparing a patch for the changes, however I'd like to know whether this is worth continuing with before I go much further.
 
Last edited:

grahamd

Portal Member
March 24, 2008
6
4
United Kingdom United Kingdom
And here's the patch. I've made this change because I think it will be valuable not to have to install a full db server just to run TVServer.

Note: I've not been able to test it fully yet as I could do with some hints on how to build MP in such a way that it resembles the standard deployment package. I will test it however as soon as I can get it up and running in that state (or learn how to run the service in debug)..

In summary, my changes are these:

Gentle.Framework

  • Changed Gentle.Provider.SQLite to use NuGet and the latest SQLite package (1.0.99)
  • Changed the PostBuild.bat to copy the correct file to the references directory under TVDatabase (and allow spaces in paths)
  • Removed the old reference to System.Data.SQLite referenced by Gentle
SetupTv
  • Uncommented the SQLite provider in the default Gentle.config so it becomes available to Gentle
  • Added a reference to Gentle.Provider.SQLite and System.Data.SQLite pointing at the TVDatabase\references directory
  • App.config: Allowed .NET 2.0 assemblies to be loaded under 4.0 (Gentle is .NET 2.0)
  • Created a create_sqlite_database.sql script to create the basic tables in a SQLite database
  • Created each of the upgrade scripts (39-61) so they work with SQLite
  • Added SQLite as a selection in the SetupDatabaseForm next to SQLServer and MySQL
  • Used the server textbox for the path to the database, and defaulted it to the same location as Gentle.config (could be made clearer)
  • Modified various locations where the ProviderType enum is referenced to add SQLite and make the associated code (test, save, upgrade) work.
TvService
  • App.config: Allowed .NET 2.0 assemblies to be loaded under 4.0 (Gentle is .NET 2.0)
  • Referenced Gentle.Provider.SQLite and System.Data.SQLite from the TVDatabase/references location
The extent of my testing so far is to start with the default Gentle.config and run SetupTv in interactive mode. It allows me to select and create a SQLite db, which is then upgraded to the latest DB schema using the scripts. I can then run TVServer in debug without errors. I need however to run the two together so that they can communicate using remoting and scan for channels for example, which I might need some help on.

Happy to answer any questions about these changes.
 

Attachments

morpheus_xx

Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,482
    7,015
    Germany Germany
    Country flag
    Thanks for your contribution! I'm afraid you did the same things as me one year before when I created the TVE3 plugin for MP2. I also needed Sqlite support and developed it in my branch:
    https://github.com/morpheusxx/MediaPortal-1/commits/FEAT_TVE3_Sqlite?page=12

    Please also notice some fixes and reworks for incompatibilities with SQLite, i.e.
    There are more commits by me in this branch, all other changes are merged from upstream (MP1 master).
     

    grahamd

    Portal Member
    March 24, 2008
    6
    4
    United Kingdom United Kingdom
    You beat me to it! Your changes look great and go further than mine have. Any reason why these have not made it into the main branch of TVE yet?
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,482
    7,015
    Germany Germany
    Country flag
    Yes, the main reason is that TVE3 is in code freeze since long time and the changes would be not compatible with the upcoming TVE3.5 (because it does use EntityFramework where SQLite is already supported).

    Our primary motivation for the changes was to bring the matured and stable TVE3 as plugin into MP2, where SQLite is the default engine. But on the other hand there was no focus on support of MP1. I.e. the TvPlugin there does a direct access to the database, which is a bad design and would lead to issues with multi-seat systems: the client would need to access local sqlite db of the server, which could be solved by UNC network shares. But sqlite over network had some issues with possible data corruptions before, so for MP1 I'd not recomment it for multi-seat setups.

    MP2 in contrast only uses UPnP for communication and no direct DB access, so this issue doesn't exists here.
     

    grahamd

    Portal Member
    March 24, 2008
    6
    4
    United Kingdom United Kingdom
    That makes sense, I completely agree about accessing SQLite over the network.

    In my very specific case, I use TVE only, and stream to VLC or similar player. I have put a website and webservice in front of it to expose it to other machines so the DB will only be accessed by the webserver.

    I'll grab some of your changes and see if I can get it working just for me, until TVE3.5 is available perhaps! Thanks
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,482
    7,015
    Germany Germany
    Country flag
    Good luck, please keep us updated about your progress!

    Btw, there is already a plugin under development for MP2 which integrates a webserver and allows streaming of media to network. @henso or @FreakyJ can you comment on the status of current development, please? Is streaming of TV already possible?

    Would this be of interest for you as well?
     

    FreakyJ

    Development Group
  • Team MediaPortal
  • July 25, 2010
    4,024
    1,420
    Germany Germany
    Country flag
    Streaming of Tv is possible with MP2Ext and by using the DLNA Server. MP2Web doesn't support it and won't support it until the streaming service gets part of mainstream MP2 or we have a pluginmanager with plugin dependency management. Same applies for all other Media items :)
    I don't know if you plan to have MP2Web as a core feature in the future or what your plan is. Basically it comes down to what you allow to go into main MP2....
     

    Users Who Are Viewing This Thread (Users: 0, Guests: 1)

    OP Similar threads Forum Replies Date
    N [Finished] MP2-803 - Delete full series doesn't work when viewing a program in the extended schedule screen MediaPortal 2 12
    H [solved] Dialogbox in Titanium Extended hat keine Zeilenmarkierung Allgemeines Support- und Diskussionsforum 9
    T How to open MP on the extended desktop? Input / Output interfaces 8
    A My HTPC+NAS setup aka extending my single seat system ;) Team Lounge 8
    E TVserver RTSP Input / Output interfaces 0
    D [solved] TVServer Plugin must be missing something. General Development (no feature request here!) 1
    Dark Eyes Updated to Windows 10, now TVServer won't work Installation, configuration support 1
    badboyxx TV card is listed as unknown in TV-server config General 4
    G MP 1.21 TVserver race condition when cant delete recording triggered by episode management General Support 0
    T How do I install the Kodi TVServer plugin General 8
    C Manual Control doesn't work anymore inside TVServer General Support 4
    I TVServer issues Installation, configuration support 2
    T Things I wish I had known setting up and first using TVServer for good reception of DVB-T Installation, configuration support 0
    toricred Using TMM, How to Stop Importer From Going to The Movie Database for Data General 1
    H MP2 database won't keep in synch with recordings General 8
    F How to reset tv recordings database General 5
    A Synchronizing client databases MediaPortal 1 Talk 10
    R Problems accessing MySQL database remotely MediaPortal 1 Talk 0
    globaldonkey Music Database Error Listen Music 1
    R [solved] Files moved to new location - Easy way to update database? My TVSeries 7
    R Files moved to different location - Easy way to update database? Moving Pictures 2
    H [solved] Video database genres, sort titles and collection thumbnails Newcomers Forum 12
    G MP1 TV Server "failed to upgrade the database" using MS Sql Server Installation, configuration support 3
    D PC rebuild & MP2 upgrade - how to preserve database and settings? General 1
    H MP1.21F video database scan, can it be scheduled to automatically run in background General Support 5
    Similar threads

























    Top Bottom