[Deprecated] WatchedSynchronizer (3 Viewers)

ajs

Development Group
  • Team MediaPortal
  • February 29, 2008
    16,062
    11,144
    Kyiv
    Home Country
    Ukraine Ukraine
    in my case the dbs was corrupted after some time and it doesnt work stable
    The latest version works quite stable and no longer corrupts the database. But she is bad syncs flags viewing.

    The folder syncronisation (thumbs & dbs) you have todo manually at boot of the htpc
    I have it all on NAS. Therefore, there is no sense in sync.

    completely sync all data in the selected dbs
    This is a very important part of the work. If WatchedSynchronizer plugin is to be, it will be fine. If media portal to work properly with a common database then this would not have been done. But alas, not all plug-ins such can.
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    @antihero05: i have started implemeneting a worker thread with an concurrent queue, but ill need some more days to finish my work -> real life is calling.
    If you want my current code, just pm me.

    pOpY
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    ok, guys.
    Here is my 0.5.4.4 test version with threaded event handling.
    So the user in the MP GUI should not be interrupted by the sync process ;)
    Running here on two clients.
    Would be nice if anybody else could test this version.

    @antihero05: in the zip is also my source code. i have no permissions on your github project.
    • Can you please review my changes and maybe commit it? (if you think they are useful :p)

    • Another question: i have added the possibility that an event will be retried in ~5 seconds (when the process function returns <0), but i havent found any sqlite return values to detect that a write wasnt successful so we can trigger the retry. Do you know such scenario or function that returns an error code on that we can trigger?

    • I have also done some tests to copy the dbs over at start of the plugin (its not included in the zip because it was unstable for me). Ill think the problem is that the window plugin (tvseries) was started first and then the watchedsynchronizer. It copied over the db from the server while the tvseries plugin was running. Another idea is that we create an additional windows plugin with the name "aWatchedSyncronizer.dll" so it gots loaded first and copies over the db before tvseries is starting. What do you think about that idea?
    pOpY
     

    Attachments

    • WatchedSynchronizer_0.5.4.4.zip
      3.7 MB

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    i have started implementing moving pictures.
    the following is done:

    • Implement initial AdditionalMovingPicturesDatabase.cs & AdditionalMovingPicturesDatabaseSQLite.cs
    • Implement Moving pictures in settings -> db will be opened at startup
    • Implement event handling for mediatype and gplayer
    Whats missing (i am no sql dev :():

    @antihero05: Can you please add me to your github project? i pm you regarding my user name.
    Ill hope its okay for you that i also coding at the plugin ;)
    Did you have any chance of looking into the sql functions (database part) of moving pictures?

    Attached an NOT READY version!!!!!!!!!
    Dont use it, moving pictures doesnt work!
    Its just for development purposes.

    thx
    pOpY
     

    Attachments

    • WatchedSynchronizer_0.5.4.5.zip
      1,000.3 KB

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Hey.

    I have made a patch for MovingPictures 1.8.0.1613 which fires the needed toggle watched event.
    Here is the binary and the patch: https://forum.team-mediaportal.com/threads/gui-toggle-watched-event.129506/#post-1123068
    I have also asked there if they could include the patch in the next version of MovingPictures.

    My development version of WatchedSyncronizer receives the toggle watchedstate event from the MovingPictures GUI ;)
    I have also implemented the internal event forwarding to the workerthread:

    Code:
    [2015-02-01 22:34:09,296] [Log    ] [MPMain   ] [DEBUG] - WatchedSynchronizer: OnMovingPicturesToggledWatched: The Watched Status for file '\\MEDIASERVER\Videos\Movies\xxxxxxxxxxxxxxxxxxxxxxxx.mkv' was toggled to 'False',
    [2015-02-01 22:34:09,327] [Log    ] [38       ] [DEBUG] - WatchedSynchronizer: WorkerThread: New event to process: EventType: 'Toggle' - dtNextCheck: '22:34:09.296 ' - MediaType: 'MovingPictures' - strFileName: '\\MEDIASERVER\Videos\Movies\xxxxxxxxxxxxxxxxxxxxxxxx.mkv' - intStopTime: '0' - bolWatched: 'False'

    So the Todo is:

    • Implement all needed sql statment functions in AdditionalMovingPicturesDatabase.cs & AdditionalMovingPicturesDatabaseSQLite.cs
    • Implement the commented out function "ProcessMovingPicturesWatchedStateEvent(evt);" in the region WorkerThread (File: WatchedSynchronizer.cs)
    I am missing SQL knowledge, can anybody support me? :rolleyes:o_Oo_O
    Attached my current working copy which includes the patched MovingPictures.dll (MovingPictures_1.8.0.1613_watchedToggle_event.zip).

    !!! AGAIN for Users which want to try it !!
    Its just for development purposes.
    The syncing of MovingPictures DOESNT work.

    pOpY
     

    Attachments

    • WatchedSynchronizer_0.5.4.5_v2.zip
      1.5 MB

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Me again ;)
    Attached is my development version 0.5.4.5 with partial MovingPictures support.
    Included is also a working mpei installer.
    There is NO need for an patched MovingPictures (thx @ltefarme).

    Changelog 0.5.4.5:
    • Partial Support for MovingPictures (Only files with one part & no DVD resumedata). Ex.: Single MKV files works with watched flag & resume time synchronization

    Todo, sync:
    • DVD resume_data
    • ResumePart for multiple files

    Would be nice if anybody can test it and report back.
    (when you set your log level to debug you see all the sql statements)

    pOpY
     

    Attachments

    • WatchedSynchronizer_0.5.4.5.zip
      5 MB

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Me again and again :p:p

    Here is version 0.5.4.6
    Included is also a working mpei installer.
    changelog:
    • Full Support for MovingPictures: Complete ResumeData will be synced. Including DVD/BD ResumeData, ResumeTime, WatchedFlag & Count. Also the Watch History gets updated on the remote DB.
    Todo for the plugin:
    • find a way and add a option to copy over the dbs from the server at start of mediaportal. i am open for input.
    The version works really good for me.
    PLease test anyone and report back, thx
    pOpY
     

    Attachments

    • WatchedSynchronizer_0.5.4.6.zip
      1.2 MB

    antihero05

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

    you are amazing. I just got back from an abroad business trip so I wasn't able to keept track of this thread.
    Presumably I won't be available over the weekend. I will have a look at your changes and also at the permissions for the Github repository next week or at the weekend (if I am at home).
    I am really impressed and happy about your efforts :)

    Sorry for the delay I am causing, just really busy at the moment.

    Thanks and Regards,
    Max
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Hey Max.

    Nice to see you back.
    No problem, take your time for real life!!!!!!

    Here is on what i am working now:

    I have found an issue with resuming a DVD in MovingPictures.
    Short issue desciption: ResumeData doesnt work on other client! Thats really strange.
    Normally single or multiflies are not affected and works like a charm, just VIDEO_TS (IFO, VOB) could not be resumed on an other client.
    Seems that gPlayer cant decode the data correctly!?
    Here i have opened a thread: https://forum.team-mediaportal.com/threads/resume-time-dvd-issue.129573/
    This is NO issue of WatchSWynconizer because when ill copy the DBs manually (with resume data in it) it works on the client which has written the data, and doesnt work on any other client.

    Next step will be the "Copy DB at Startup" feature ;)
    Hope to see you soon here.

    pOpY
     

    popy

    MP Donator
  • Premium Supporter
  • July 3, 2011
    617
    141
    Hey guys / max.

    I have worked again on the plugin.
    Attached a new Version 0.5.4.7 of the plugin.
    I have renamed it to CentralizedDatabase, the reason why please read in the changelog.
    Ill hope this is not problem for you?
    Changelog:

    • 0.5.4.7:

      !! ATTENTION !! The plugin has a new name/guid. You MUST uninstall WatchedSyncronizer first install the NEW CnetralizedDatabase and RECONFIGUREall the settings in MP Configuration !!

      * converted to an window plugin. This is needed because we must load before MPTVSeries, MovingPictures... these are all window plugins. window plugins gets loaded before process plugins.

      * renamed to CentralizedDatabase. Same reason as above.

      * New feature "Copy at startup": when ticked, the central database is copied to the client on MediaPortal startup. So everytime you start MP (boot your HTPC) the master DB (with all new movies, synced resume data) is copied to the client.
    Todo for the plugin:
    • add a function to copy thumbs from server/master to client at startup.
    • add checks/error handling when a database doesnt exists at startup of the plugin -> during development i had this case and MP was stuck at screen "Loading Plugins..."
    • Add My SQL error Handling and maybe retry an event!?
    • DVD Resume issue of Moving Pictures: https://forum.team-mediaportal.com/threads/resume-time-dvd-issue.129573/

    Have fun
    pOpY
     

    Attachments

    • CentralizedDatabase_0.5.4.7.zip
      1.3 MB
    Last edited:

    Users who are viewing this thread

    Top Bottom