Merge branch '2.5.x' of github.com:sourcefabric/Airtime into 2.5.x
This commit is contained in:
commit
a4e3382959
Binary file not shown.
|
@ -3,14 +3,15 @@
|
|||
# This file is distributed under the same license as the Airtime package.
|
||||
#
|
||||
# Translators:
|
||||
# hoerich <hoerich@gmx.at>, 2014
|
||||
# Sourcefabric <contact@sourcefabric.org>, 2013
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Airtime\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-12-13 12:58-0500\n"
|
||||
"PO-Revision-Date: 2014-01-29 15:10+0000\n"
|
||||
"Last-Translator: andrey.podshivalov\n"
|
||||
"PO-Revision-Date: 2014-02-04 18:19+0000\n"
|
||||
"Last-Translator: hoerich <hoerich@gmx.at>\n"
|
||||
"Language-Team: German (Austria) (http://www.transifex.com/projects/p/airtime/language/de_AT/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
|
Binary file not shown.
|
@ -3,14 +3,15 @@
|
|||
# This file is distributed under the same license as the Airtime package.
|
||||
#
|
||||
# Translators:
|
||||
# hoerich <hoerich@gmx.at>, 2014
|
||||
# Sourcefabric <contact@sourcefabric.org>, 2013
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Airtime\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-12-13 12:58-0500\n"
|
||||
"PO-Revision-Date: 2014-01-29 15:10+0000\n"
|
||||
"Last-Translator: andrey.podshivalov\n"
|
||||
"PO-Revision-Date: 2014-02-04 18:19+0000\n"
|
||||
"Last-Translator: hoerich <hoerich@gmx.at>\n"
|
||||
"Language-Team: German (Germany) (http://www.transifex.com/projects/p/airtime/language/de_DE/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
|
Binary file not shown.
|
@ -10,8 +10,8 @@ msgstr ""
|
|||
"Project-Id-Version: Airtime\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-12-13 12:58-0500\n"
|
||||
"PO-Revision-Date: 2014-02-03 12:34+0000\n"
|
||||
"Last-Translator: KaterinaMic <katerina.michailidis@sourcefabric.org>\n"
|
||||
"PO-Revision-Date: 2014-02-04 10:31+0000\n"
|
||||
"Last-Translator: danielhjames <daniel@64studio.com>\n"
|
||||
"Language-Team: Greek (Greece) (http://www.transifex.com/projects/p/airtime/language/el_GR/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
@ -2210,7 +2210,7 @@ msgstr "Αυτό είναι το Icecast/SHOUTcast όνομα χρήστη κα
|
|||
#: airtime_mvc/application/controllers/LocaleController.php:180
|
||||
msgid ""
|
||||
"Warning: You cannot change this field while the show is currently playing"
|
||||
msgstr ""
|
||||
msgstr "Προειδοποίηση: Δεν μπορείτε να κάνετε αλλαγές κατά την διάρκεια της εκπομπής "
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:181
|
||||
msgid "No result found"
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -3,14 +3,15 @@
|
|||
# This file is distributed under the same license as the Airtime package.
|
||||
#
|
||||
# Translators:
|
||||
# danse <f.occhipinti@gmail.com>, 2014
|
||||
# Sourcefabric <contact@sourcefabric.org>, 2012
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Airtime\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-12-13 12:58-0500\n"
|
||||
"PO-Revision-Date: 2014-01-29 15:11+0000\n"
|
||||
"Last-Translator: andrey.podshivalov\n"
|
||||
"PO-Revision-Date: 2014-02-04 18:10+0000\n"
|
||||
"Last-Translator: danse <f.occhipinti@gmail.com>\n"
|
||||
"Language-Team: Italian (Italy) (http://www.transifex.com/projects/p/airtime/language/it_IT/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
@ -13,7 +13,7 @@ msgstr ""
|
|||
"Project-Id-Version: Airtime\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-12-13 12:58-0500\n"
|
||||
"PO-Revision-Date: 2014-01-31 15:14+0000\n"
|
||||
"PO-Revision-Date: 2014-02-04 17:30+0000\n"
|
||||
"Last-Translator: andrey.podshivalov\n"
|
||||
"Language-Team: Russian (Russia) (http://www.transifex.com/projects/p/airtime/language/ru_RU/)\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
|
@ -73,7 +73,7 @@ msgstr "Окончание звучания"
|
|||
|
||||
#: airtime_mvc/application/layouts/scripts/layout.phtml:56
|
||||
msgid "Set Cue Out"
|
||||
msgstr ""
|
||||
msgstr "Установить окончание звучания"
|
||||
|
||||
#: airtime_mvc/application/layouts/scripts/layout.phtml:73
|
||||
msgid "Cursor"
|
||||
|
@ -551,7 +551,7 @@ msgstr "ВОССТАНОВИТЬ"
|
|||
|
||||
#: airtime_mvc/application/views/scripts/form/preferences_livestream.phtml:153
|
||||
msgid "Show Source Connection URL:"
|
||||
msgstr "URL подключения к Show:"
|
||||
msgstr "URL подключения к программе:"
|
||||
|
||||
#: airtime_mvc/application/views/scripts/form/add-show-rebroadcast-absolute.phtml:4
|
||||
msgid "Choose Days:"
|
||||
|
@ -581,7 +581,7 @@ msgstr "%s's Настройки"
|
|||
|
||||
#: airtime_mvc/application/views/scripts/form/edit-history-item.phtml:45
|
||||
msgid "Choose Show Instance"
|
||||
msgstr "Выберите Show"
|
||||
msgstr "Выберите программу"
|
||||
|
||||
#: airtime_mvc/application/views/scripts/form/edit-history-item.phtml:53
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:391
|
||||
|
@ -769,7 +769,7 @@ msgstr "Источник Master "
|
|||
|
||||
#: airtime_mvc/application/views/scripts/partialviews/header.phtml:38
|
||||
msgid "Show Source"
|
||||
msgstr "Источник Show "
|
||||
msgstr "Источник Show"
|
||||
|
||||
#: airtime_mvc/application/views/scripts/partialviews/header.phtml:45
|
||||
msgid "Scheduled Play"
|
||||
|
@ -1318,7 +1318,7 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/views/scripts/playouthistory/index.phtml:10
|
||||
msgid "Show Summary"
|
||||
msgstr ""
|
||||
msgstr "Данные по прграмме"
|
||||
|
||||
#: airtime_mvc/application/models/Show.php:180
|
||||
msgid "Shows can have a max length of 24 hours."
|
||||
|
@ -1904,7 +1904,7 @@ msgstr "Вы действительно хотите удалить выделе
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:64
|
||||
msgid "Scheduled"
|
||||
msgstr ""
|
||||
msgstr "Запланировано"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:65
|
||||
msgid "Playlist / Block"
|
||||
|
@ -2001,7 +2001,7 @@ msgstr "Вы загружаете файлы. %sПереход на другой
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:113
|
||||
msgid "Open Media Builder"
|
||||
msgstr ""
|
||||
msgstr "Открыть медиа-построитель"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:114
|
||||
msgid "please put in a time '00:00:00 (.0)'"
|
||||
|
@ -2288,7 +2288,7 @@ msgstr "Retreiving данных с сервера ..."
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:207
|
||||
msgid "This show has no scheduled content."
|
||||
msgstr "Это шоу не имеет запланированного содержания."
|
||||
msgstr "Эта программа не имеет запланированного содержания."
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:208
|
||||
msgid "This show is not completely filled with content."
|
||||
|
@ -2546,7 +2546,7 @@ msgstr "Отменить"
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:287
|
||||
msgid "Fade Editor"
|
||||
msgstr ""
|
||||
msgstr "Редактор затухания"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:288
|
||||
msgid "Cue Editor"
|
||||
|
@ -2627,11 +2627,11 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:317
|
||||
msgid "View schedule"
|
||||
msgstr ""
|
||||
msgstr "Показать календарь"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:318
|
||||
msgid "View show content"
|
||||
msgstr ""
|
||||
msgstr "Показать программу"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:319
|
||||
msgid "DJs can do the following:"
|
||||
|
@ -2643,7 +2643,7 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:321
|
||||
msgid "Import media files"
|
||||
msgstr ""
|
||||
msgstr "Импорт медиа-файлов"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:322
|
||||
msgid "Create playlists, smart blocks, and webstreams"
|
||||
|
@ -2659,11 +2659,11 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:325
|
||||
msgid "View and manage show content"
|
||||
msgstr ""
|
||||
msgstr "Редактировать программу"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:326
|
||||
msgid "Schedule shows"
|
||||
msgstr ""
|
||||
msgstr "Планировать программу"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:327
|
||||
msgid "Manage all library content"
|
||||
|
@ -2671,11 +2671,11 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:328
|
||||
msgid "Admins can do the following:"
|
||||
msgstr ""
|
||||
msgstr "Администраторы могут:"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:329
|
||||
msgid "Manage preferences"
|
||||
msgstr ""
|
||||
msgstr "Настроить предпочтения"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:330
|
||||
msgid "Manage users"
|
||||
|
@ -2823,15 +2823,15 @@ msgstr "Ошибка инициализации."
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:376
|
||||
msgid "HTTP Error."
|
||||
msgstr ""
|
||||
msgstr "Ошибка HTTP."
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:377
|
||||
msgid "Security error."
|
||||
msgstr ""
|
||||
msgstr "Ошибка безопасности."
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:378
|
||||
msgid "Generic error."
|
||||
msgstr ""
|
||||
msgstr "Общая ошибка."
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:379
|
||||
msgid "IO error."
|
||||
|
@ -2865,11 +2865,11 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:389
|
||||
msgid "Create Entry"
|
||||
msgstr ""
|
||||
msgstr "Создать"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:390
|
||||
msgid "Edit History Record"
|
||||
msgstr ""
|
||||
msgstr "Редактировать историю"
|
||||
|
||||
#: airtime_mvc/application/controllers/LocaleController.php:393
|
||||
#, php-format
|
||||
|
@ -2999,7 +2999,7 @@ msgstr "Пользователь успешно обновлен!"
|
|||
|
||||
#: airtime_mvc/application/controllers/UserController.php:154
|
||||
msgid "Settings updated successfully!"
|
||||
msgstr ""
|
||||
msgstr "Изменения в настройках сохранены!"
|
||||
|
||||
#: airtime_mvc/application/common/DateHelper.php:213
|
||||
#, php-format
|
||||
|
@ -3047,7 +3047,7 @@ msgstr "Пароль:"
|
|||
#: airtime_mvc/application/forms/AddUser.php:42
|
||||
#: airtime_mvc/application/forms/EditUser.php:52
|
||||
msgid "Verify Password:"
|
||||
msgstr ""
|
||||
msgstr "Повторите пароль:"
|
||||
|
||||
#: airtime_mvc/application/forms/AddUser.php:51
|
||||
#: airtime_mvc/application/forms/EditUser.php:62
|
||||
|
@ -3190,7 +3190,7 @@ msgstr "Длительность:"
|
|||
|
||||
#: airtime_mvc/application/forms/AddShowWhen.php:83
|
||||
msgid "Timezone:"
|
||||
msgstr ""
|
||||
msgstr "Временная зона:"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowWhen.php:92
|
||||
msgid "Repeats?"
|
||||
|
@ -3218,7 +3218,7 @@ msgstr "Не может иметь длительность более 24 час
|
|||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:10
|
||||
msgid "Link:"
|
||||
msgstr ""
|
||||
msgstr "Ссылка:"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:16
|
||||
msgid "Repeat Type:"
|
||||
|
@ -3230,15 +3230,15 @@ msgstr "Еженедельно"
|
|||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:20
|
||||
msgid "every 2 weeks"
|
||||
msgstr ""
|
||||
msgstr "каждые 2 недели"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:21
|
||||
msgid "every 3 weeks"
|
||||
msgstr ""
|
||||
msgstr "каждые 3 недели"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:22
|
||||
msgid "every 4 weeks"
|
||||
msgstr ""
|
||||
msgstr "каждые 4 недели"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:23
|
||||
msgid "monthly"
|
||||
|
@ -3254,11 +3254,11 @@ msgstr ""
|
|||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:50
|
||||
msgid "day of the month"
|
||||
msgstr ""
|
||||
msgstr "день месяца"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:50
|
||||
msgid "day of the week"
|
||||
msgstr ""
|
||||
msgstr "день недели"
|
||||
|
||||
#: airtime_mvc/application/forms/AddShowRepeats.php:56
|
||||
#: airtime_mvc/application/forms/DateRange.php:44
|
||||
|
@ -3376,7 +3376,7 @@ msgstr "'%значение%' не входит в промежуток '%min%'
|
|||
|
||||
#: airtime_mvc/application/forms/helpers/ValidationTypes.php:89
|
||||
msgid "Passwords do not match"
|
||||
msgstr ""
|
||||
msgstr "Пароли не совпадают"
|
||||
|
||||
#: airtime_mvc/application/forms/StreamSettingSubForm.php:48
|
||||
msgid "Enabled:"
|
||||
|
@ -3421,11 +3421,11 @@ msgstr "Точка монтирования"
|
|||
|
||||
#: airtime_mvc/application/forms/StreamSettingSubForm.php:195
|
||||
msgid "Admin User"
|
||||
msgstr ""
|
||||
msgstr "Администратор"
|
||||
|
||||
#: airtime_mvc/application/forms/StreamSettingSubForm.php:207
|
||||
msgid "Admin Password"
|
||||
msgstr ""
|
||||
msgstr "Пароль администратора"
|
||||
|
||||
#: airtime_mvc/application/forms/StreamSettingSubForm.php:232
|
||||
msgid "Server cannot be empty."
|
||||
|
@ -3469,7 +3469,7 @@ msgstr "Название станции - Название программы"
|
|||
|
||||
#: airtime_mvc/application/forms/StreamSetting.php:63
|
||||
msgid "Off Air Metadata"
|
||||
msgstr ""
|
||||
msgstr "Отключить мета-данные"
|
||||
|
||||
#: airtime_mvc/application/forms/StreamSetting.php:69
|
||||
msgid "Enable Replay Gain"
|
||||
|
@ -3579,11 +3579,11 @@ msgstr "Введите время в секундах 0 {0,0}"
|
|||
|
||||
#: airtime_mvc/application/forms/GeneralPreferences.php:52
|
||||
msgid "Default Fade In (s):"
|
||||
msgstr ""
|
||||
msgstr "Возрастание по умолчанию:"
|
||||
|
||||
#: airtime_mvc/application/forms/GeneralPreferences.php:71
|
||||
msgid "Default Fade Out (s):"
|
||||
msgstr ""
|
||||
msgstr "Затухание по умолчанию:"
|
||||
|
||||
#: airtime_mvc/application/forms/GeneralPreferences.php:89
|
||||
#, php-format
|
||||
|
@ -3602,7 +3602,7 @@ msgstr "Активировано"
|
|||
|
||||
#: airtime_mvc/application/forms/GeneralPreferences.php:97
|
||||
msgid "Default Interface Language"
|
||||
msgstr ""
|
||||
msgstr "Язык по умолчанию"
|
||||
|
||||
#: airtime_mvc/application/forms/GeneralPreferences.php:105
|
||||
msgid "Station Timezone"
|
||||
|
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
|
@ -46,6 +46,9 @@ set_include_path(APPLICATION_PATH . '/services' . PATH_SEPARATOR . get_include_p
|
|||
//models
|
||||
set_include_path(APPLICATION_PATH . '/models' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
//Controllers.
|
||||
set_include_path(APPLICATION_PATH . '/controllers' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
//Controller plugins.
|
||||
set_include_path(APPLICATION_PATH . '/controllers/plugins' . PATH_SEPARATOR . get_include_path());
|
||||
|
||||
|
@ -58,18 +61,16 @@ set_include_path(APPLICATION_PATH . '/../tests/application/helpers' . PATH_SEPAR
|
|||
//Zend framework
|
||||
if (file_exists('/usr/share/php/libzend-framework-php')) {
|
||||
set_include_path('/usr/share/php/libzend-framework-php' . PATH_SEPARATOR . get_include_path());
|
||||
set_include_path('/usr/share/php/libzend-framework-php/Zend/Test/PHPUnit' . PATH_SEPARATOR . get_include_path());
|
||||
}
|
||||
|
||||
require_once 'Zend/Application.php';
|
||||
require_once 'Zend/Config.php';
|
||||
//require_once 'helpers/TestHelper.php';
|
||||
|
||||
require_once APPLICATION_PATH.'/configs/conf.php';
|
||||
require_once 'propel/runtime/lib/Propel.php';
|
||||
Propel::init("../application/configs/airtime-conf-production.php");
|
||||
|
||||
#require_once 'DatabaseTestCase.php';
|
||||
require_once 'Zend/Session.php';
|
||||
Zend_Session::start();
|
||||
|
||||
//TestHelper::installTestDatabase();
|
||||
|
|
|
@ -61,7 +61,9 @@ class TestHelper
|
|||
//Add any tables that shouldn't be cleared here.
|
||||
// cc_subjs - Most of Airtime requires an admin account to work, which has id=1,
|
||||
// so don't clear it.
|
||||
$tablesToNotClear = array("cc_subjs");
|
||||
// cc_music_dirs - Has foreign key constraints against cc_files, so we clear cc_files
|
||||
// first and ckear cc_music_dirs after
|
||||
$tablesToNotClear = array("cc_subjs", "cc_music_dirs");
|
||||
|
||||
$con->beginTransaction();
|
||||
foreach ($rows as $row) {
|
||||
|
@ -78,6 +80,11 @@ class TestHelper
|
|||
$sql = "DELETE FROM $tablename";
|
||||
AirtimeInstall::InstallQuery($sql, false);
|
||||
}
|
||||
|
||||
//Now that cc_files is empty, clearing cc_music_dirs should work
|
||||
$sql = "DELETE FROM cc_music_dirs";
|
||||
AirtimeInstall::InstallQuery($sql, false);
|
||||
|
||||
$con->commit();
|
||||
|
||||
//Because we're DELETEing all the rows instead of using TRUNCATE (for speed),
|
||||
|
|
|
@ -10,14 +10,18 @@ class PreferenceUnitTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
TestHelper::installTestDatabase();
|
||||
TestHelper::setupZendBootstrap();
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
public function testSetHeadTitle()
|
||||
{
|
||||
$title = "unit test";
|
||||
//This function is confusing and doesn't really work so we're just gonna let it slide...
|
||||
Application_Model_Preference::SetHeadTitle($title);
|
||||
//$this->assertEquals(Application_Model_Preference::GetHeadTitle(), $title);
|
||||
$this->assertEquals(Application_Model_Preference::GetHeadTitle(), $title);
|
||||
}
|
||||
*/
|
||||
|
||||
public function testSetShowsPopulatedUntil()
|
||||
{
|
||||
|
|
|
@ -1,11 +1,97 @@
|
|||
<?php
|
||||
require_once "../application/configs/conf.php";
|
||||
//require_once "../application/configs/conf.php";
|
||||
require_once "TestHelper.php";
|
||||
require_once "ShowServiceData.php";
|
||||
require_once "Schedule.php";
|
||||
require_once "Zend/Controller/Action.php";
|
||||
require_once "ControllerTestCase.php";
|
||||
require_once "ApiController.php";
|
||||
|
||||
class ScheduleUnitTest extends PHPUnit_Framework_TestCase
|
||||
class ScheduleUnitTest extends Zend_Test_PHPUnit_ControllerTestCase //PHPUnit_Framework_TestCase
|
||||
{
|
||||
public function setUp()
|
||||
{
|
||||
TestHelper::installTestDatabase();
|
||||
TestHelper::setupZendBootstrap();
|
||||
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function testCheckOverlappingShows()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testIsFileScheduledInTheFuture()
|
||||
{
|
||||
TestHelper::loginUser();
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
|
||||
$testShowData = ShowServiceData::getNoRepeatNoRRData();
|
||||
$showService = new Application_Service_ShowService();
|
||||
$futureDate = new DateTime();
|
||||
$futureDate->add(new DateInterval('P1Y')); //1 year into the future
|
||||
$futureDateString = $futureDate->format('Y-m-d');
|
||||
|
||||
$testShowData["add_show_start_date"] = $futureDateString;
|
||||
$testShowData["add_show_end_date"] = $futureDateString;
|
||||
$testShowData["add_show_end_date_no_repeat"] = $futureDateString;
|
||||
|
||||
//Fudge the "populated until" date to workaround and issue where the default
|
||||
//value will prevent anything from actually being scheduled. Normally this isn't
|
||||
//a problem because as soon as you view the calendar for the first time, this is
|
||||
//set to a week ahead in the future.
|
||||
$populateUntil = new DateTime("now", new DateTimeZone('UTC'));
|
||||
$populateUntil = $populateUntil->add(new DateInterval("P2Y")); //2 years ahead in the future.
|
||||
Application_Model_Preference::SetShowsPopulatedUntil($populateUntil);
|
||||
|
||||
//$showService->setCcShow($testShowData); //Denise says this is not needed.
|
||||
$showService->addUpdateShow($testShowData); //Create show instances
|
||||
|
||||
// Because files are stored relative to their watch directory,
|
||||
// we need to set the "stor" path before we can successfully
|
||||
// create a fake file in the database.
|
||||
//Copy paste from airtime-db-install.php:
|
||||
$stor_dir = "/tmp";
|
||||
$con = Propel::getConnection();
|
||||
$sql = "INSERT INTO cc_music_dirs (directory, type) VALUES ('$stor_dir', 'stor')";
|
||||
try {
|
||||
$con->exec($sql);
|
||||
} catch (Exception $e) {
|
||||
echo " * Failed inserting {$stor_dir} in cc_music_dirs".PHP_EOL;
|
||||
echo " * Message {$e->getMessage()}".PHP_EOL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Insert a fake file into the database
|
||||
$request = $this->getRequest();
|
||||
$params = $request->getParams();
|
||||
$params['action'] = '';
|
||||
$params['api_key'] = $CC_CONFIG["apiKey"][0];
|
||||
$request->setParams($params);
|
||||
|
||||
$metadata = array("MDATA_KEY_FILEPATH" => "/tmp/foobar.mp3",
|
||||
"MDATA_KEY_DURATION" => "00:01:00",
|
||||
"is_record" => false);
|
||||
|
||||
//Create the file in the database via the HTTP API.
|
||||
$apiController = new ApiController($this->request, $this->getResponse());
|
||||
$results = $apiController->dispatchMetadata($metadata, "create");
|
||||
$fileId = $results["fileid"];
|
||||
$this->assertNotEquals($fileId, -1);
|
||||
$this->assertEquals($fileId, 1);
|
||||
|
||||
//The file should not be scheduled in the future (or at all) at this point
|
||||
$scheduleModel = new Application_Model_Schedule();
|
||||
$scheduleModel->IsFileScheduledInTheFuture($fileId);
|
||||
$this->assertEquals($scheduleModel->IsFileScheduledInTheFuture($fileId), false);
|
||||
|
||||
//Schedule the fake file in the test show, which should be in the future.
|
||||
$showInstance = new Application_Model_ShowInstance(1);
|
||||
$showInstance->addFileToShow($fileId);
|
||||
|
||||
//Test the function we actually want to test. :-)
|
||||
$this->assertEquals($scheduleModel->IsFileScheduledInTheFuture($fileId), true);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
Class ShowServiceData
|
||||
{
|
||||
//Just a regular show - Non repeating, and not a recording & rebroadcast show.
|
||||
public static function getNoRepeatNoRRData()
|
||||
{
|
||||
return array(
|
||||
|
@ -487,4 +488,4 @@ Class ShowServiceData
|
|||
"add_show_day_check" => array(5)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ import sys
|
|||
import time
|
||||
import urllib
|
||||
import urllib2
|
||||
import socket
|
||||
import logging
|
||||
import json
|
||||
import base64
|
||||
|
@ -121,6 +122,9 @@ class ApcUrl(object):
|
|||
else: return self.base_url
|
||||
|
||||
class ApiRequest(object):
|
||||
|
||||
API_HTTP_REQUEST_TIMEOUT = 30 # 30 second HTTP request timeout
|
||||
|
||||
def __init__(self, name, url, logger=None):
|
||||
self.name = name
|
||||
self.url = url
|
||||
|
@ -134,9 +138,15 @@ class ApiRequest(object):
|
|||
self.logger.debug(final_url)
|
||||
try:
|
||||
req = urllib2.Request(final_url, _post_data)
|
||||
f = urllib2.urlopen(req)
|
||||
f = urllib2.urlopen(req, timeout=ApiRequest.API_HTTP_REQUEST_TIMEOUT)
|
||||
content_type = f.info().getheader('Content-Type')
|
||||
response = f.read()
|
||||
#Everything that calls an ApiRequest should be catching URLError explicitly
|
||||
#(according to the other comments in this file and a cursory grep through the code)
|
||||
#Note that URLError can occur for timeouts as well as socket.timeout
|
||||
except socket.timeout:
|
||||
self.logger.error('HTTP request to %s timed out', final_url)
|
||||
raise
|
||||
except Exception, e:
|
||||
#self.logger.error('Exception: %s', e)
|
||||
#self.logger.error("traceback: %s", traceback.format_exc())
|
||||
|
@ -277,7 +287,7 @@ class AirtimeApiClient(object):
|
|||
|
||||
try:
|
||||
request = urllib2.Request(url, data, headers)
|
||||
response = urllib2.urlopen(request).read().strip()
|
||||
response = urllib2.urlopen(request, timeout=ApiClient.API_HTTP_REQUEST_TIMEOUT).read().strip()
|
||||
|
||||
logger.info("uploaded show result %s", response)
|
||||
break
|
||||
|
|
|
@ -11,4 +11,4 @@ SCRIPT=`readlink -f $0`
|
|||
SCRIPTPATH=`dirname $SCRIPT`
|
||||
|
||||
cd ${SCRIPTPATH}/../
|
||||
timeout 45 python pyponotify.py "$@"
|
||||
timeout --signal=KILL 45 python pyponotify.py "$@"
|
||||
|
|
Loading…
Reference in New Issue