diff --git a/airtime_mvc/application/controllers/ApiController.php b/airtime_mvc/application/controllers/ApiController.php index c22e63d55..94cb7e518 100644 --- a/airtime_mvc/application/controllers/ApiController.php +++ b/airtime_mvc/application/controllers/ApiController.php @@ -901,7 +901,7 @@ class ApiController extends Zend_Controller_Action foreach ($data as $pair) { list($id, $gain) = $pair; - + // TODO : move this code into model -- RG $file = Application_Model_StoredFile::Recall($p_id = $id)->getPropelOrm(); $file->setDbReplayGain($gain); $file->save(); diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index fae6b5b94..eb538f57f 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -61,11 +61,13 @@ SQL; } /** - * Queries the database for the set of schedules one hour before and after the given time. - * If a show starts and ends within that time that is considered the current show. Then the - * scheduled item before it is the previous show, and the scheduled item after it is the next - * show. This way the dashboard getCurrentPlaylist is very fast. But if any one of the three - * show types are not found through this mechanism a call is made to the old way of querying + * Queries the database for the set of schedules one hour before + * and after the given time. If a show starts and ends within that + * time that is considered the current show. Then the scheduled item + * before it is the previous show, and the scheduled item after it + * is the next show. This way the dashboard getCurrentPlaylist is + * very fast. But if any one of the three show types are not found + * through this mechanism a call is made to the old way of querying * the database to find the track info. **/ public static function GetPrevCurrentNext($p_previousShowID, $p_currentShowID, $p_nextShowID, $p_timeNow) @@ -83,10 +85,16 @@ SQL; LEFT JOIN cc_show_instances si ON st.instance_id = si.id"; $streamColumns = "ws.name AS artist_name, wm.liquidsoap_data AS track_title, "; - $streamJoin = "FROM cc_schedule AS st JOIN cc_webstream ws ON st.stream_id = ws.id - LEFT JOIN cc_show_instances AS si ON st.instance_id = si.id - LEFT JOIN cc_subjs AS sub on sub.id = ws.creator_id - LEFT JOIN (SELECT * FROM cc_webstream_metadata ORDER BY start_time DESC LIMIT 1) AS wm on st.id = wm.instance_id"; + $streamJoin = <<