[mythtv-users] Unset "damaged" flag

Tom Dexter digitalaudiorock at gmail.com
Mon Apr 22 13:07:56 UTC 2019


On 4/22/19, mythtv at kosowsky.org <mythtv at kosowsky.org> wrote:
> Stephen Worthington wrote at about 05:29:53 -0400 on Monday, April 22,
> 2019:
>  > On Mon, 22 Apr 2019 00:16:51 -0400, you wrote:
>  >
>  > >I have a recording that seems to have the "damaged" flag set due to
>  > >the recording ending early.
>  > >Luckily, I missed only the last few seconds which are not important.
>  > >
>  > >Is there any way to *unset* the damaged flag from the GUI?
>  > >I would prefer not to muck directly with the sql tables.
>  >
>  > No, there is no way to do it from the GUI.  And I do not know of
>  > anything in the Services API that would allow you to do it either. The
>  > DAMAGED flag is a flag in the recordedprogram.videoprop field. There
>  > are other flags in that field, so when you turn off DAMAGED, you have
>  > to do it in a way that will retain the other flags.
>  >
>  > Here is one of mine:
>  >
>  > MariaDB [mythconverg]> select chanid,starttime,title,videoprop from
>  > recordedprogram where find_in_set('DAMAGED',videoprop) and title='Safe
>  > House';
>  >
> +--------+---------------------+------------+-----------------------------
>  > -----+
>  > | chanid | starttime           | title      | videoprop
>  > |
>  >
> +--------+---------------------+------------+-----------------------------
>  > -----+
>  > |   1003 | 2017-11-28 08:15:00 | Safe House |
>  > HDTV,WIDESCREEN,AVC,1080,DAMAGED |
>  >
> +--------+---------------------+------------+-----------------------------
>  > -----+
>  > 1 row in set (0.00 sec)
>  >
>  > So to turn off the DAMAGED flag for that one the SQL might be:
>  >
>  > update recordedprogram set videoprop='HDTV,WIDESCREEN,AVC,1080' where
>  > chanid=1003 and starttime='2017-11-28 08:15:00';
>
> Thanks Stephen.
> This worked like a charm!!!!
> Much appreciated for sharing the SQL code.
>

Here's another way to clear that flag only leaving the others
untouched, that doesn't require knowing what other flags where set:

update recordedprogram SET videoprop=videoprop ^ 0b100000 where
chanid=1003 and starttime='2017-11-28 08:15:00';

If you wanted to clear all damaged flags in the table you could do this:

update recordedprogram set videoprop=videoprop ^ 0b100000 where
videoprop+0 & 0b100000;

Tom


More information about the mythtv-users mailing list