Skip to content

Commit

Permalink
Fill in missing original airdates for programs without programids.
Browse files Browse the repository at this point in the history
Extend d4f6995 to also handle programs without programids.  Note,
this does not allow setting the original airdate for a program with a
programid from a program without a programid and vice versa.  I don't
want to handle that case unless and until I can see some real world
cases of needing it.

Fixes #10747 .  Bradley Baetz, if this still doesn't meet your needs,
please rework your patch along the lines of what is already done here.
I will not accept any patch which mixes this fixup with others like
your current one does with the first/last showing fixup.
  • Loading branch information
gigem committed Oct 23, 2012
1 parent f2af638 commit beb9f8e
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion mythtv/programs/mythfilldatabase/main.cpp
Expand Up @@ -636,7 +636,28 @@ int main(int argc, char *argv[])

if (query.exec())
LOG(VB_GENERAL, LOG_INFO,
QString(" Found %1").arg(query.numRowsAffected()));
QString(" Found %1 with programids")
.arg(query.numRowsAffected()));

query.prepare("UPDATE program p "
"JOIN ( "
" SELECT title, subtitle, description, "
" MAX(originalairdate) maxoad "
" FROM program "
" WHERE programid = '' AND "
" originalairdate IS NOT NULL "
" GROUP BY title, subtitle, description ) oad "
" ON p.programid = '' AND "
" p.title = oad.title AND "
" p.subtitle = oad.subtitle AND "
" p.description = oad.description "
"SET p.originalairdate = oad.maxoad "
"WHERE p.originalairdate IS NULL");

if (query.exec())
LOG(VB_GENERAL, LOG_INFO,
QString(" Found %1 without programids")
.arg(query.numRowsAffected()));
}

if (mark_repeats)
Expand Down

0 comments on commit beb9f8e

Please sign in to comment.