-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple "channels" with multiple daily_schedule tables and the ability to specify which one on startup #39
Comments
This is an incredible idea. I'd imagine the way to get it to work without typing in cli commands is to have some sort of external trigger - ideally, an IR Remote circuit that can catch/decode your TV remote button presses so it can change channels when your press channel + / - and loop back around like real tv. I suppose the quickest/dirtiest way I can think of is to have the setting in the config: "numberOfChannels = 5". Then I can have the app create the 5 schedules, 5 queues and look for the corresponding 5 XML files for the channels. At that point, some kind of external trigger could pass a "1" or "0" to the app telling it to change channels up/down respectively. We'll have to keep on this one! Not only would it be energy efficient & further the life of your plex hard drives, it of course would give you a lot more options for your experience, a movie channel, a cartoon-network of sorts, a channel for james bond movies only, a 90's channel, MTV channel playing music videos (as you mentioned you already do). This is a fantastic idea. Let's keep discussing it. :) |
I was thinking of grabbing a remote like this one since it's small and simple and doesn't require line-of-sight. |
Oh yeah! I just happened to quickly tap the reviews and saw it had some pretty bad ones for some reason, but yes, this is the idea! I've never intercepted usb signals in this way, definitely something to look into. :) |
Ok, just for reference and to keep this idea going strong, here is a lib I came across when briefly researching interfacing with usb via python: https://github.com/walac/pyusb. I'll try and setup a py script that listens for arguments. I'll create another repo where we can tinker with this tech (if it's not overboard). I have a feeling that this is going to be easier than you think. |
You seem pretty confident, so I pulled the trigger on that remote (for less than $10, why not). Could be a pretty exciting addition. |
Something to consider, is that this may complicate the last played episode data. If each xml is calling the same data, and a show is scheduled on two different "channels," will it advance the show one episode per time scheduled across channels? |
I suppose a quick and dirty solution is to associate an XML with a "shows" table. So as of now, the "shows" table saves the "prevEpisodeTitle" which is all there is for a "queue". So everyday the app generates a daily schedule it checks that "shows" table for the "prevEpisodeTitle". So if there is a channel two, we would just have a "shows2" table or something. So whenever the second channel tries to generate the new daily schedule it will do so using the "queue" from the "shows2" table. Unfortunately there is a lot in this already that wreaks of "legacy" code... It's fun to see the project evolve step by step, but now that we're here at this important point, I can see how things should be done *right. It's a tough call - do we keep hacking at this script or do we move PseudoChannel to Django... I suppose this a good reason to iron out all the bugs in this alpha version, and then get really nuts with the Django (beta) version. It just sucks cause this is my first Django project, and I've gotten pretty far but not nearly as far as the cli app and I get a bit frustrated at that fact. But yes, we need to figure out how to handle the independent queues for each channel. |
Yeah this might be a thing to wait on the Django port for, given the potential complexities it introduces. Edit: though my remote control did come in the mail today, will be neat once this thing can do stuff |
So, on the remote control angle. I was poking around with openbox, and it looks like it's relatively trivial to map keys to shell scripts. I've already set one up on the home button that restarts lightdm and chromium on the status screen as a test. Going to try and set up the power button to run the pseudo channel startstop script tomorrow. |
Ok cool. Yeah I spent a good amount of time revising that startstop.sh script to work as well as I could. Keep in mind you need to set the cron job to trigger to update the daily schedule if your app isn't running. I need to go back and revise that script too. If you're confident that your app is running pretty good, you can set the cron task and use the startstop script exclusively. Next step is to think about / implement multi-channel. Although an out-of-the-box way to get it working, as you mentioned is to just have multiple instances of the app in different directories. I could whip up a script that sits outside of all the channel directories and cycles through them when your remote button is pressed. This could be a nice short term solution. Tell me what you think. |
Yeah, that could be workable, maybe with two versions of the directory switching script (one for up and one for down). I know I could set up simple scripts to assign buttons to run |
Ahh, assigning "-u" to a button is a great idea too! Good stuff. Also, I've been revising the readme a bit and want to make your name more prominent in "acknowledgements" but need to figure out how other people do that. So for now I just kind of squeezed you in at the bottom in the rough draft. Furthermore, I have an issue with my new XML. I have a few time blocks in |
Cool. The readme looks good. I'd like to write an update to the FakeTV blog to point people to pseudo-channel instead of the old script, and include the remote setup, once I get it fine tuned. Speaking of setting up the remote, I am having an issue with the
|
hmm, make sure you are testing it from your terminal first. Go ahead and |
Actually, at line 69 I updated this: |
I was missing the |
Started up good with the change, but attempting to stop it doesn't appear to work.
|
Can you confirm that this is working in your terminal by hand executing the script manually? If you are jumping to your remote stuff, it is very possible that you need to |
yeah, this is running it from terminal in the folder |
Try it now. I am confused why this doesn't work for you. I thought it might be due to that initial |
Still no luck. It starts fine like this
and in
But when I run it again to stop it, I get this until I force terminate
Also, after I've run the second time, I get this Error creating play queue dialogue on the screen, though it doesn't prevent playback. |
I'm also just noticing that it looks like the script is running multiple times
Playback is starting up twice, likely because they're being triggered by one, then the other. |
Ahh, I'm getting the same errors when running the process via I think when you run |
I've been running the pseudo channel script as sudo because if I don't it errors out. I suppose there's probably a better solution though.
|
|
I have a feeling you are not currently the |
Comes back as Sorry for the delay, had to run to the store. |
Try: Also ensure that the bash file is executable: |
Just did |
So the challenge i'm hitting now is that I can't run ./startstop.sh from within openbox and trying to run the full path (even in an ssh terminal) doesn't seem to actually start the script and it gives this output even though the script isn't currently running beforehand
|
Looks like I got it working in a sort of roundabout way by creating a bash script in the home directory with So now my remote can turn the script on and off. |
Good to hear! |
So, with the addition of the immediate start of playback when the script is launched, I got the idea that with multiple daily_schedule tables in the database (called from individual xml files), and the right setup, the function could be used to set up multiple channels by triggering the script off, then on again with a different daily_schedule table. Basically allows for multiple channels without having to run more than one instance of the script or one RasPlex device.
The text was updated successfully, but these errors were encountered: