From 3a8a9acb169dc2ddf2636618fdd5efbd93fe96ac Mon Sep 17 00:00:00 2001
From: Karl Dietz <dekarl@users.sourceforge.net>
Date: Tue, 8 Nov 2011 08:17:06 +0100
Subject: [PATCH 1/5] When deleting a video source delete its multiplexes, too.
Fixes: #10156
---
mythtv/libs/libmythtv/sourceutil.cpp | 15 +++++++++++++++
1 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/mythtv/libs/libmythtv/sourceutil.cpp b/mythtv/libs/libmythtv/sourceutil.cpp
index f5c559d..a5e92ed 100644
a
|
b
|
bool SourceUtil::DeleteSource(uint sourceid) |
482 | 482 | MSqlQuery query(MSqlQuery::InitCon()); |
483 | 483 | |
484 | 484 | // Delete the channels associated with the source |
| 485 | // |
| 486 | // FIXME should probably call ChannelUtil::DeleteChannel instead |
| 487 | // which should be extended to clean up credits, programrating and |
| 488 | // programgenres, too. |
485 | 489 | query.prepare("DELETE FROM channel " |
486 | 490 | "WHERE sourceid = :SOURCEID"); |
487 | 491 | query.bindValue(":SOURCEID", sourceid); |
… |
… |
bool SourceUtil::DeleteSource(uint sourceid) |
492 | 496 | return false; |
493 | 497 | } |
494 | 498 | |
| 499 | // Delete the multiplexes associated with the source |
| 500 | query.prepare("DELETE FROM dtv_multiplex " |
| 501 | "WHERE sourceid = :SOURCEID"); |
| 502 | query.bindValue(":SOURCEID", sourceid); |
| 503 | |
| 504 | if (!query.exec() || !query.isActive()) |
| 505 | { |
| 506 | MythDB::DBError("Deleting Multiplexes", query); |
| 507 | return false; |
| 508 | } |
| 509 | |
495 | 510 | // Delete the inputs associated with the source |
496 | 511 | query.prepare("DELETE FROM cardinput " |
497 | 512 | "WHERE sourceid = :SOURCEID"); |