[Deprecated] WatchedSynchronizer (1 Viewer)

antihero05

Portal Member
January 12, 2015
9
17
Home Country
Germany Germany
Deprecated: Further development will be done under the name CentralizedDatabase

Description:

WatchedSynchronizer is a process plugin that synchronizes several informations across your MediaPortal databases. As the plugin name suggest the plugin focuses on synchronizing the watched status of your media accross several databases. 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.

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.

Currently supported databases for synchronizing:
  • MP Video database
  • MP TVseries database

Download

Source

Configuration:

The configuration is done in an simple manner where you just select the database type and specify a file (UNC is of course possible). There is no verification if the specified file matches the selected database type --> Unhandled crashes are likely on faulty configurations.

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.

This plugin has been created multiple months ago therefore I did not test it on current MediaPortal releases since my own environment is not updated to each release. I just decided to publish the plugin in case someone has a similar setup to me and is interested. Therefore I added some comments and did so.

Please be aware this is the first thing I have ever done with C# so experienced programmers might facepalm on some parts.
I added extensive (at least for me) comments so other people might get an idea of what I did.
 
Last edited:

azzuro

Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    Hallo antiHero05.
    welcome to our community,
    thank you for provide, plugin for our prefered MediaPortal front-end.

    i have few question ( only curious )
    - I don't know if you know the plugin : MPSync https://www.team-mediaportal.com/extensions/utilities/cdb-sync
    the same goal of your plugin. but i think not the same system logic.
    maybe you make your own plugin, because MPSync don't respond to what you search. .
    - Your plugin can work, with database stored on NAS ? ( db3 file and/or on SQL remote database )

    also, don't hesitate to add your source link on forum too.
     

    antihero05

    Portal Member
    January 12, 2015
    9
    17
    Home Country
    Germany Germany
    Hi azzuro.

    A brief answer to your questions:

    I just discovered MPSync some days ago. When I was searching for a solution to my problems I believe to remember it was still called cdb-sync and not available for the my media portal version. This was around the release of MediaPortal 1.6 when .net 4.0 was introduced.

    Currently it is working with db3 files. Is the use of full fledged SQL databases (e.g. MySQL) with current releases possible? This would neglect the need of synchronizing since a row based lock handling is available and no problems should occur with multiple clients on the same database.
    Or do you mean something different with SQL remote database that currently does not come to my mind?

    Best Regards,
    Max
     
    Last edited:

    azzuro

    Test Group
  • Team MediaPortal
  • May 10, 2007
    9,948
    5,617
    France - IDF
    Home Country
    France France
    thank you max for your fast reply, i'm not expert in english, so my test can be a bit hard to understand lol
    maybe you reply to my question lol
    what i mean, NAS where SQL online database, is stored and use MySQL system, store information from both MP CLient.
    and all information related to movie ( Add / Del / Watched ... ) are sync to him.
     

    antihero05

    Portal Member
    January 12, 2015
    9
    17
    Home Country
    Germany Germany
    Hi azzuro.

    Pas de problem. Mon Francais n'est pas bien aussi ;)

    Okay I try to reply the best I can:
    I have no connection with MySQL or similar systems implemented. To be honest I am not aware of a setup where the SQL online databases are replicated to an MySQL system, but might have simply missed it. Well since my plugin is only ment to synchronize meta data related to "Watched" and leaves additions or deletions unattended it would not be able to do stuff like you described.

    So as it is synchronization is only possible between SQL online databases (.db3 files). It does not matter where these database files are stored (NAS is no problem). The only requirement is that the Windows user owning the MediaPortal process is able to write with his credentials. But that's the same way it is by default.

    Best Regards,
    Max
     

    regeszter

    Retired Team Member
  • Premium Supporter
  • October 29, 2005
    5,335
    4,954
    Home Country
    Hungary Hungary
    thank you max for your fast reply, i'm not expert in english, so my test can be a bit hard to understand lol
    maybe you reply to my question lol
    what i mean, NAS where SQL online database, is stored and use MySQL system, store information from both MP CLient.
    and all information related to movie ( Add / Del / Watched ... ) are sync to him.

    Soon... ;)
     

    The_Stig

    Retired Team Member
  • Premium Supporter
  • April 5, 2005
    2,176
    428
    Thanks for that plugin. As MPSync didn't work for me I will try this gladly. Having a quite similar setup as you, antihero05

    EDIT: Could you give a few more hints on what/how to configure? Which database path do I have to set? If I have a master-htpc and a client to have to enter the folders of both database paths for Series and Videos?
     
    Last edited:

    antihero05

    Portal Member
    January 12, 2015
    9
    17
    Home Country
    Germany Germany
    Hi The_Stig,

    great name by the way :)

    Well it depends. I for example have a master database which is centrally stored. On each client I have configured both master databases (video and tvseries) to be synchronized. This is enough for me since I don't require to synchronize each clients database in realtime. I copy the master database on each start to the respective client and can live with a delayed synchronization resulting of that setup.
    If you don't want that it is also possible to configure the master database and the database of each client to be synchronized. This requires to configure the master databases and the databases of any other client for synchronization on each single client. For this setup it is necessary that the databases of the each clients are always available on a network share. Otherwise the synchronization will fail (I don't know what happens in particular since I believe did not test it or at least do not remember the result).

    Hope this helps a little for better understandig.

    Best Regards,
    Max
     

    Users who are viewing this thread

    Top Bottom