2010-07-25, 20:34
So I'm writing a script to resume an audio or video playlist from roughly where it left off, even if XBMC is shut off without warning. This is quite useful for the Xbox I mounted in my car. I actually already have the script working, but since I'm new to the community, I don't know a few things.
My script saves the currently playing playlist, file, and position to a data file, sleeps for 10 seconds, then repeats. When XBMC is started, it checks the saved info, puts it all into a new playlist, starts playing from the last saved position, then starts saving the info again.
My questions are these:
1) Where is a good place to save the data? Right now I have it going to Q:\scripts, but maybe it would be better to put my saved data in Q:\UserData\? Maybe another place?
2) My script is running constantly (though it should only be using CPU time every 10 seconds or so). Is this considered an OK way to do things? If not, how could I set up my script so that it runs on a very regular schedule?
My script saves the currently playing playlist, file, and position to a data file, sleeps for 10 seconds, then repeats. When XBMC is started, it checks the saved info, puts it all into a new playlist, starts playing from the last saved position, then starts saving the info again.
My questions are these:
1) Where is a good place to save the data? Right now I have it going to Q:\scripts, but maybe it would be better to put my saved data in Q:\UserData\? Maybe another place?
2) My script is running constantly (though it should only be using CPU time every 10 seconds or so). Is this considered an OK way to do things? If not, how could I set up my script so that it runs on a very regular schedule?