Mailing List Archive

Lost Recordings and Database
Hi All,

I wonder if someone with more knowledge of the Myth Database schema
might be able to advise me here. A friends Myth (0.32) system had a disk
tragedy and he has lost one of two volumes where the recordings are/were
held. The database entries for those recordings remain intact.

Would it be possible to construct an SQL query that would take entries
after a specific date in the Recorded table and arrange for those
recordings to be entered into the Recording Schedules. In effect a
"Delete and Re-Record" operation.

Many thanks

Ken


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On Mon, 9 Jan 2023 11:35:39 +0000, you wrote:

>Hi All,
>
>I wonder if someone with more knowledge of the Myth Database schema
>might be able to advise me here. A friends Myth (0.32) system had a disk
>tragedy and he has lost one of two volumes where the recordings are/were
>held. The database entries for those recordings remain intact.
>
>Would it be possible to construct an SQL query that would take entries
>after a specific date in the Recorded table and arrange for those
>recordings to be entered into the Recording Schedules. In effect a
>"Delete and Re-Record" operation.
>
>Many thanks
>
>Ken

That certainly sounds possible. What you would want to do would be to
check all recordings and get the basename field for each file, then
check if the file can be found on disk. If not, then do the delete
and re-record. There are API calls to list recordings with various
filters, and there is an API to do delete. I would have to check if
the delete API has a re-record option. If so, it would not be a
particularly complicated bit of Python to do this.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On 10/01/2023 01:15, Stephen Worthington wrote:

> On Mon, 9 Jan 2023 11:35:39 +0000, you wrote:
>
>> Hi All,
>>
>> I wonder if someone with more knowledge of the Myth Database schema
>> might be able to advise me here. A friends Myth (0.32) system had a disk
>> tragedy and he has lost one of two volumes where the recordings are/were
>> held. The database entries for those recordings remain intact.
>>
>> Would it be possible to construct an SQL query that would take entries
>> after a specific date in the Recorded table and arrange for those
>> recordings to be entered into the Recording Schedules. In effect a
>> "Delete and Re-Record" operation.
>>
>> Many thanks
>>
>> Ken
> That certainly sounds possible. What you would want to do would be to
> check all recordings and get the basename field for each file, then
> check if the file can be found on disk. If not, then do the delete
> and re-record. There are API calls to list recordings with various
> filters, and there is an API to do delete. I would have to check if
> the delete API has a re-record option. If so, it would not be a
> particularly complicated bit of Python to do this.


Just throwing the idea out there :) There is also the Services API (note
the AllowRerecord and ForceDelete parameters)

https://www.mythtv.org/wiki/DVR_Service#DeleteRecording

https://www.mythtv.org/wiki/DVR_Service#GetRecordedList


Paul H.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On Tue, 10 Jan 2023 14:15:24 +1300, you wrote:

>On Mon, 9 Jan 2023 11:35:39 +0000, you wrote:
>
>>Hi All,
>>
>>I wonder if someone with more knowledge of the Myth Database schema
>>might be able to advise me here. A friends Myth (0.32) system had a disk
>>tragedy and he has lost one of two volumes where the recordings are/were
>>held. The database entries for those recordings remain intact.
>>
>>Would it be possible to construct an SQL query that would take entries
>>after a specific date in the Recorded table and arrange for those
>>recordings to be entered into the Recording Schedules. In effect a
>>"Delete and Re-Record" operation.
>>
>>Many thanks
>>
>>Ken
>
>That certainly sounds possible. What you would want to do would be to
>check all recordings and get the basename field for each file, then
>check if the file can be found on disk. If not, then do the delete
>and re-record. There are API calls to list recordings with various
>filters, and there is an API to do delete. I would have to check if
>the delete API has a re-record option. If so, it would not be a
>particularly complicated bit of Python to do this.

The DeleteRecording API does have options to delete metadata if the
recording file is not present and to re-record. The GetRecording API
will return the recording data if the recording is present, and
presumably will do an error if it is not, so it should be able to be
used to determine if the recording file exists. The GetRecordedList
API will return a list of all recordings.

