As I mentioned earlier, I found Interleaving to be quite limited and felt that it could be expanded to include a little more functionality. I inquired about the logistics of enabling the interleaving of more than one episode at a time from another channel, as it would have helped achieve a specific programming order I was attempting. The only useful interaction on the subject I received was from Blazin912, that dude is good people.
Anyway, I finally had the time to sit down and look up the proper Python syntax for a FOR loop, and shortly after that I had an interleaving function that was far more versatile than it had been previously.
Rules.py Special L.I.A.T Edition
I've added two options to the Interleave rules. "Play # Episodes" Allows you to interleave multiple episodes from the channel being interleaved, instead of being restricted to interleaving one episode at a time.
Previous function:
(assuming interleaving ch.2 into ch.1)
Code:
Min = 1 / Max = 1 : 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Min = 2 / Max = 2 : 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2
Min = 3 / Max = 3 : 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 2
New function:
Code:
Min = 1 / Max = 1 / Episodes = 1: 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Min = 1 / Max = 1 / Episodes = 2: 1, 2, 2, 1, 2, 2, 1, 2, 2, 1, 2, 2
Min = 3 / Max = 3 / Episodes = 2: 1, 1, 1, 2, 2, 1, 1, 1, 2, 2, 1, 1, 1, 2, 2
I have also added "Starting Position" option. This changes where the channel starts interleaving. A value of "1" (default) acts the same as current functionality. Beginning interleaving AFTER the first episode of the base channel. A value of "0" will begin interleaving BEFORE the first episode of the base channel.
Previous Function:
Code:
Min = 1 / Max = 1 : 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
New Function:
Code:
Min = 1 / Max = 1 / Episodes = 1 / Start = 1: 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Min = 1 / Max = 1 / Episodes = 1 / Start = 0: 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1
As usual, anyone can use it at their own risk. I assume no liability if it borks up your system. I made this for my means, and to the best of my knowledge. There wasn't a lot changed (I literally only added 2 variables, the necessary info to initialize them, and a FOR loop) but i'm not a Python dev, so there may be more elegant ways of doing this.
I just thought it these additions might have some value to others as well. If you find this causes any bugs, you can let me know. I mean. It'd be cool to know, but I almost positively won't know or care to look into fixing it (again, not a py dev). I haven't had any problems with it so far though, and it is behaving exactly as I expect it to.