OliveTin for Channels: An Interface for Misc Channels DVR Scripts & Tricks

Hmm. I still see no change. I checked via Organizr, and also direct at the actual OliveTin page. It still says 72h regardless.

New bnhf/olivetin:test container pushed this AM. Should address issues with retention of last used values for YT-Thumbnails and TWiT.tv.

Use of an interval "0" will now reset default values in addition to killing the script -- which matches how we're doing it with Channel Lineup Change Notifications. (Running!) label changed to (Date_Time) to force browser refresh when data is changed for all buttons with background tasks.

Figured out how to kill the correct child sleep process, when multiple sleep processes exist. Nobody likes orphaned child processes in their Docker containers! :baby:

Great, thanks! I updated to the bnhf/olivetin:test container and all appears fine. One suggestion I have with regards to the "running" label now changed to a date_time. How about also giving those tiles a slightly different background, so they stand out from the others? A light green shade would make sense to me :slight_smile:

I then ran the "List Sources for a Single Channel" command for the first time, just to test it out and see how it works. The first channel I tried was KABC. But the result only showed one, on my HDHomeRun, it didn't show it from the TVE sources. Same with KNBC. So I'm wondering if I'm doing something wrong?

I've got to head to work but will check the other buttons later and keep testing. Thanks for your continued work on this, I'm really appreciating it.

Another excellent suggestion! Which, I can accommodate in a tangential fashion. The background is baked-in, but the icon I have control over:

