[RELEASE] script.reliableresume - Script to resume last played media
#1
This is a script that lets you continue playing a video/audio file from the position you stopped playing before. It is based on stanley87's ResumeX script which I used in a modified version for serveral years on my XBOX.
When listening to audio books I often had the problem that I get tired and just switch my HTPC off (by switching the power socket off) so I was having a hard time the next day to find the exact position where I stopped listening.
I decided to make that script a bit more flexible and to make it work on current XBMC on various platforms.

Big thanks to stanley87 for his work at this point, this script uses lots of the core functionalities from his ResumeX.

It permanently saves the current playlist and the current position in the current file to harddisk (in configurable intervals).

Maybe someone is interested and is willing to test around with it.

NOTE:
-You must run the program after the installation once to make it generate the autoexec.py. Then you have to restart XBMC before it will work.
-After changing the configuration of the script you also have to restart before the changes will take effect

How-To-Use:
-Install the script from the Settings->Addon menu
-Run it once from "Programs" (to have it configured for autoexec on startup)
-Restart XBMC
-Now the script should be running and tracking the audio files you are playing. Use the configuration dialog of the script to enable it for video too or change other parameteres
-After playing run it again from "Programs" to have it resume your last played media

This is the first version and I am quite new to python and also to xbmc scripting, so if someone has suggestions how to improve this script then please let me know. Ofc bug reports, critics and all other stuff is welcome also. Smile

script.reliableresume-0.96
Reply
#2
Thanks for this, will save me having to search back through films on the random occasions that my media center crashes.
Reply
#3
Nice to hear.
Though there seems to be a problem with it: XBMC does not shutdown anymore when this is running. Probably due to its behavior of running in an endless while(1) so there is no way to quit it gracefully.
Is there an API function to find out if the system is going to shutdown so the script can quit its while-loop and shutdown itself?
Something like if xbmc.isShuttingDown: break?

Thanks for hints!
Reply
#4
I can't get the script to work at all, I can configure it but when I go to run it No toasts are produced and if I kill xbmc and open it again media doesn't resume.
Reply
#5
Not so nice to hear. Eek
If you dont mind, I will need to ask a bunch of questions to find out whats wrong:
-dumb question: you did restart xbmc after executing the script once, dont you?
-could you check if the file autoexec.py in your userdata-folder has been created or better if it contains a line which contains something like "script.resumelast/observer.py"?
-do you get an error message when booting up xbmc saying something like "error executing observer.py"?
-could you check if there a files created in the folder userdata/addon_data/script.resumelast that are named ResumeDataA.xml and ResumeDataB.xml?
-Which OS are you using?
-Does XBMC freeze for you when shutting it down?

Thanks for testing!
Reply
#6
devkid Wrote:Nice to hear.
Though there seems to be a problem with it: XBMC does not shutdown anymore when this is running. Probably due to its behavior of running in an endless while(1) so there is no way to quit it gracefully.
Is there an API function to find out if the system is going to shutdown so the script can quit its while-loop and shutdown itself?
Something like if xbmc.isShuttingDown: break?

Thanks for hints!

I used the TraktUtilities add-on and it had simulair problems. Might want check the code on github or ask about how it was solved.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#7
Machine-Sanctum Wrote:I used the TraktUtilities add-on and it had simulair problems. Might want check the code on github or ask about how it was solved.
Big Thanks! Exactly what I needed. They use xbmc.abortRequested.
Seems not to be documented here: http://xbmc.sourceforge.net/python-docs/xbmc.html

EDIT:
Script in the download link updated. Shuts down nicely for me now...
Reply
#8
Well i'm no coder but do have basic knowledge of it. Keep an eye on the commits for isue #91 of TU.

Think the document needs updating judging from its time stamp Wink
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#9
Hell, thats REALLY old. Any idea where to find a more recent documentation? I totally miss the docs to the xbmcaddon-API for example :/

BTW Trakt is nice, I didnt even know it before.
Reply
#10
Just found out a month ago. If only had know...Sad Same for XBMC. Just using it for 4 months.
Here's something i found in the wiki:
wiki.xbmc.org/index.php?title=Python_Development
Maybe a little nudge to the dev's to update the wiki pages?

Here's a simulair script like yours. This one is currently integrated in Aeon Nox (Eden).
https://github.com/pilluli/script.video....ks.browser

It has a few bugs in it. Like the tv episode don't show their thumb. I had to edit the script to remoce the "auto-" from "auto-%s%" and now it works. Shamefully it doens't splits tv shows/ movies and other videos so these could be linked to their own menu item.
Maybe give you some ideas to combine all features into one script and hopefully get it integrated in Nox for example.
Here's a screenshot:
http://img851.imageshack.us/img851/8860/...hot185.png
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#11
Thanks for your hints. The special feature I need in the addon is that I dont have to manually stop the currently playing media to make XBMC save the last played position. I need to save it permanently so I am able to power off the XBMC device at any time using a remote controlled power socket. AFAIK XBMC supports the resume feature only for manually stopped media.

I looked through the wiki but could not find a real API documentation sadly Sad
Reply
#12
Cool, there is an addon that generates an up-to-date API docu Shocked

Also, updated this to reload configuration settings in intervals. So no more need to reboot after changing configuration.
Reply
#13
Hi Devkid.

According to the descriptionm this is *almost* the perfect script I was looking for.

do you think you could just add an option which would resume the previous playlist directly when XBMC restarts, wothout having to do any manual operation ?

one second option (for which you would also have to opt-in, as it isn't necessarily what everyone would want - would be that if the playlist did reach the end, it would start it over from the start.

this is my typical use-case:

usually, I start my htpc in the morning, as I like having music to wake up.

I can set XBMC to start one specific album at start, but it quickly gets old.

Having the last played album continuing playback or starting over would definitely be a life changer for my morning mood Smile

what do you think about it ?

-Fabio
Reply
#14
Yeah sure, I will add that. Should not be a big deal.
Reply
#15
hi. its nice addon i was thinking to implement in pi model b in openelec.
is there any way to resume slideshow like thisHuh? help me out plsss..
Reply

Logout Mark Read Team Forum Stats Members Help
[RELEASE] script.reliableresume - Script to resume last played media1