So what I would do would be to get the full list of recordings, then
for each one do GetRecording and see if the file exists. If it does,
delete that entry in the recordings list. Then display the list of
recordings that have no files for the user to check. After checking,
the user says whether to proceed with doing a delete-and-re-record on
each of those recordings, using the option to force a delete if the
recording file is missing. All of which is fairly straightforward for
anyone who has used the MythTV Services API before, but does represent
a few hours of work to write.

I would recommend only running the program when MythTV is not busy and
is not going to be busy for a while, as it will do a lot of database
updates and may make it too busy to start or stop recordings properly.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On Mon, 9 Jan 2023 at 11:37, Ken Smith via mythtv-users
<mythtv-users@mythtv.org> wrote:
>
> Hi All,
>
> I wonder if someone with more knowledge of the Myth Database schema
> might be able to advise me here. A friends Myth (0.32) system had a disk
> tragedy and he has lost one of two volumes where the recordings are/were
> held. The database entries for those recordings remain intact.
>
> Would it be possible to construct an SQL query that would take entries
> after a specific date in the Recorded table and arrange for those
> recordings to be entered into the Recording Schedules. In effect a
> "Delete and Re-Record" operation.

Ken,

The helpful replies so far (especially how this can be achieved using
the API) are suggesting how to remove knowledge of the missing
recordings from the database so that they may be recorded again in the
future.

They do not go as far as creating a recording rule for each missing
recording so that they are automatically recorded when next broadcast.
Is this what you are after?

Thanks,
Nick
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On 1/10/2023 4:32 AM, Stephen Worthington wrote:
> On Tue, 10 Jan 2023 14:15:24 +1300, you wrote:
>
>> On Mon, 9 Jan 2023 11:35:39 +0000, you wrote:
>>
>>> Hi All,
>>>
>>> I wonder if someone with more knowledge of the Myth Database schema
>>> might be able to advise me here. A friends Myth (0.32) system had a disk
>>> tragedy and he has lost one of two volumes where the recordings are/were
>>> held. The database entries for those recordings remain intact.
>>>
>>> Would it be possible to construct an SQL query that would take entries
>>> after a specific date in the Recorded table and arrange for those
>>> recordings to be entered into the Recording Schedules. In effect a
>>> "Delete and Re-Record" operation.
>>>
>>> Many thanks
>>>
>>> Ken
>> That certainly sounds possible. What you would want to do would be to
>> check all recordings and get the basename field for each file, then
>> check if the file can be found on disk. If not, then do the delete
>> and re-record. There are API calls to list recordings with various
>> filters, and there is an API to do delete. I would have to check if
>> the delete API has a re-record option. If so, it would not be a
>> particularly complicated bit of Python to do this.
> The DeleteRecording API does have options to delete metadata if the
> recording file is not present and to re-record. The GetRecording API
> will return the recording data if the recording is present, and
> presumably will do an error if it is not, so it should be able to be
> used to determine if the recording file exists. The GetRecordedList
> API will return a list of all recordings.
>
> So what I would do would be to get the full list of recordings, then
> for each one do GetRecording and see if the file exists. If it does,
> delete that entry in the recordings list. Then display the list of
> recordings that have no files for the user to check. After checking,
> the user says whether to proceed with doing a delete-and-re-record on
> each of those recordings, using the option to force a delete if the
> recording file is missing. All of which is fairly straightforward for
> anyone who has used the MythTV Services API before, but does represent
> a few hours of work to write.
>
> I would recommend only running the program when MythTV is not busy and
> is not going to be busy for a while, as it will do a lot of database
> updates and may make it too busy to start or stop recordings properly.
See the find_orphans.py script on the net for inspiration too. It cleans
up dead files. The only functionality it doesn't have is re-record but
since you have database access that should be possible too.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On 10/01/2023 09:32, Stephen Worthington wrote:

