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

strict_time="False" shows are piling up #69

Open mutto233 opened 6 years ago

mutto233 commented 6 years ago

When running the schedule generation, I am having the issue of pile up around midnight of certain shows.

When setting up my .xml file, I am careful not to put shows too close together (cartoons 30 mins apart, movies 2 hrs apart), but for some reason on certain channels the generator likes to schedule almost 5 shows at 11:30PM. If I take away approximately 2 hours of shows, this problem seems to go away however.

Is this just an issue of scheduling too many shows in a day?

justinemter commented 6 years ago

@mutto233 I haven't run into this issue.

mutto233 commented 6 years ago

@justinemter It is something that has popped up only recently as I try to actually schedule a set of channels for most of the day. I believe it is mostly due to having a lot of shows scheduled each day.

What is even weirder is running with -xml then -g you get a "get_start_time" error returned, but run it again in 5-10 minutes and there are no problems at all.

mutto233 commented 6 years ago

So I have been looking into this issue, and I think I have a lead. Looking into the calculate_start_time function, I noticed (unsurprisingly) that midnight is an issue again.

It seems like if a show intended start time and previous end time fall on opposite ends of midnight, it causes one of the variables to behave incorrectly. This causes the start time to actually just break in error, and simply repeat the previous show's start time.

There are two "stupid" fixes at present. Either just start a show right at midnight and force it to start then, OR put a REALLY long show to cross over midnight so there is no issue with the crossover. I will try to look into a fix for this when I can.

EDIT: I have actually found a pretty good fix to the problem and incorporated it into my PseudoChannel.py script. It is uploaded to my fork of the project. Would love others to test.