manuelm / pvr.dvbviewer

Kodi's DVBViewer client addon
GNU General Public License v2.0
5 stars 3 forks source link

Store/read recording watched state (play position) on the backend (DMS 2.1.2 or higher required) #32

Closed popy2k14 closed 6 years ago

popy2k14 commented 6 years ago

This PR adds the feature that is stores/reads the recording last played position to/from the DMS backend. So the recording watched states gets synced on all clients. DMS 2.1.2 or higher required!

Hoping this is the right repo to create the PR.

@manuelm Have thinked/sleeped about your approach (fetching all data on reading/fetching all recordings).

When i'll got you right, i'll see the following issue:

Can you please go into detail how you want to LIVE sync data with your approach?

I cant see the benefits from always syncing in the background (maybe with an unique time identifier or similar).

Please review and merge.

manuelm commented 6 years ago

@popy2k14 Can you please runtime test the latest build from https://ci.appveyor.com/project/manuelm/pvr-dvbviewer ? play position and play count of recordings should now be stored on the backend.

popy2k14 commented 6 years ago

thx a lot! Nice work! Will test at the evening nd report back.

popy2k14 commented 6 years ago

Sadly, haven't time to test, will hopefully do it this evening.

But shouldn't 'action=updatefile' be called after action write?

manuelm commented 6 years ago

No, as DMS will flush the changes on standby/shutdown.

popy2k14 commented 6 years ago

Yeah, but what if it crashes or power is lost? I am running my windows server (with DMS) 24/7 so this could be possible. I'll think that i am not alone, and this scenario should be covered.

Also on the API page of DMS they are stating that the file will just be written if there are changes. So it should be no problem to execute action=updatefile after every action=write, should'nt it?

manuelm commented 6 years ago

Flushing shouldn't be the task of the client. That's a bad design and I won't do it.

I'll ask Griga if he might flush the file every now and then.

popy2k14 commented 6 years ago

ok thx. Will let you know my test results.

manuelm commented 6 years ago

I've listed you in the changelog. Thanks for helping once again.

popy2k14 commented 6 years ago

thx for the credit!