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

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

3 Likes

Based on this post from @eric, I've modified the Notifications Action Button to take advantage of the undocumented timeout option!

Had to revert, as the timeout option only works for Apple TV clients. Bummer, but the way I'm doing it has the same end result.

Wow! This is awesome. And fast moving, look what I just saw.

Perhaps revert back? :slight_smile:

Since this is part of the client API, we probably want to wait until this updated Android client rolls out? In the meantime, what I have going is basically the same thing. I'm limiting messages to 60 seconds, but we can expand that if desired.

Here's my latest list of what's possible with OliveTin-for-Channels:

1 Like

Makes sense to me. In the meantime I just updated mine and was able to send notifications to three AppleTV's. Super cool, thanks for integrating this!

I'll give it a try when I can select from my DVR's

I haven't forgotten. :slight_smile: There's just a bit more to it than I first thought. I have two DVRs myself, so I'm with you on the need.

I'm headed to Portugal next week for the first half of the Winter, so I'll start working on it there.

1 Like

Don’t know anything about stacks so could someone please set me straight on my errors trying to deploy

Either put your environment variables in the section below the editor (recommended), or get rid of the dollar sign and curly braces if you want to hardcode the values

In the env vars section, just put the var name on the left and value on the right:

You'll want the two true/false vars set to true though.

Success thanks!

@chDVRuser Based on this list of current OliveTin features, could you give me your top few that you'd like to see support multiple DVRs?:

  • Comskip on/off by channel
  • List channels with Comskip off
  • Manually add recordings
  • Find Gracenote station IDs
  • Fix YouTube thumbnails
  • Download TwiT.tv guide data
  • Generate channels list in CSV format
  • Generate movie list in CSV format
  • Scan/Prune local content
  • Mark an episode for re-recording
  • Channel lineup change notifications
  • Generate filtered Channels DVR log
  • List sources for a single channel
  • Delete Channels DVR recording log files
  • Send message to defined Channels clients

Since any script that lends itself to use with multiple DVRs will have to be modified, I'm going to roll them out a few at a time. And, I don't want to start with scripts that neither of us use. Anybody else with multiple Channels DVR servers, please feel free to respond on this.