[mythtv-users] sql query to identify duplicates

Leo Butler leo.butler at member.ams.org
Wed Apr 30 22:27:27 UTC 2014


>   On 30/04/14 16:46, Leo Butler wrote:
>   >>    From: "Michael T. Dean" <mtdean at thirdcontact.com>
>   >>    On 04/30/2014 09:47 AM, Leo Butler wrote:
>   >>    > Hi,
>   >>    >
>   >>    > Since changing over from an analogue (pvr-150) to digital (hdhr3-cc)
>   >>    > tuner, I have written a custom recording rule to re-record episodes.
>   >>    > I simply modified the custom rule to re-record sdtv recordings when
>   >>    > available as hdtv.
>   >>    >
>   >>    > I would like to write an sql query to identify duplicate recordings,
>   >>    > in order to delete the older recording. I am no sql guru, and my first
>   >>    > thought was to query the recorded.duplicate field--but this is set to
>   >>    > 1 for all recordings, so the name belies its purpose.
>   >>    >
>   >>    > Any suggestions?
>   >>
>   >>    http://www.mythtv.org/wiki/FindDuplicateRecordings , but ideally you'd
>   >>    modify it so it operates on all recordings and so that things like
>   >>    category can be specified in the command line or interactively--and
>   >>    especially so that deletes are confirmed interactively.  Lots of
>   >>    examples at http://www.mythtv.org/wiki/Category:Python_Scripts (those by
>   >>    Raymond Wagner being excellent examples of how to do things properly
>   >>    with the Python bindings he wrote :).
>   >>
>   >>    This would be a much better "whole" solution than using SQL (which can't
>   >>    do the rest--like delete and such).
>   >
>   > Mike, thanks for the comments, but I am looking for an sql query.
>   > I guess I'll need to rtfm.
>   >
>   If you had actually looked at Mike's referenced page, the python script contains 
>   the sql you'd probably need to use. At least it would be the basis of what you 
>   wanted.

I did look at, even before sending my original email, thanks. After
seeing Geoff's solution, I looked at the script again and can now see
the sql query.

Leo


More information about the mythtv-users mailing list