Kodi Community Forum

Full Version: Kodi Playback Resumer (Matrix+ , v2.0.1+)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
(Continues from: https://forum.kodi.tv/showthread.php?tid...&page=last)

As of June 2020 I have taken over up-keep of this addon, and it is now in the Kodi Matrix (and beyond) repository. 
Thanks to bradvido88 for the original work, and to enen92 on guiding the transition to Matrix/Python 3.


A simple Kodi addon service to:
 
  1. Periodically update the restore point on a file as you are watching it (period is configurable, default is every 30 seconds) - so that in the event of a crash or playback error, you don't lose your progress.
  2. If Kodi crashes, or is manually shutdown whilst actually playing a file, can auto-resume playback of that file from the correct position, on next start-up
  3. Can be set up to play a random video at start-up

Available from the master Kodi Repository (Matrix onwards).
Source on Github: https://github.com/bossanova808/script.s...ackresumer

Change log:

2020-06-23 - Updated for Kodi Matrix, Python 3, and minor big fixes etc.
Anyone actually using this?

I have mostly completed a re-write into modern, modular Python.  But along the way I have seen some weird behaviour with Matrix and resume points that I can't track down.  Basically, I have seen resume points either wya back or way forward in the file being made.  I can't see why from the logs, though, as everything indicates the (simple) JSON being sent to Kodi to set these point is correct, the time in seconds supplied is correct, and Kodi returns OK for these queries.  So I can't catch it in the act...

I am not sure if these issues are even coming from this add-on, or...where? 

But is anyone is using it (other than me!) - be good to get some feedback.
(2021-03-16, 03:28)bossanova808 Wrote: [ -> ]Anyone actually using this?

I have mostly completed a re-write into modern, modular Python.  But along the way I have seen some weird behaviour with Matrix and resume points that I can't track down.  Basically, I have seen resume points either wya back or way forward in the file being made.  I can't see why from the logs, though, as everything indicates the (simple) JSON being sent to Kodi to set these point is correct, the time in seconds supplied is correct, and Kodi returns OK for these queries.  So I can't catch it in the act...

I am not sure if these issues are even coming from this add-on, or...where? 

But is anyone is using it (other than me!) - be good to get some feedback.

Hi @bossanova808 ,

I´m trying to use this script in my TVBOX (Android) to install in my van.
When opens the Kodi, an error is displayed and needs to see the logs, but I´m trying to find it.
Not much I can do without that log, sorry.  Maybe you can use one do the Kodi debug load uploading addons to post it somewhere?
I would like to give it a try to replace my personal addon from here which I would have to adapt for v19:
https://forum.kodi.tv/showthread.php?tid=109310

But I now realized this addon does only work for videos, right? I am mainly using this resume function for audio books so I am afraid this is not for me. If audio would be supported also it would be nice! Smile
Hm I realized it is working differently than what I was expecting (resume points).
Thank you for this, I was using an old version but was always problematic with really off resume points and only seemed to work on tv shows. and on movies it would replay but always start at beginning but just movies...suddenly doesnt work at all. 

Just trying this now but getting this:
Quote:      Traceback (most recent call last):
                                              File "/storage/.kodi/addons/script.service.playbackresumer/default.py", line 442, in <module>
                                                resumedPlayback = resumeIfWasPlaying()
                                              File "/storage/.kodi/addons/script.service.playbackresumer/default.py", line 237, in resumeIfWasPlaying
                                                resumePoint = float(f.read())
                                            ValueError: could not convert string to float:
                                            -->End of Python script error report<--
I've just finished a big re-write of another addon (OzWeather), and will be looking at this one soon.  The one your are using is just a straight port to Python3...As I recall, since then, I've done a pretty substantial re-write (as the inherited code was pretty awful).  But in early, pre-release days with Matrix I saw some odd behaviour so I paused there as I wanted to wait for the general Matrix release, then got caught up in other things.

My current plan is to return to that re-write, and strip it back to its core (jsut saving resume points every X seconds in case of crashes) - and get rid of some of the other stuff like resuming plyaback on startup etc.  I might add that back once the core part is working well again.

I will probably post a test version here first for folks to try out.

However, it is school holidays here, and our whole country is in sporadic lockdowns (Australia) - so I am not 100% sure on the timing yet, depends how much time around the edges of work I can find...
Ok if anyone is wanting to try the re-written version of this addon, you can get a zip here: https://www.dropbox.com/s/8jk0lyts7h9il1...r.zip?dl=0

Would be good to get some feedback on it before I submit it to the Kodi devs as it has been completely re-written really.

(my advice would be to also delete the addon settings folder to 'start fresh' - i.e. delete the folder: addon_data/script.service.playbackresumer)
Well, the above is working well for me so I have submitted it to the Kodi Gods as v2.0.2 of Kodi Playback Resumer.
Hi @bossanova808,

first of all I want to to thank your for your effort continuing the development of this addon.
I started trying out Kodi a few days ago and installed it on my FireTv 4k. I want to use it for sleeping in at the evening, so I set a timer on my TV for shutting down.
Unfortunately Kodi itself only tracks the playback state, when I first stop the video and then power it off.
So I wanted to try out Playback resumer as it promises saving the playback state every few seconds.
Sadly it is not working.

Looking at the logs I found these lines of which think they could be the problem: https://paste.kodi.tv/yosoqorota

I hope you could fix this or tell me what I have to do.
(2021-07-29, 18:58)NullVideoException Wrote: [ -> ]Looking at the logs I found these lines of which think they could be the problem: https://paste.kodi.tv/yosoqorota

Here I've found some more interesting information: https://paste.kodi.tv/wuwaqajika
(2021-07-29, 19:11)NullVideoException Wrote: [ -> ]
(2021-07-29, 18:58)NullVideoException Wrote: [ -> ]Looking at the logs I found these lines of which think they could be the problem: https://paste.kodi.tv/yosoqorota

Here I've found some more interesting information: https://paste.kodi.tv/wuwaqajika

Update: I got it working. It was a mistake by me with with local NFO files.
After reading the logs, the source code (which is very clean and readable) and the JSON-RPC API, I did some googling and found the error.
I've downloaded a playlist on Youtube and wanted to import it as TV Show with multiple episodes. So I wrote a small script for creating all the NFO files and didn't saw, that the <uniqueid> tag is required for the tvshow.nfo.
The sorting in this documentation is a bit weird as two required fields are at the top and <uniqueid> is almost at the bottom of the list.

@Any Moderator: Maybe someone can merge my posts for a clean topic.
Glad you worked it out.  Next time just post a full debug log, as it would have been easy to see the issue with that.

It probably shouldn't raise an exception even in that case, though, so I'll look into improving that.

(Perhaps explore an nfo creating tool like TinyMediaManager or similar, makes that process a lot simpler and less error prone...)
I Have been trying this add on and I was wondering if it works to resume a DVD .ISO file?  So far I haven't been able to get it to work with one.

Thanks,
Pages: 1 2