[Plugin] CentralizedDatabase (1 Viewer)

popy

MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    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

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    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

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    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

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    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
    15,616
    10,543
    Kyiv
    Home Country
    Ukraine Ukraine
    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

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    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
    15,616
    10,543
    Kyiv
    Home Country
    Ukraine Ukraine
    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

    Top Bottom