Closed irodimus closed 6 years ago
Thanks irodimus. I don't actually have multi-channel setup so cannot test this at the moment, @MoeFwacky
Also, what did you change so I can update the old channelup/channeldown scripts to work with more than 9 channels? Unless I misunderstood you.
I changed
# Scan the dir to see how many channels there are, store them in an arr.
CHANNEL_DIR_ARR=( $(find . -maxdepth 1 -type d -name '*'"$CHANNEL_DIR_INCREMENT_SYMBOL"'[[:digit:]] -printf "%P\n") )
to
# Scan the dir to see how many channels there are, store them in an arr.
CHANNEL_DIR_ARR=( $(find . -maxdepth 1 -type d -name '*'"$CHANNEL_DIR_INCREMENT_SYMBOL"'*' -printf "%P\n") )
I replaced '[[:digit:]]' with '*' since it was still matching directories that included the "_". I'm not sure why the original code did not find any channel directories past 1-9. I had to make the same change to the updatechannels.sh script to update the databases.
Is there plans to restructure the project to have PseudoChannel use one database when setting up multiple channels instead of as many channels as there are? It would make for easier and faster updating.
Edit: After reading your most recent commits to the README file, I now understand why each channel currently requires it's own DB.
This is great! Thanks for that. I'll make the updates to the other scripts as well.
Is there plans to restructure the project to have PseudoChannel use one database when setting up multiple channels instead of as many channels as there are? It would make for easier and faster updating.
Yes, that was Marks original idea, but setting it up this way was just out-of-the-box more or less. I did write a bash script that you can program to a remote button that will run -u
on every channel. So if you add new media to your Plex lib, you can trigger that script and it will just asynchronously step through and update all 12 databases for your 12 channels... not ideal as it will take a long time especially on a pi but it should do the trick. That script needs some testing but I remember it worked on the few channels I tested it with...
I also hacked up a quick script to also generate the daily schedules for all the channels whether PseudoChannel is running or not. Before I was manually updating the daily schedules for each channel. I just set it to run as cron job at 12am but my schedules start at 1:30am in case there is something playing on a channel. I'm still testing it as I just put it together quickly.
I also hacked up a quick script to also generate the daily schedules for all the channels whether PseudoChannel is running or not. Before I was manually updating the daily schedules for each channel. I just set it to run as cron job at 12am but my schedules start at 1:30am in case there is something playing on a channel. I'm still testing it as I just put it together quickly.
Awesome! Please share when it's ready. I'll add you to the creds :)
I wasn't able to get this working on my system.
To start I got this error
manual.sh: 43: manual.sh: Syntax error: "(" unexpected
My first thought was that this was a syntax difference between mac and linux, so I removed the outer parenthesis set and it continued until I got this error:
manual.sh: 63: manual.sh: Syntax error: "(" unexpected (expecting "fi")
So I did the same there and for this one
manual.sh: 71: manual.sh: Syntax error: "(" unexpected (expecting "fi")
Which got me down to this:
+++++ There are 50 channels detected.
+++++ It looks like the previous channel was:
+++++ The next channel is: 1
manual.sh: 84: manual.sh: ./startstop.sh: not found
manual.sh: 85: cd: can't cd to ../pseudo-channel_1
I wasn't able to get this working on my system.
To start I got this error manual.sh: 43: manual.sh: Syntax error: "(" unexpected
Line 43 looks like the line I had to change for my use case. Does it work if you replace it with this
CHANNEL_DIR_ARR=( $(find . -maxdepth 1 -type d -name '*'"$CHANNEL_DIR_INCREMENT_SYMBOL"'[[:digit:]]*' -printf "%P\n") )
?
Comes back with this one again
manual.sh: 43: manual.sh: Syntax error: "(" unexpected
Ok last change that I can think of.
CHANNEL_DIR_ARR=( $(find . -maxdepth 1 -type d -name '*'"$CHANNEL_DIR_INCREMENT_SYMBOL"'[[:digit:]]' -printf "%P\n") )
The only thing different is removing the '*' after [[:digit:]].
Same error again
That is weird because, that line is copy and pasted from the other channelup.sh
and channeldown.sh
files. The error might be elsewhere. There's nothing in there I can see that is mac or linux specific.
Figured it out. This needs to be run as ./manual.sh 1
, instead of sh manual.sh 1
Now, for some reason, out of 3 channels, if I pick channel 1, I get 3, if I pick 3, I get 1, if I pick 2, I get all three at the same time.
Here's the output on channel 2
pi@controller:~/channels $ sudo ./manual.sh 2
+++++ There are 3 channels detected.
+++++ It looks like the previous channel was: 1
+++++ The next channel is: 2
Started PseudoChannel.py -m -r @ Process: 8541
Created running.pid file in . dir
Started PseudoChannel.py -m -r @ Process: 8545
Created running.pid file in . dir
pi@controller:~/channels $ pgrep python
8364
8541
8545
That sounds like the issue with the channelup and channeldown you had at one point. Does deleting the .prevplaying
and running.pid
files help? I had that happen once and that fixed it for me.
Yeah looks like that did the trick, now to map all of these to my remote and add more channels.
Great! I'm thinking of getting one of those remotes since now I can change to specific channels. Is it possible to press the numbers and then press 'Enter' if there is button and call this script, sending the number value to it?
My remote recognizes as a USB keyboard and I use openbox to configure the remote from there. In theory, you could configure it for any behavior you can configure a keyboard to do.
I think @irodimus nailed this one. Cheers!
This is a really rough script for manually switching a channel by including it as an argument. It has no error check so if you give it an invalid channel, it will break. For the most part it works for me but I figured I throw it out there if you wanted to test and use it or improve it. This is heavily based off of the channelup/down.sh scripts.
To run, use './manual.sh [channel]'
I had to change how the script found the channels as it would only show 9. I have 12 channels setup and it would skip channels 10 and up. This was my case so I'm not sure if you have run into this.