justinemter / pseudo-channel

This is a python based cli-app using the python-plex-api to control a plex-client and act like a real TV channel with show scheduling, commercial breaks, movie nights, etc. "Home-Brewed TV Channel(s) for Hackers"
GNU General Public License v3.0
130 stars 18 forks source link

Scheduled playback doesn't continue after midnight until script is restarted #57

Closed MoeFwacky closed 6 years ago

MoeFwacky commented 7 years ago

So I still have my reset time set to 5am. When watching over midnight, and in these cases the last item stopped playing before midnight and the next item is scheduled at 12:01, the scheduled after-midnight show doesn't play. But, using my remote, if I run the stop script and the manual channel script. it starts up as it would be expected to.

justinemter commented 7 years ago

hmm, this is a tough one. Do you think it may have something to with, useDailyOverlapCache? Looking over my code again it looks like I have everything set to be properly updating as per the time value you set in the configs, dailyUpdateTime. It's interesting that it works when you stop/start the channel but not when you let it run...this is why I was thinking it could have something to do with the, useDailyOverlapCache option in the config. Can you confirm that, useDailyOverlapCache is working as expected (when your channel updates at 5 and there is still media playing it will let the media finish before playing the newly scheduled item)?

I am thinking this bug may be pointing to the logic that shifts all the episodes to fill up gaps... it still doesn't explain why it works when you start/stop the channel though. Thanks man.

*Edit: remember the useDailyOverlapCache only works when the channel was already playing. If you were to start/stop the channel, the useDailyOverlapCache is disregarded. It's main purpose is to not interrupt your show or movie if you happen to be watching it during the daily update (in your case at 5:00 AM).

justinemter commented 7 years ago

You know what, as I sit here thinking about it...I think it may be due to the date. Since I am disregarding the year, month and day for all time entries, when your schedule updates at 5:00 AM on say, September 29, 2017, rather than adding new time entries from 5:00 AM the 29th to 4:59 AM the 30th, it only see's the one day. I was originally thinking this wouldn't hurt anything but I suppose it may be causing issues. I may try and fix this. Anyway, get back to me about the overlap cache thing and we'll start there.

MoeFwacky commented 7 years ago

I'll have to check the overlap cache. One of the reasons I picked 5am for reset was actually because nothing is scheduled around then. Also last night after posting this, it ended up running the 12:01 show without needing to be restarted. I'll try and set something up in the schedule though to capture what happens over reset.

justinemter commented 7 years ago

One of the reasons I picked 5am for reset was actually because nothing is scheduled around then.

This makes sense. I think you're more of a night-owl than I am as midnight was my choice. Keep an eye on it so I can problem solve if needed. I'm going to take some time this week to re-run through the enhancements/any outstanding bugs. I am very happy how my channel has been running the past few weeks, it's about time I pop the hood again and keep moving it forward.

MoeFwacky commented 7 years ago

The last couple of days it's been working as expected and not requiring a reset. I'm going to keep an eye on it and maybe go over my schedule again to see if there's something in there that's causing it.

Also, I'm getting pretty far on the setup instruction writeups for my blog. Should hopefully get those out next weekend. I'm also including a sample schedule from my movie channel to help get people started (since those are all random titles).