How best to keep Moving Pictures databases in sync across multiple clients? (1 Viewer)

mts

Portal Pro
September 2, 2007
317
25
Home Country
Germany Germany
I'm also looking for a multi-client setup.
I will download the source and have a look at it. If this *.db3 is sql-lite then it might be easy to change to the real sql-db of MP.
 

Mashenden

Portal Pro
January 13, 2006
113
3
Richmond, VA
Home Country
United States of America United States of America
Awesome application. Very useful.

2 Questions:

1) Any loose projections on when a Server/Client database setup will be incorporated (officially)? This seems to be the single biggest enhancement needed by the community (a very grateful community, I should add). Release 2 - I know, but when do you think that will be?

2) In implementing an unofficial approach where we "copy the Server dB to Client dB folders", has anyone found a way to successfully update the client dB when the client's MP is minimized to tray rather than closed each time? I minimize MP to tray to save on boot up time when users want to watch media. But this results in Moving Pics dB changes not being adopted until the client's MP is completely shut down and restarted. This presents a notable problem for me in keeping dBs syncronized.

Thank you in advance for any responses.

mashenden
 

RoChess

Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    Awesome application. Very useful.

    2 Questions:

    1) Any loose projections on when a Server/Client database setup will be incorporated (officially)? This seems to be the single biggest enhancement needed by the community (a very grateful community, I should add). Release 2 - I know, but when do you think that will be?

    2) In implementing an unofficial approach where we "copy the Server dB to Client dB folders", has anyone found a way to successfully update the client dB when the client's MP is minimized to tray rather than closed each time? I minimize MP to tray to save on boot up time when users want to watch media. But this results in Moving Pics dB changes not being adopted until the client's MP is completely shut down and restarted. This presents a notable problem for me in keeping dBs syncronized.

    Thank you in advance for any responses.

    mashenden

    For #2, you can use a batch file to verify if MediaPortal is still running, and if it is, to close it.

    Code:
    @Echo Off
    REM Close MediaPortal in a nice way first
    tasklist | find /i /c "MediaPortal.exe" &&taskkill /im "MediaPortal.exe" /t
    REM Add in a 30 second delay to allow MediaPortal to close itself
    ping 1.0 -n 1 -w 30000
    REM If MediaPortal did not close nicely then it will have to be forced (this could lead to corruption in rare situations)
    tasklist | find /i /c "MediaPortal.exe" &&goto KillForced
    goto EndBat
    
    :KillForced
    REM You could ask an "Are you sure" question to soften the impact and allow an abort
    REM For RDP use, this forced method will always be needed
    taskkill /f /im "MediaPortal.exe" /t
    
    :EndBat
     

    Mashenden

    Portal Pro
    January 13, 2006
    113
    3
    Richmond, VA
    Home Country
    United States of America United States of America
    For #2, you can use a batch file to verify if MediaPortal is still running, and if it is, to close it.

    Code:
    @Echo Off
    REM Close MediaPortal in a nice way first
    tasklist | find /i /c "MediaPortal.exe" &&taskkill /im "MediaPortal.exe" /t
    REM Add in a 30 second delay to allow MediaPortal to close itself
    ping 1.0 -n 1 -w 30000
    REM If MediaPortal did not close nicely then it will have to be forced (this could lead to corruption in rare situations)
    tasklist | find /i /c "MediaPortal.exe" &&goto KillForced
    goto EndBat
    
    :KillForced
    REM You could ask an "Are you sure" question to soften the impact and allow an abort
    REM For RDP use, this forced method will always be needed
    taskkill /f /im "MediaPortal.exe" /t
    
    :EndBat

    Interesting. I'd like to try that. How would I launch the bat file upon returning from being minimized to the system tray?
     

    RoChess

    Extension Developer
  • Premium Supporter
  • March 10, 2006
    4,434
    1,897
    I assume you have a dbase update batch script on the clients right now via task scheduler, so you add this code to that batch file. You can also relaunch MediaPortal after script finishes the dbase update.

    This code only works in a pull environment (client obtains data from server), for a push one (server forces update onto clients) you would need to use additional remote commands. Via temporary lock/flag files you can also create a push/pull hybrid situation in which the server places a temp file on the client to indicate it can update itself. The client polls for existence of this file and if it exists runs the pull update and deletes the temp file after it is done. That way you can even verify the update worked on the server side.

    PS: It might be easier to rely on a MediaPortal plugin scheduler, such as: MEDIAPORTAL - free media center - GMPS - Georgs MP Scheduler

    You can then simply schedule in a reboot at say 4am, and you modify your MediaPortal startup into a batch script that first downloads a new copy of the database from the server before it launches MediaPortal.
     

    Users who are viewing this thread

    Top Bottom