[mythtv-users] Finding gaps in the MythTV recording schedule to do maintenance in

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Apr 20 07:37:21 UTC 2017


On Wed, 19 Apr 2017 22:34:48 +1200, you wrote:

>I have a busy MythTV box, so when I need a few hours to do some
>maintenance on it, such as changing tuner cards or rearranging the
>drives, it can be a problem to work out when enough time will be
>available.  So I wrote myself a Python script called "gaps" that uses
>the new API to get the recording schedule and find when there are gaps
>in it.  It takes one command line parameter which is the minimum
>number of hours of gap needed.  If there are no parameters given, it
>will list all the gaps, no matter how small.  The script is rather
>rough and ready, but it works for me.
>
>To use it, you need to also have the Utilties.py Python module
>installed.  You can download that from the Wiki Python API Examples
>page.  I just put a copy of the file in my /usr/local/bin directory.
>Make sure you save the file as a UTF-8 encoded file.
>
>Wiki Python API Examples page:
>https://www.mythtv.org/wiki/Python_API_Examples
>
>gaps script:
>http://www.jsw.gen.nz/mythtv/gaps
>
>Please let me know if you find any problems with it.

I have just put a slightly updated version of the "gaps" script on my
web server.  It seems that Python is quite permissive in what it will
accept for a time duration (datetime.timedelta), so I am now allowing
a floating point number on the command line for the number of hours
minimum gap size to search for.


More information about the mythtv-users mailing list