We'd want @mjitkop involved if there's something going on with the source data, but I'd guess those don't have the same name (even though they're the same station). Maybe have a look at your channels_dvr_channel_list_latest.csv file in the directory you have mapped to /config, and see if there's an obvious issue with channel names.

bnhf/olivetin:test has been pushed with the new green=running enhancement.

Ding, ding, ding... We have a winner! :partying_face:

That's exactly right. For the same channel, the name can differ from one source to another. Sometimes it's just a matter of a lower case vs. upper case on just one letter!

I did try to take this into account as much as I could in my script by ignoring differences in casing but there is more work to be done in order to filter better.

Another example I have in mind is A&E that is called AETV in a TVE source (if I'm not mistaken, I can't check right now) for example.

I was thinking at some point to have a translation table in the script in order to pick a single, official channel name for a case like this. That's a lot of work, and free time is very limited for me right now.

@bnhf: another idea for OliveTin. Could it handle something like this:

I imagine the user would just need to enter the account credentials and then click start.

And also print the instructions to show the user how to set up the custom channel.

If a user wont read instruction on how to set it up, what makes you think they'll read that one.
I can foresee support issues if someone uses OliveTin for Channels to do this and they're missing guide info, or they want to renumber channels, or using SMB mounts to delete files has permission issue. I wouldn't do it, but I'm not bnhf.

How quickly I was shut down! :laughing:

It was just an idea. It may not be good but I thought I would mention it anyway. :person_shrugging:

Like I said. I'm not bnhf. It is a good idea if he wants to deal with the support issues!

1 Like

So how do I find out the name to search for? Here's CBS for example, via two sources.

I searched for "CBS" and "KCBS" and got the same answer, it only finds KCBS-HD on the HDHomeRun, and ignores the CBS from TVE.

And when I search KCBSDT, I get nothing:

1 Like

I see one obvious problem that'll I fix in the next build -- and I believe will help with your results.

Go into the config.yaml file in the directory you have bound to /config. In the very bottom section, the "shell:" line needs quotes around {{ channel }} like this:

shell: /config/channels_to_csv_awk.sh "{{ channel }}"

That should help some, and I'll take a look at what else might be done to improve the results. Maybe a loop to give all matching results, not just the first hit?

A combination of fixes/improvements will give us better results for single channel searches. For example, here's the result of searching for "hbo signature" this morning using a loop to support multiple matches:

I'm also working on some "fuzzy logic" to allow for near matches.

EDIT: Update to test tagged container pushed with support for multiple match output and .* wildcard matches.

1 Like

I've added a Delete Channels DVR Recording Log Files feature discussed in another thread with @mjitkop and @cyoungers. Probably not a big issue for most, but the recording log files stored in the dvr/Logs/recording directory on your server have the potential to grow large if you do A LOT of recording.

This OliveTin Action Button is another that you can use cron-style (or task-scheduler-style), and have it execute every 7 days, every 30 days or whatever. The interval you specify is the same number of days aging that'll be used for the log file deletion -- e.g. if you set the action to run every 7 days, it'll delete all log files more than 7 days old.

You'll need to bind the /dvr directory on your Channels DVR server (which also needs to be a network share) to the container for this to work. The share can either be CIFS (SMB) or NFS, and can be attached using Portainer-Volumes. Set the volume up first, and then attach it to /mnt/dvr in the container. I use Proxmox containers, so my example is slightly different, as I have to pass the Samba share through already mounted to my host.

version: '3.9'
services:
  olivetin:
    image: bnhf/olivetin:test
    container_name: olivetin
    ports:
      - 1337:1337
    environment:
      - CHANNELS_DVR=${CHANNELS_DVR} # Add your Channels DVR server in the form hostname:port or ip:port
      - UPDATE_YAMLS=${UPDATE_YAMLS} # Set this to true to update config.yaml
      - UPDATE_SCRIPTS=${UPDATE_SCRIPTS} # Set this to true to update all included scripts
      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc
    volumes:
      - /data/olivetin:/config # replace host path or volume as needed
      - /mnt/dvr:/mnt/dvr # replace /mnt/dvr to the left of the colon with your Channels DVR Server /dvr network share
    restart: unless-stopped
#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/dvr inside the container
  #channels-dvr:
    #external: true

If you were attaching a pre-created docker volume (done through Portainer-Volumes), you'd want uncomment the last 3 lines (assuming a volume name of channels-dvr), and bind it like this:

    volumes:
      - /data/olivetin:/config # replace host path or volume as needed
      - channels-dvr:/mnt/dvr # replace /mnt/dvr to the left of the colon with your Channels DVR Server /dvr network share
    restart: unless-stopped
volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/dvr inside the container
  channels-dvr:
    external: true

Pulled the latest test build. Not sure my drive mapping is correct. Is this what you expect if it ran correctly?

I did sneak a one time mode in there, though I oriented the script more to use on an ongoing basis.

If you exec into the container, and ls -la /mnt/dvr you should be able to tell if your network share directories are present. One of them would be "Logs". Also, if you go to your /dvr network share, there shouldn't be any directories more than 30 days old (which is the age I chose for this somewhat "undocumented" once mode).

For the future, I'll see if I can get the stdout feedback to be a bit more expansive.

@cyoungers Thanks again for testing and helping to illuminate areas that can be improved in the various OliveTin actions!

Through a bit of hocus pocus, a log file will be created when running the Delete Channels DVR Recording Log Files script, and the first lines of it will be shown in stdout. When running this psuedo cron-style, the log file will be added to when additional deletions occur:

screenshot-htpc6-2023.10.18-09_01_04

:test and :latest have been pushed, and are the same once again.

Happy to help with testing. Olivetin has developed into a nice collection of utilities. Thanks @bnhf!

Inspired by this idea, could a button in OliveTin handle this sort of thing as well?

Looks easy enough to send a notification to one particular client. But I think that begs the question, is there a way to send a single message to all active clients? Or to determine which clients are active, and then send messages to that list? I definitely like the idea!

EDIT: Maybe something as simple as an environment variable (defined at container start) containing an array of client hostnames (or IPs) to send the messages/notifications to?

EDIT2: The message disappears pretty quickly on its own (around 5 seconds), but it does seem to work to send successive messages to make it longer. So, I'm thinking we'd want to specify a display duration.

1 Like

And it's done! Pushed as bnhf/olivetin:test for now. You'll need to define a new environment variable, which is a space separated list of clients you'd like messages sent to using hostname or IP:

version: '3.9'
services:
  olivetin:
    image: bnhf/olivetin:test
    container_name: olivetin
    ports:
      - 1337:1337
    environment:
      - CHANNELS_DVR=${CHANNELS_DVR} # Add your Channels DVR server in the form hostname:port or ip:port
      - CHANNELS_CLIENTS=${CHANNELS_CLIENTS} # Space separated list of Channels DVR clients you'd like notifications sent to in the form hostname or IP
      - UPDATE_YAMLS=${UPDATE_YAMLS} # Set this to true to update config.yaml
      - UPDATE_SCRIPTS=${UPDATE_SCRIPTS} # Set this to true to update all included scripts
      - TZ=${TZ} # Add your local timezone in standard linux format. E.G. US/Eastern, US/Central, US/Mountain, US/Pacific, etc
    volumes:
      - /data/olivetin:/config # replace host path or volume as needed
      - /mnt/dvr:/mnt/dvr # replace /mnt/dvr to the left of the colon with your Channels DVR Server /dvr network share
    restart: unless-stopped
#volumes: # use this section if you've setup a docker volume named channels-dvr, with CIFS or NFS, to bind to /mnt/dvr inside the container
  #channels-dvr:
    #external: true

2 Likes