So, my next question is how to I get my show to start where I left off? I'm not convinced this issue has anything to do with my script, but maybe it's an issue with my general settings in JRiver, as I've noticed this feature has somewhat disappeared as of late, I was just blaming my script.
This is unlikely to be due to your scripting, but there is something to check.
First, the deal with resuming... In MC,
this feature is called "Bookmarking".
Here's the main thread where the rules were determined, but they are designed to be automatic in most circumstances. The rules are that when playback of any file starts:
* If
Options > General > Behavior > Resume playback using bookmarks is set to Automatic (the default), and...
* If the file in question has the [Use Bookmarking] field (tag) set to Default (as opposed to explicitly set to Yes or No), and...
* The [Media Type] of the file is
Video -or- the [Media Type] is
Audio and the [Media Sub Type] is
Podcast or
Audiobook, and...
* If the [Media Type] is Video, the duration exceeds 15 minutes (so it excludes short videos such as Music Videos and other small clips)...
Then MC uses the stored [Bookmark] value to resume play from where it was last left off. When you stop playback of a file, MC saves the bookmark, which is basically just a count of the number of milliseconds from the beginning of the file, to the Library:
* If playback ended within 96% of the end of the file, then the bookmark is cleared.
* If the playback position was less than 60 seconds into the file, then the bookmark is cleared (unless it was a DVD which are always saved, I guess)
* Otherwise, the current position is stored in the database record for the file.
So, the idea is that TV Shows, Movies, Audiobook files, and Podcasts will all auto-resume from where you left off. But short clips like music videos, and long songs like
Alice's Restaurant and
Echoes will not. When playback stops, it guesses that 96% played (they may have tweaked that percentage later, so don't quote me on it being that exactly) is pretty much "fully played" (leaving only the credits in many cases) so it clears the bookmark. Likewise, if you stop very close to the beginning of a file, that's close enough to the beginning to clear the bookmark.
However... You can modify this behavior on both a global and granular (per-file) scale.
If you change
Options > General > Behavior > Resume playback using bookmarks it can disable resuming globally, or you can set it to ask each time.
If you change the [Use Bookmarking] tag for a particular file or set of files (perhaps automatically at import time), then you can force files that otherwise wouldn't "trigger" the automatic rules above to either use or ignore bookmarking.
So, it is possible that you have disabled it globally. Maybe you got Ask turned on somehow, and then said No one time and checked the "Don't bug me again" box? Either way, it might be turned off.
It could also be that the files aren't (somehow) properly tagged as Video, though this is unlikely. It is also possible that in a whiskey-and-cold-medicine-fueled haze of some kind you selected the files and manually tagged [Use Bookmarking] to No. I can't say how likely this is (it would depend, I suppose, on the whiskey).
Lastly, for the [Bookmark] tag to get written to the database when playback stops, the copy of MC that was playing the file must have Read/Write access to the database. This should not be an issue if you are using MC standalone, or from the machine running as the Library Server. However, if MC is being used in a Client/Server setup and the client is operating in some kind of "read-only mode" for some reason (perhaps you don't have a Username/Password set in
Options > Media Network, for example) then the client copy of MC can't write the [Bookmark] tag when playback ends. So the next time it can't resume where it left off and the Bookmarks never get writeen.
If it is none of the above, then it
could be that when you stop playback by closing MC rather than hitting Stop (programatically) that the Bookmark isn't being properly set. I don't think it works this way, because I often use the X (close) button on my remote to stop playback in MC, and it would have ticked me off. I would check everything else first. Still, perhaps something is special about the way in which you are stopping playback (and perhaps something is just broken and buggy in certain circumstances).
But, the auto-resume feature certainly works, I use it regularly, and left to the defaults it works basically perfectly well for almost every case I can imagine (and it is easy enough to override any offenders as needed).
EDIT: Tweaked the above explanation to more clearly explain when bookmarks are saved to the files.