> On Tue, 10 Jan 2023 14:15:24 +1300, you wrote:
>
>> On Mon, 9 Jan 2023 11:35:39 +0000, you wrote:
>>
>>> Hi All,
>>>
>>> I wonder if someone with more knowledge of the Myth Database schema
>>> might be able to advise me here. A friends Myth (0.32) system had a disk
>>> tragedy and he has lost one of two volumes where the recordings are/were
>>> held. The database entries for those recordings remain intact.
>>>
>>> Would it be possible to construct an SQL query that would take entries
>>> after a specific date in the Recorded table and arrange for those
>>> recordings to be entered into the Recording Schedules. In effect a
>>> "Delete and Re-Record" operation.
>>>
>>> Many thanks
>>>
>>> Ken
>> That certainly sounds possible. What you would want to do would be to
>> check all recordings and get the basename field for each file, then
>> check if the file can be found on disk. If not, then do the delete
>> and re-record. There are API calls to list recordings with various
>> filters, and there is an API to do delete. I would have to check if
>> the delete API has a re-record option. If so, it would not be a
>> particularly complicated bit of Python to do this.
> The DeleteRecording API does have options to delete metadata if the
> recording file is not present and to re-record. The GetRecording API
> will return the recording data if the recording is present, and
> presumably will do an error if it is not, so it should be able to be
> used to determine if the recording file exists. The GetRecordedList
> API will return a list of all recordings.
>
> So what I would do would be to get the full list of recordings, then
> for each one do GetRecording and see if the file exists. If it does,
> delete that entry in the recordings list. Then display the list of
> recordings that have no files for the user to check. After checking,
> the user says whether to proceed with doing a delete-and-re-record on
> each of those recordings, using the option to force a delete if the
> recording file is missing. All of which is fairly straightforward for
> anyone who has used the MythTV Services API before, but does represent
> a few hours of work to write.
>
> I would recommend only running the program when MythTV is not busy and
> is not going to be busy for a while, as it will do a lot of database
> updates and may make it too busy to start or stop recordings properly.


Yeah there is potential to do a lot of damage if things go wrong so
definitely a good idea to do a test run first that doesn't do anything
that can't be undone.


Another thought. There is an option  in the mythutil command line
utility (mythutil --checkrecordings) to do some basic checks including
looking for missing recordings and 0 byte recordings where the file
exists but is zero bytes in size.

It's another way to do a quick check, you get  a list of missing
recordings etc at the end of the run and a summary so you can see how
bad things are.

The intention was always to add more command line options to fix any
errors found like missing recordings or zero byte recordings but the
only one done is to fix recordings with missing seek tables that was and
still is a common problem. You add 'fixseektable' option to the command
line. It would be nice to have further options to fix the other common
problems.


Paul H.


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
Nick Morrott <knowledgejunkie@gmail.com> wrote:

> The helpful replies so far (especially how this can be achieved using
> the API) are suggesting how to remove knowledge of the missing
> recordings from the database so that they may be recorded again in the
> future.
>
> They do not go as far as creating a recording rule for each missing
> recording so that they are automatically recorded when next broadcast.
> Is this what you are after?

I was thinking along the same lines as I have “a few” missing files after a self inflicted loss of a recordings directory a few years ago. But I’ve never had enough impetus to sit down and create new recording rules for them (quite a few were “find and record one showing” rules which self-delete after a successful recording).

Simon

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
Hoi Simon,

Tuesday, January 10, 2023, 9:20:27 PM, you wrote:

> Nick Morrott <knowledgejunkie@gmail.com> wrote:

>> The helpful replies so far (especially how this can be achieved using
>> the API) are suggesting how to remove knowledge of the missing
>> recordings from the database so that they may be recorded again in the
>> future.
>>
>> They do not go as far as creating a recording rule for each missing
>> recording so that they are automatically recorded when next broadcast.
>> Is this what you are after?

> I was thinking along the same lines as I have “a few” missing files
> after a self inflicted loss of a recordings directory a few years
> ago. But I’ve never had enough impetus to sit down and create new
> recording rules for them (quite a few were “find and record one
> showing” rules which self-delete after a successful recording).

