[Plugin] CentralizedDatabase (1 Viewer)

popy

Super User
  • Team MediaPortal
  • Super User
  • July 3, 2011
    617
    141
    Country flag
    First!! thx @antihero05 for the idea and the WatchedSyncronizer plugin which is deprecated with the release of CentralizedDatabase. I have ask him for permissions to deprecated WatchedSyncronizer, and he agreed because lack of freetime to work on the plugin. Read the whole story here .


    Description of the plugin:

    CentralizedDatabase is a window plugin that synchronizes several informations across your MediaPortal databases/folders. As the plugin name suggest the plugin focuses on synchronizing the watched status of your media and folders (thumbs) accross several clients.This includes extended information like the time you stopped the playback. This is responsible for the watched percentage displayed in MediaPortal.

    This plugin is intended for setups that have a centrally stored master database and multiple clients with their own databases. It is recommended to configure the master database as an database to be synchronized from each client. If you watch some media on one of the clients the watched status gets synchronized to the master database and is available for all other clients as well. Also there is a feature "Copy at startup" which copies the database/folders on MP client start from the centralized storage to your client. So anytime you start you client all databases are immediately in sync.

    As a result it does not matter on which client you watch some media since the status is always synchronized across other databases. You keep consistent track of what you already watched and have centralized place (server) where you can add movies & series.

    Currently supported Objects for synchronizing:

    • MPVideo database
    • MPTVSeries database
    • MovingPictures database
    • Folders
    • Folders with deletions

    How it works:

    CentralizedDatabase works a little bit different as other solutions.
    It copies every configured databases & folders (thumbs...) at startup of MP from the server (central storage) to the local client. When the user watching a movie/series it listens to the following events:
    • User stopped the movie/series
    • The current movie/series has ended
    • User marking a movie/series as watched/unwatched in the GUI
    Whenever it receives such an event, it writes the nedded information (resume time, watched flag status....) back to the server database. The delay is <1 second.
    Now you can watch a movie in the living room, stop it, go to the bed room and continue watching at the same time you stopped it in the living room.

    Another benefit is, you have a central place (server) where you can administrate your series/movies (configuration tools from the plugins). The new data will be copied over to the clients on every startup (if configured).


    Here is a littel graphic which shows, what i am trying to explane :p :
    en_sync_schema.png


    Unsupported Features of Moving pictures:

    Configuration:


    The configuration is done in an simple manner where you just select the sync object type (database or folder) and specify a file/folder (UNC is of course possible). If you select "SyncFolder" as type, you also must specify an local destination directory. There is currently no verification if the specified file matches the selected database type --> Unhandled crashes are likely on faulty configurations. This will maybe addressed in the future.

    Dample Config of my clients:
    2557.png


    Background for plugin:

    The primary reason why I created the plugin was that I had problems with my environment setup. I have the need for two separate MediaPortal installations. One on my notebook and one on my server which has a beamer connected to a HDMI port and is hosting the TV Server.
    My first attempt was working with a single remote database which both installations work on. This did not work out as it happened quite often that the database went corrupt to some simultanus modifications. The next step was working with separate database which were fetched from a central master on each start of the MediaPortal client. This did work but the watched status got lost since there was no synchronization with the master.

    Since at that time no plugin provided the functionality I required I decided to create one myself. My intention was to hook on the update command executed after a playback was stopped and to send it to multiple databases. Due to my experience I also paid attention to open the databases as short as possible to prevent corruption.

    Download and Source:

    Download

    Source
     
    Last edited:

    popy

    Super User
  • Team MediaPortal
  • Super User
  • July 3, 2011
    617
    141
    Country flag
    Sorry i didnt know about this in area51.
    I have searched for a name which starts lower than "M" in abc, because my plugin must load before MovingPictures and MPTVSeries.
    This was the the name i have choosen which describes what is does and fit my needs regarding first char in name.

    pOpY
     

    popy

    Super User
  • Team MediaPortal
  • Super User
  • July 3, 2011
    617
    141
    Country flag
    What's the difference with the MPSync plugin?
    Hey HomeY (nice word combination :p)

    MPSync tries to sync the whole database with triggers.
    In my case it ended with messed databases everytime i tried it.
    Dont get me wrong, maybe i have done something wrong, or it was just a faulty setup, but it hasnt worked for me.

    CentralizedDatabase works a little bit different (see OP post, i have updated it).
    This way, the chance to get a corrupted database is very very low.

    pOpY
     

    popy

    Super User
  • Team MediaPortal
  • Super User
  • July 3, 2011
    617
    141
    Country flag
    What's the difference with the MPSync plugin?
    This plugin does not synchronize data changes on the fly, just at the start. I understand.
    Data changes: added movies, series, thumbs on the server will be syncronized at client startup of MediaPortal.
    But in my case this is no problem because i am using SSDs in every HTPC so the boot time is really really fast.
    WatchedState Changes will be synced back to the master DB on the fly.
    So the changes are ready for the next client boot ;)
    Please take a look at the graphic i have added to the OP.

    I am also thinking to support standby/resume -> so on resume the data initial datasync is done again....

    pOpY
     
    Last edited:

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,828
    6,680
    Kyiv
    Ukraine Ukraine
    Country flag
    Data changes: added movies, series, thumbs on the server will be syncronized at client startup of MediaPortal.
    This is inconvenient, when adding a new film, in MyVideo plugin, you must reboot all computers. :(

    But in my case this is no problem because i am using SSDs in every HTPC so the boot time is really really slow.
    Too much action. Ideal. Synchronize all the data as well as you sync status review. :cool:
     

    popy

    Super User
  • Team MediaPortal
  • Super User
  • July 3, 2011
    617
    141
    Country flag
    Sorry i meant: But in my case this is no problem because i am using SSDs in every HTPC so the boot time is really really fast. :p
    How do you work: Shutdown or standby and resume?
     

    ajs

    Development Group
  • Team MediaPortal
  • February 29, 2008
    11,828
    6,680
    Kyiv
    Ukraine Ukraine
    Country flag
    How do you work: Shutdown or standby and resume?
    Or shutdown, or run continuously.

    But in my case this is no problem because i am using SSDs in every HTPC so the boot time is really really fast.
    I have the same SSD, but a reboot is superfluous gesture. So while using MPSync.
     

    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 3
    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