2017-01-17 08:46:43 +00:00
|
|
|
<?php
|
2018-08-04 22:05:14 +00:00
|
|
|
namespace App\Entity;
|
2017-01-17 08:46:43 +00:00
|
|
|
|
2018-12-22 00:01:04 +00:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
|
2017-01-17 08:46:43 +00:00
|
|
|
/**
|
2018-12-20 11:33:49 +00:00
|
|
|
* @ORM\Table(name="settings")
|
2019-09-29 07:50:24 +00:00
|
|
|
* @ORM\Entity()
|
2017-01-17 08:46:43 +00:00
|
|
|
*/
|
2017-08-17 18:28:48 +00:00
|
|
|
class Settings
|
2017-01-17 08:46:43 +00:00
|
|
|
{
|
2018-11-15 13:41:52 +00:00
|
|
|
// Predefined settings constants.
|
2019-09-04 18:00:51 +00:00
|
|
|
public const BASE_URL = 'base_url';
|
|
|
|
public const INSTANCE_NAME = 'instance_name';
|
2020-01-21 06:02:06 +00:00
|
|
|
|
|
|
|
public const PREFER_BROWSER_URL = 'prefer_browser_url';
|
2019-09-04 18:00:51 +00:00
|
|
|
public const USE_RADIO_PROXY = 'use_radio_proxy';
|
|
|
|
public const HISTORY_KEEP_DAYS = 'history_keep_days';
|
2020-03-29 07:16:41 +00:00
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const ALWAYS_USE_SSL = 'always_use_ssl';
|
|
|
|
public const API_ACCESS_CONTROL = 'api_access_control';
|
2019-07-31 18:47:12 +00:00
|
|
|
public const NOWPLAYING_USE_WEBSOCKETS = 'nowplaying_use_websockets';
|
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const LISTENER_ANALYTICS = 'analytics';
|
|
|
|
public const CENTRAL_UPDATES = 'central_updates_channel';
|
2018-11-15 13:41:52 +00:00
|
|
|
|
|
|
|
// Custom branding constants.
|
2019-09-04 18:00:51 +00:00
|
|
|
public const PUBLIC_THEME = 'public_theme';
|
|
|
|
public const HIDE_ALBUM_ART = 'hide_album_art';
|
2019-01-23 21:59:25 +00:00
|
|
|
public const HOMEPAGE_REDIRECT_URL = 'homepage_redirect_url';
|
|
|
|
public const DEFAULT_ALBUM_ART_URL = 'default_album_art_url';
|
2019-09-04 18:00:51 +00:00
|
|
|
public const HIDE_PRODUCT_NAME = 'hide_product_name';
|
|
|
|
public const CUSTOM_CSS_PUBLIC = 'custom_css_public';
|
|
|
|
public const CUSTOM_JS_PUBLIC = 'custom_js_public';
|
|
|
|
public const CUSTOM_CSS_INTERNAL = 'custom_css_internal';
|
2018-11-15 13:41:52 +00:00
|
|
|
|
2019-05-23 15:29:22 +00:00
|
|
|
// Backup settings
|
2019-09-04 18:00:51 +00:00
|
|
|
public const BACKUP_ENABLED = 'backup_enabled';
|
|
|
|
public const BACKUP_TIME = 'backup_time';
|
|
|
|
public const BACKUP_EXCLUDE_MEDIA = 'backup_exclude_media';
|
|
|
|
public const BACKUP_KEEP_COPIES = 'backup_keep_copies';
|
2019-05-23 15:29:22 +00:00
|
|
|
|
2018-11-15 13:41:52 +00:00
|
|
|
// Internal settings
|
2019-09-04 18:00:51 +00:00
|
|
|
public const SETUP_COMPLETE = 'setup_complete';
|
2018-11-15 13:41:52 +00:00
|
|
|
|
2019-01-23 21:59:25 +00:00
|
|
|
public const NOWPLAYING_LAST_STARTED = 'nowplaying_last_started';
|
2019-09-04 18:00:51 +00:00
|
|
|
public const NOWPLAYING_LAST_RUN = 'nowplaying_last_run';
|
2020-04-01 06:01:32 +00:00
|
|
|
public const NOWPLAYING = 'nowplaying';
|
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const SHORT_SYNC_LAST_RUN = 'sync_fast_last_run';
|
|
|
|
public const MEDIUM_SYNC_LAST_RUN = 'sync_last_run';
|
|
|
|
public const LONG_SYNC_LAST_RUN = 'sync_slow_last_run';
|
2018-11-15 13:41:52 +00:00
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const UPDATES_NONE = 0;
|
|
|
|
public const UPDATES_ALL = 1;
|
|
|
|
public const UPDATES_RELEASE_ONLY = 2;
|
2018-12-15 19:34:18 +00:00
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const UNIQUE_IDENTIFIER = 'central_app_uuid';
|
|
|
|
public const UPDATE_RESULTS = 'central_update_results';
|
|
|
|
public const UPDATE_LAST_RUN = 'central_update_last_run';
|
2019-01-05 15:25:20 +00:00
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const EXTERNAL_IP = 'external_ip';
|
2019-08-10 07:45:17 +00:00
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public const BACKUP_LAST_RUN = 'backup_last_run';
|
|
|
|
public const BACKUP_LAST_RESULT = 'backup_last_result';
|
|
|
|
public const BACKUP_LAST_OUTPUT = 'backup_last_output';
|
2019-05-23 15:29:22 +00:00
|
|
|
|
2020-01-08 20:37:56 +00:00
|
|
|
public const GEOLITE_LICENSE_KEY = 'geolite_license_key';
|
|
|
|
public const GEOLITE_LAST_RUN = 'geolite_last_run';
|
|
|
|
|
2017-01-17 08:46:43 +00:00
|
|
|
/**
|
2018-12-20 11:33:49 +00:00
|
|
|
* @ORM\Column(name="setting_key", type="string", length=64)
|
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue(strategy="NONE")
|
2017-08-17 18:28:48 +00:00
|
|
|
* @var string
|
2017-01-17 08:46:43 +00:00
|
|
|
*/
|
|
|
|
protected $setting_key;
|
|
|
|
|
2017-08-17 18:28:48 +00:00
|
|
|
/**
|
2020-08-18 04:15:54 +00:00
|
|
|
* @ORM\Column(name="setting_value", type="json", nullable=true)
|
2017-08-17 18:28:48 +00:00
|
|
|
* @var mixed
|
|
|
|
*/
|
2017-01-17 08:46:43 +00:00
|
|
|
protected $setting_value;
|
2017-08-17 18:28:48 +00:00
|
|
|
|
|
|
|
public function __construct(string $setting_key)
|
|
|
|
{
|
|
|
|
$this->setting_key = $setting_key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSettingKey(): string
|
|
|
|
{
|
|
|
|
return $this->setting_key;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getSettingValue()
|
|
|
|
{
|
|
|
|
return $this->setting_value;
|
|
|
|
}
|
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public function setSettingValue($setting_value)
|
2017-08-17 18:28:48 +00:00
|
|
|
{
|
2019-09-04 18:00:51 +00:00
|
|
|
$this->setting_value = $setting_value;
|
2017-08-17 18:28:48 +00:00
|
|
|
}
|
|
|
|
|
2019-09-04 18:00:51 +00:00
|
|
|
public function getValue()
|
2017-08-17 18:28:48 +00:00
|
|
|
{
|
2019-09-04 18:00:51 +00:00
|
|
|
return $this->setting_value;
|
2017-08-17 18:28:48 +00:00
|
|
|
}
|
2018-08-04 22:05:14 +00:00
|
|
|
}
|