> Simon

I guess you mean "Record this showing" If you select "Record One
showing" the rule stays active and would in theory be able to
rerecord.


Tot mails,
Hika mailto:hikavdh@gmail.com

"Zonder hoop kun je niet leven
Zonder leven is er geen hoop
Het eeuwige dilemma
Zeker als je hoop moet vernietigen om te kunnen overleven!"

De lerende Mens

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On 10/01/2023 20:53, Hika van den Hoven wrote:
> Hoi Simon,
>
> Tuesday, January 10, 2023, 9:20:27 PM, you wrote:
>
>> Nick Morrott <knowledgejunkie@gmail.com> wrote:
>
>>> The helpful replies so far (especially how this can be achieved using
>>> the API) are suggesting how to remove knowledge of the missing
>>> recordings from the database so that they may be recorded again in the
>>> future.
>>>
>>> They do not go as far as creating a recording rule for each missing
>>> recording so that they are automatically recorded when next broadcast.
>>> Is this what you are after?
>
>> I was thinking along the same lines as I have “a few” missing files
>> after a self inflicted loss of a recordings directory a few years
>> ago. But I’ve never had enough impetus to sit down and create new
>> recording rules for them (quite a few were “find and record one
>> showing” rules which self-delete after a successful recording).
>
>> Simon
>
> I guess you mean "Record this showing" If you select "Record One
> showing" the rule stays active and would in theory be able to
> rerecord.
>
Nope. If you schedule, as I do, using mythweb, one of the options is, indeed, "Find and record one
showing of this title."

--

Mike Perkins


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On 1/10/23 16:56, Mike Perkins wrote:
> On 10/01/2023 20:53, Hika van den Hoven wrote:
>> Hoi Simon,
>>
>> Tuesday, January 10, 2023, 9:20:27 PM, you wrote:
>>
>>> Nick Morrott <knowledgejunkie@gmail.com> wrote:
>>
>>>> The helpful replies so far (especially how this can be achieved using
>>>> the API) are suggesting how to remove knowledge of the missing
>>>> recordings from the database so that they may be recorded again in the
>>>> future.
>>>>
>>>> They do not go as far as creating a recording rule for each missing
>>>> recording so that they are automatically recorded when next broadcast.
>>>> Is this what you are after?
>>
>>> I was thinking along the same lines as I have “a few” missing files
>>> after a self inflicted loss of a recordings directory a few years
>>> ago. But I’ve never had enough impetus to sit down and create new
>>> recording rules for them (quite a few were “find and record one
>>> showing” rules which self-delete after a successful recording).
>>
>>> Simon
>>
>> I guess you mean "Record this showing" If you select "Record One
>> showing" the rule stays active and would in theory be able to
>> rerecord.
>>
> Nope. If you schedule, as I do, using mythweb, one of the options is, indeed, "Find and record one showing of this title."
>

The attached is old, but it still works. The OP can try it with:

add_recording_rule.py --host localhost --title='CSI: Vegas'

and it will say what would happen (but do nothing). Adding the
We Really Mean It switch (--wrmi) will actually create the
rule.

It uses the Services API and it could be a template for what
needs to be done here.

These can be selected from the command line:

TYPES = (
"Single Record",
"Record All",
"Record One",
"Record Daily",
"Record Weekly",
)

Start with: add_recording_rule.py --help

--
Bill
Re: Lost Recordings and Database [ In reply to ]
On Tue, 10 Jan 2023 22:32:22 +1300, you wrote:

