cc-2362: upload to soundcloud with the wrong name after show rename.

-make sure to remove all rebroadcasts of recorded shows when editing.
This commit is contained in:
martin 2011-06-06 12:20:44 -04:00
parent ebf7dd0e0d
commit 1de4777de3
1 changed files with 28 additions and 0 deletions

View File

@ -312,6 +312,26 @@ class Show {
$CC_DBC->query($sql); $CC_DBC->query($sql);
} }
/**
* Deletes all future rebroadcast instances of the current
* show object from the show_instances table.
*
*/
public function deleteAllRebroadcasts(){
global $CC_DBC;
$date = new DateHelper;
$timestamp = $date->getTimestamp();
$showId = $this->getId();
$sql = "DELETE FROM cc_show_instances"
." WHERE starts > TIMESTAMP '$timestamp'"
." AND show_id = $showId"
." AND rebroadcast = 1";
$CC_DBC->query($sql);
}
/** /**
* Deletes all show instances of current show after a * Deletes all show instances of current show after a
@ -567,6 +587,14 @@ class Show {
//duration has changed //duration has changed
$this->updateDurationTime($p_data); $this->updateDurationTime($p_data);
} }
if ($isRecorded){
//delete all rebroadcasts. They will simply be recreated later
//in the execution of this PHP script. This simplifies having to
//reason about whether we should keep individual rebroadcasts or
//delete them or move them around etc.
$this->deleteAllRebroadcasts();
}
if ($p_data['add_show_repeats']){ if ($p_data['add_show_repeats']){
if (($repeatType == 1 || $repeatType == 2) && if (($repeatType == 1 || $repeatType == 2) &&