Skip to content

Commit

Permalink
Do not delete IPTV channel in DeleteChannel
Browse files Browse the repository at this point in the history
The function DeleteChannel does not really delete a channel
but marks it for deletion when it is no longer referenced.
This is introduced in commit 2e26f7f.
Because the channel is not really deleted, as in removed from
the database, the associated record in table iptv_channel
should also not be deleted here.
The chhannel is removed from the database in a periodic
housekeeping task when there are no more recordings referencing
that channel and when at least one day has passed since the
channel was marked for deletion.
When the channel is finally deleted then also the corresponding
entry in iptv_channel, when it exists, should be deleted.
  • Loading branch information
kmdewaal committed Dec 7, 2024
1 parent 134590c commit 961f0b6
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions mythtv/libs/libmythtv/channelutil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1822,17 +1822,6 @@ bool ChannelUtil::DeleteChannel(uint channel_id)
return false;
}

query.prepare(
"DELETE FROM iptv_channel "
"WHERE chanid = :ID");
query.bindValue(":ID", channel_id);

if (!query.exec())
{
MythDB::DBError("Delete Channel 2", query);
return false;
}

return true;
}

Expand Down

0 comments on commit 961f0b6

Please sign in to comment.