>On Tue, 10 Jan 2023 14:15:24 +1300, you wrote:
>
>>On Mon, 9 Jan 2023 11:35:39 +0000, you wrote:
>>
>>>Hi All,
>>>
>>>I wonder if someone with more knowledge of the Myth Database schema
>>>might be able to advise me here. A friends Myth (0.32) system had a disk
>>>tragedy and he has lost one of two volumes where the recordings are/were
>>>held. The database entries for those recordings remain intact.
>>>
>>>Would it be possible to construct an SQL query that would take entries
>>>after a specific date in the Recorded table and arrange for those
>>>recordings to be entered into the Recording Schedules. In effect a
>>>"Delete and Re-Record" operation.
>>>
>>>Many thanks
>>>
>>>Ken
>>
>>That certainly sounds possible. What you would want to do would be to
>>check all recordings and get the basename field for each file, then
>>check if the file can be found on disk. If not, then do the delete
>>and re-record. There are API calls to list recordings with various
>>filters, and there is an API to do delete. I would have to check if
>>the delete API has a re-record option. If so, it would not be a
>>particularly complicated bit of Python to do this.
>
>The DeleteRecording API does have options to delete metadata if the
>recording file is not present and to re-record. The GetRecording API
>will return the recording data if the recording is present, and
>presumably will do an error if it is not, so it should be able to be
>used to determine if the recording file exists. The GetRecordedList
>API will return a list of all recordings.
>
>So what I would do would be to get the full list of recordings, then
>for each one do GetRecording and see if the file exists. If it does,
>delete that entry in the recordings list. Then display the list of
>recordings that have no files for the user to check. After checking,
>the user says whether to proceed with doing a delete-and-re-record on
>each of those recordings, using the option to force a delete if the
>recording file is missing. All of which is fairly straightforward for
>anyone who has used the MythTV Services API before, but does represent
>a few hours of work to write.
>
>I would recommend only running the program when MythTV is not busy and
>is not going to be busy for a while, as it will do a lot of database
>updates and may make it too busy to start or stop recordings properly.

I am having a go at writing some Python to do this. So far I have it
getting the recordings list and working out which ones to delete due
to having missing recording files, but I have not yet written the code
to do the deletions (or to create new recording rules if necessary).
If you want to try the work in progress, I have put it on my web
server:

http://www.jsw.gen.nz/mythtv/myth-delete-missing.py

For testing purposes if you do not want too much output, I would
suggest using an SQL option like this:

-s "limit 10"

on the command line or put it in the SQL file.

It creates a myth-delete-missing.py.log file in the current directory
where it puts all the debug output, so if you have any problems with
it, please let me know and send me a copy of the log file, and a copy
of any exception traces.

So far I have not considered how to do username/password where you
have your backend set up to require that - let me know if this is
actually needed.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
Bill Meek wrote:
> On 1/10/23 16:56, Mike Perkins wrote:
>> On 10/01/2023 20:53, Hika van den Hoven wrote:
>>> Hoi Simon,
>>>
>>> Tuesday, January 10, 2023, 9:20:27 PM, you wrote:
>>>
>>>> Nick Morrott <knowledgejunkie@gmail.com> wrote:
>>>
>>>>> The helpful replies so far (especially how this can be achieved using
>>>>> the API) are suggesting how to remove knowledge of the missing
>>>>> recordings from the database so that they may be recorded again in
>>>>> the
>>>>> future.
>>>>>
>>>>> They do not go as far as creating a recording rule for each missing
>>>>> recording so that they are automatically recorded when next
>>>>> broadcast.
>>>>> Is this what you are after?
>>>
>>>> I was thinking along the same lines as I have “a few” missing files
>>>> after a self inflicted loss of a recordings directory a few years
>>>> ago. But I’ve never had enough impetus to sit down and create new
>>>> recording rules for them (quite a few were “find and record one
>>>> showing” rules which self-delete after a successful recording).
>>>
>>>> Simon
>>>
>>> I guess you mean "Record this showing" If you select "Record One
>>> showing" the rule stays active and would in theory be able to
>>> rerecord.
>>>
>> Nope. If you schedule, as I do, using mythweb, one of the options is,
>> indeed, "Find and record one showing of this title."
>>
>
> The attached is old, but it still works. The OP can try it with:
>
>   add_recording_rule.py --host localhost --title='CSI: Vegas'
>
> and it will say what would happen (but do nothing). Adding the
> We Really Mean It switch (--wrmi) will actually create the
> rule.
>
> It uses the Services API and it could be a template for what
> needs to be done here.
>
> These can be selected from the command line:
>
> TYPES = (
>     "Single Record",
>     "Record All",
>     "Record One",
>     "Record Daily",
>     "Record Weekly",
> )
>
> Start with: add_recording_rule.py --help
>
>

