I was torn between doing this (sudo code):

query=('SELECT * FROM tv WHERE title = \'%s\'' % (prog.title))
results=db.runQuery(query)
for row in results:
    if row['title'] == prog.title and row['sub_title'] == prog.sub_title:
       duplicateProgram=True
    if row['title'] == prog.title and row['desc'] == prog.desc:
       duplicateProgram=True

or doing this:

query1=('SELECT * FROM tv WHERE title = \'%s\' AND sub_title = \'%s\'' % (
prog.title, prog.sub_title))
results1=db.runQuery(query1)
query2=('SELECT * FROM tv WHERE title = \'%s\' AND desc = \'%s\'' % (
prog.title, prog.sub_title))
results2=db.runQuery(query2)
if results1 or results2:
  duplicateProgram=True

I'm not sure if 2 sql statements are better than one sql statement and an
iteration over a set. I'm guessing that the two sql statements would be
better but that's just a hunch.

On 12/31/06, Andrew Flegg <[EMAIL PROTECTED]> wrote:

On 12/30/06, Andrew Flegg <[EMAIL PROTECTED]> wrote:
> On 12/30/06, Justin Wetherell <[EMAIL PROTECTED]> wrote:
> > On 12/30/06, Justin Wetherell < [EMAIL PROTECTED]> wrote:
> > > I've done a quick hack for duplicate detection, if you want ro run
> > > with the idea.
>
[snip]
> So you've (partially) solved the problem of *previous* duplicates,
> with the problem of *upcoming* duplicates still to look at (although
> this should be trivial).

Apologies, your patch handles that as well - I should've recognised dodgy
data.

Although I've changed it slightly (in particular the SQL). I'll resend
a patch when I'm happier with it.

Cheers,

Andrew

--
Andrew Flegg -- mailto:[EMAIL PROTECTED]  |  http://www.bleb.org/

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-devel mailing list
Freevo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-devel

Reply via email to