SQLiteDatabase Plugin for MP2 (1 Viewer)

MJGraf

Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,475
    1,385
    Country flag
    @morpheus_xx looks like we have to take care about our installer anyway over the next weeks. I already tried to understand a bit about the WiX toolset, but to be honest, this XML-stuff is killing me :D
    Is there any kind of a visual config tool?
     

    offbyone

    Development Group
  • Team MediaPortal
  • April 26, 2008
    3,981
    3,703
    Stuttgart
    Germany Germany
    Country flag
    There is no Visual Designer unfortunately :(
    (I have worked with WIX, but currently really limited time)
     

    breese

    Retired Team Member
  • Premium Supporter
  • July 11, 2011
    3,903
    769
    61
    Arlington Heights, Illinois
    United States of America United States of America
    Country flag
    I can confirm 2 things
    1- The Database folder is installed/created on a Fresh Install
    2- Stopping, renaming, and restarting MP2_Server recreates
    MP2-Server in it
    Config
    Log
    TheMovieDB
    TvDB
    Datastore.s3db
    Datastore.s3db-wall
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,399
    6,970
    Germany Germany
    Country flag
    I already stumbled over the "Database" subfolder before. In principle it would be the right location to store DB files.

    Only issue I see would be "migration" of former installations, as the expected folder is no longer the same.
     

    chefkoch

    Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,130
    1,630
    Dresden / Munich / Maastricht
    Germany Germany
    Hi.
    stopping MP2 Server, rename your ProgramData\Team MediaPortal\MP2-Server\ folder
    Done. And then no "Database" folder was there.
    So it would be created by installer, not by running the server only
    This is done by design here: https://github.com/MediaPortal/Medi...l/Setup/MP2-Setup/Features/Server.wxs#L31-L35
    because of:
    https://github.com/MediaPortal/Medi...aPortal/Source/Base/Server/Defaults/Paths.xml
    http://wiki.team-mediaportal.com/2_...velopment/4_Modules/Core_Services/PathManager

    If the database plugins don't use it, then these might need a change or we get rid of database subfolder.

    I prefer using the subfolder.

    Only issue I see would be "migration" of former installations, as the expected folder is no longer the same.
    For the migration: Could the database plugins check for the database subfolder first and use the other one as a fallback?
    Or if in database folder is no file, check the other path and copy /move it over?

    Or simply put it into the release news. We are in "alpha" ;) if caring too much about those things we also can call the releases final/stable.
     

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,399
    6,970
    Germany Germany
    Country flag
    Absolutely!
    But I think it is not only the InitializationCommand. We have to do two things:

    In SQLiteSettings just delete the part about locking_mode (normal is standard) so that it looks like:
    private const string DEFAULT_INITIALIZATION_COMMAND = "PRAGMA wal_autocheckpoint=32768;PRAGMA temp_store=MEMORY;";

    And in SQliteDatabase's Constructor comment out the following:
    connBuilder.JournalMode = SQLiteJournalModeEnum.Off;
    using (var connection = new SQLiteConnection(connBuilder.ToString()))
    {
    connection.Open();
    using (var command = new SQLiteCommand("PRAGMA locking_mode=EXCLUSIVE;", connection))
    command.ExecuteNonQuery();
    connection.Close();
    }
    The latter is a workaround to avoid storing the shared memory used for different connections from different processes to disk in a SHM-File, since this is not necessary in exclusive mode. But as you see it also opens an exclusive connection independent from the InitializationCommand. Just commenting it out should do the trick.

    If you want to do a new build, please feel free to make the amendments. Have to do some real live work today and am not sure, whether I find the time to do this myself today...

    Michael
    Are those changes the ones you proposed? https://github.com/MediaPortal/MediaPortal-2/commit/9f05459ae6e62fa483842fe84d85d1bc6fb7c410
    I introduced a "const USE_EXCLUSIVE_MODE" to be able to use both ways (at compile time)
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,475
    1,385
    Country flag
    Actually both, SQLCEDatabase and SQLiteDatabase only use what is stored in Paths.xml - but the value in paths.xml is wrong then :D
    Is currently is
    <Path name="DATABASE" value="&lt;DATA&gt;" />
    and if we want the database to be in a subdirectory it should be
    <Path name="DATABASE" value="&lt;DATA&gt;\Database" />
    So in general no need to change anything in the database plugins - only in paths.xml

    Or simply put it into the release news. We are in "alpha" ;) if caring too much about those things we also can call the releases final/stable.
    Completely agree with this one (y) We are still in alpha state and there must be a reason for that (the reason is not stability :D )
     

    MJGraf

    Retired Team Member
  • Premium Supporter
  • January 13, 2006
    2,475
    1,385
    Country flag
    Should work perfectly (y) Thanks!
    And also thanks for all the formatting corrections. We definitely need to put more of those into our wiki....

    I introduced a "const USE_EXCLUSIVE_MODE" to be able to use both ways (at compile time)
    Maybe I will later on change the DEFAULT_INITIALIZATION_COMMAND to always be "PRAGMA wal_autocheckpoint=32768;PRAGMA temp_store=MEMORY;" and in the respective getter depending on the value of USE_EXCLUSIVE_MODE return "locking_mode=EXCLUSIVE;" + DEFAULT_INITIALIZATION_COMMAND
    That way it should not only work at compile time but also on a running system by just changing USE_EXCLUSIVE_MODE from true to false...
     

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

    OP Similar threads Forum Replies Date
    joecrow 1.25.0 Radio Time plugin fails after Resume from Sleep with MP 1.25 Bugreports 4
    P MP2: US user, OTA - can NOT get SchedulesDirect plugin to work on MP1 or MP2 --> how do I get OTA schedule? General 5
    E aktuelle englische Forums Webseite von - Showtime Plugin v3 Plugins & Erweiterungen 4
    mrmojo666 [Tv Server Plugin ]Direct Show Video Control Plugin 0.0.0.1 for Hauppauge PVR cards MediaPortal 1 Plugins 0
    joecrow MultiShortcut Plugin (Uavailable) in DWHD skin General Support 58
    vapourEyes Building TV Plugin General Development (no feature request here!) 49
    Golf4 Nach Windows-Updates läuft TV-Plugin nicht mehr Allgemeines Support- und Diskussionsforum 0
    joecrow How about a Launcher plugin for MP1? MediaPortal 1 6
    D [solved] TVServer Plugin must be missing something. General Development (no feature request here!) 1
    framug Nouveau plugin XmlTvFR pour récupérer le guide télé français Kazer / ZguideTv (WebEPGfr) 11
    emphatic Allow remote control mapping of all plugins Improvement Suggestions 0
    D Where should plugins be located on hard drive? General Support 0
    D how to disengage from one version of a plugin to use another Newcomers Forum 0
    cbr954rr How to disable a pre-configured plugin? General 2
    mrmojo666 [Plugin]Marantz Control Plugin 0.0.0.2 MediaPortal 1 Plugins 2
    mrmojo666 beginner: trying to write a plugin, need help to catch event General Development (no feature request here!) 3
    framug [Rejected] Fix PowerScheduler plugin for MP2 single seat Submit: Code Patches 9
    doskabouter [Question] Stale plugins Developer Discussions 9
    M MP1 stops responding after Starting Plugins General Support 14
    Terra LAVFilter Plugin cannot be updated (MP1.23) MediaPortal 1 Plugins 10
    L Mediaportal 1.21 and Windows 10: user schedules de-activated when powerscheduler plugin is selected General Support 1
    C Can the XmlTv Plugin handle 600+ channels? General 3
    M Online Video Plugin V.2.32 keine Installtion unter MediaPortal 1.22 ? TV / Streaming 3
    emphatic Pictures in the cloud - would a plugin be possible for services like Google Photos MediaPortal 1 Plugins 1
    C where is the Online Videos plugin General Support 1
    Similar threads

























    Top Bottom