Thank you everyone for all these good suggestions. I'll definitely go
with the API approach instead of direct sql.

Thanks  --- Ken


--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
> On 13 Jan 2023, at 1:55 am, Ken Smith via mythtv-users <mythtv-users@mythtv.org> wrote:
>
>
>
> Bill Meek wrote:
>> On 1/10/23 16:56, Mike Perkins wrote:
>>> On 10/01/2023 20:53, Hika van den Hoven wrote:
>>>> Hoi Simon,
>>>>
>>>> Tuesday, January 10, 2023, 9:20:27 PM, you wrote:
>>>>
>>>>> Nick Morrott <knowledgejunkie@gmail.com> wrote:
>>>>
>>>>>> The helpful replies so far (especially how this can be achieved using
>>>>>> the API) are suggesting how to remove knowledge of the missing
>>>>>> recordings from the database so that they may be recorded again in the
>>>>>> future.
>>>>>>
>>>>>> They do not go as far as creating a recording rule for each missing
>>>>>> recording so that they are automatically recorded when next broadcast.
>>>>>> Is this what you are after?
>>>>
>>>>> I was thinking along the same lines as I have “a few” missing files
>>>>> after a self inflicted loss of a recordings directory a few years
>>>>> ago. But I’ve never had enough impetus to sit down and create new
>>>>> recording rules for them (quite a few were “find and record one
>>>>> showing” rules which self-delete after a successful recording).
>>>>
>>>>> Simon
>>>>
>>>> I guess you mean "Record this showing" If you select "Record One
>>>> showing" the rule stays active and would in theory be able to
>>>> rerecord.
>>>>
>>> Nope. If you schedule, as I do, using mythweb, one of the options is, indeed, "Find and record one showing of this title."
>>>
>>
>> The attached is old, but it still works. The OP can try it with:
>>
>> add_recording_rule.py --host localhost --title='CSI: Vegas'
>>
>> and it will say what would happen (but do nothing). Adding the
>> We Really Mean It switch (--wrmi) will actually create the
>> rule.
>>
>> It uses the Services API and it could be a template for what
>> needs to be done here.
>>
>> These can be selected from the command line:
>>
>> TYPES = (
>> "Single Record",
>> "Record All",
>> "Record One",
>> "Record Daily",
>> "Record Weekly",
>> )
>>
>> Start with: add_recording_rule.py --help
>>
>
> Thank you everyone for all these good suggestions. I'll definitely go with the API approach instead of direct sql.
>
> Thanks --- Ken

I've not tried, but have been vaugely following the thread

>>> I guess you mean "Record this showing" If you select "Record One
>>> showing" the rule stays active and would in theory be able to
>>> rerecord.

Why not a simple sql statement replacing 'anything' in record rule with 'Record One showing'.
Backup the DB before you fiddle
James
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: Lost Recordings and Database [ In reply to ]
On Thu, 12 Jan 2023 00:18:31 +1300, you wrote:

I have put version 0.2 of myth-delete-missing.py on my web server:

http://www.jsw.gen.nz/mythtv/myth-delete-missing.py

I have had a lack of time to work on this very much in the last week,
but it is now functional except for the option to create a new
recording rule if one is not found. If you use that action ('drc'),
any recordings where there is no matching recording rule will not be
deleted. So you can go ahead and use it with drc and any recordings
that need drc will be left to be fixed later (hopefully when I work
out how to create the new recording rules correctly and release a new
version).

Note that this is beta software and has not had much testing yet -
please make sure you read the help about backing up your database,
before using it other than with the l (list) action.

Please run:

myth-delete-missing.py --help

for lots of help.

Please feel free to email me directly for support (off list) if you
need it or have a problem with myth-delete-missing.py. Or post here
on the list.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org