diff --git a/classes/local/api.php b/classes/local/api.php index f045feb..acf1e70 100644 --- a/classes/local/api.php +++ b/classes/local/api.php @@ -54,8 +54,6 @@ class api extends \curl { private $connecttimeout = 1000; /** @var string the api baseurl */ private $baseurl; - /** @var string the api version */ - public $version; /** @var \OpencastApi\Opencast the opencast endpoints instance */ public $opencastapi; /** @var \OpencastApi\Rest\OcRestClient the opencast REST Client instance */ @@ -229,7 +227,6 @@ public function __construct($instanceid = null, $this->timeout = settings_api::get_apitimeout($storedconfigocinstanceid); $this->connecttimeout = settings_api::get_apiconnecttimeout($storedconfigocinstanceid); $this->baseurl = settings_api::get_apiurl($storedconfigocinstanceid); - $this->version = settings_api::get_apiversion($storedconfigocinstanceid); if (empty($this->username)) { throw new empty_configuration_exception('apiusernameempty', 'tool_opencast'); @@ -259,10 +256,6 @@ public function __construct($instanceid = null, if (array_key_exists('apiconnecttimeout', $customconfigs)) { $this->connecttimeout = $customconfigs['apiconnecttimeout']; } - - if (array_key_exists('apiversion', $customconfigs)) { - $this->version = $customconfigs['version']; - } } // If the admin omitted the protocol part, add the HTTPS protocol on-the-fly. @@ -285,7 +278,6 @@ public function __construct($instanceid = null, 'password' => $this->password, 'timeout' => (intval($this->timeout) / 1000), 'connect_timeout' => (intval($this->connecttimeout) / 1000), - 'version' => !empty($this->version) ? $this->version : null, ]; $this->opencastapi = new \OpencastApi\Opencast($config, [], $enableingest); $this->opencastrestclient = new \OpencastApi\Rest\OcRestClient($config); diff --git a/classes/local/api_testable.php b/classes/local/api_testable.php index 299c8bd..e0fbb37 100644 --- a/classes/local/api_testable.php +++ b/classes/local/api_testable.php @@ -43,7 +43,7 @@ class api_testable extends api { private $httpcode; /** @var string version api version to apply for */ - public $version; + public $version = '1.10.0'; /** @var string the username. */ private string $username; @@ -85,10 +85,6 @@ public function __construct($instanceid = null, $enableingest = false) { $this->timeout = settings_api::get_apitimeout($storedconfigocinstanceid); $this->connecttimeout = settings_api::get_apiconnecttimeout($storedconfigocinstanceid); $this->baseurl = settings_api::get_apiurl($storedconfigocinstanceid); - $this->version = settings_api::get_apiversion($storedconfigocinstanceid); - if (empty($this->version)) { - $this->version = '1.10.0'; - } $config = [ 'url' => $this->baseurl, diff --git a/classes/local/settings_api.php b/classes/local/settings_api.php index 032268b..4386950 100644 --- a/classes/local/settings_api.php +++ b/classes/local/settings_api.php @@ -72,22 +72,6 @@ public static function get_apiurl(int $ocinstanceid) { return get_config('tool_opencast', 'apiurl_' . $ocinstanceid); } - /** - * Returns the api version of an Opencast instance as string - * or false, if the corresponding config was not found. - * - * @param int $ocinstanceid - * The id of the Opencast instance, for that the config is retrieved. - * - * @return string|bool - * The requested config as string or false, if the corresponding config was not found. - * - * @throws \dml_exception - */ - public static function get_apiversion(int $ocinstanceid) { - return get_config('tool_opencast', 'apiversion_' . $ocinstanceid); - } - /** * Returns the api username of an Opencast instance as string * or false, if the corresponding config was not found. diff --git a/classes/settings/admin_settings_builder.php b/classes/settings/admin_settings_builder.php index f1f53cd..1ec838f 100644 --- a/classes/settings/admin_settings_builder.php +++ b/classes/settings/admin_settings_builder.php @@ -301,12 +301,6 @@ private static function add_config_settings_fulltree(\admin_settingpage $setting PARAM_URL ); - self::add_admin_setting_configtext($settings, - 'tool_opencast/apiversion_' . $instanceid, - 'apiversion', 'apiversiondesc', - '' - ); - self::add_admin_setting_configtext($settings, 'tool_opencast/apiusername_' . $instanceid, 'apiusername', 'apiusernamedesc', diff --git a/lang/en/tool_opencast.php b/lang/en/tool_opencast.php index 7b03b93..1719835 100644 --- a/lang/en/tool_opencast.php +++ b/lang/en/tool_opencast.php @@ -42,8 +42,6 @@ $string['apiusername'] = 'Username of Opencast API user'; $string['apiusernamedesc'] = 'Configure the username of the Opencast user who is used to do the Opencast API calls. Moodle uses this Opencast user for all communication with Opencast. Authorization is done by adding suitable roles to the call.'; $string['apiusernameempty'] = 'Username of Opencast API user is not configured correctly. Go to the settings of the Opencast API tool to fix this.'; -$string['apiversion'] = 'Opencast API version'; -$string['apiversiondesc'] = 'This is the api version of the opencast instance (e.g. "v1.11.0") to be configured. This would increase the overall performance when configured, because it reduces the automated version extraction step.
Use this link format to get the api version from your opencast: [your opencast address]/docs.html?path=/api#getversiondefault-8'; $string['configuration'] = 'Configuration'; $string['configuration_instance'] = 'Configuration: {$a}'; $string['connecttimeout'] = 'Connection timeout';