exports.CONFIG_ITEMS = {
    // Host
    'ytdl_url': {
        'key': 'ytdl_url',
        'path': 'YoutubeDLMaterial.Host.url'
    },
    'ytdl_port': {
        'key': 'ytdl_port',
        'path': 'YoutubeDLMaterial.Host.port'
    },
    'ytdl_ssl_cert_path': {
        'key': 'ytdl_ssl_cert_path',
        'path': 'YoutubeDLMaterial.Host.ssl_cert_path'
    },
    'ytdl_ssl_key_path': {
        'key': 'ytdl_ssl_key_path',
        'path': 'YoutubeDLMaterial.Host.ssl_key_path'
    },
    'ytdl_reverse_proxy_whitelist': {
        'key': 'ytdl_reverse_proxy_whitelist',
        'path': 'YoutubeDLMaterial.Host.reverse_proxy_whitelist'
    },

    // Downloader
    'ytdl_audio_folder_path': {
        'key': 'ytdl_audio_folder_path',
        'path': 'YoutubeDLMaterial.Downloader.path-audio'
    },
    'ytdl_video_folder_path': {
        'key': 'ytdl_video_folder_path',
        'path': 'YoutubeDLMaterial.Downloader.path-video'
    },
    'ytdl_default_file_output': {
        'key': 'ytdl_default_file_output',
        'path': 'YoutubeDLMaterial.Downloader.default_file_output'
    },
    'ytdl_use_youtubedl_archive': {
        'key': 'ytdl_use_youtubedl_archive',
        'path': 'YoutubeDLMaterial.Downloader.use_youtubedl_archive'
    },
    'ytdl_custom_args': {
        'key': 'ytdl_custom_args',
        'path': 'YoutubeDLMaterial.Downloader.custom_args'
    },
    'ytdl_include_thumbnail': {
        'key': 'ytdl_include_thumbnail',
        'path': 'YoutubeDLMaterial.Downloader.include_thumbnail'
    },
    'ytdl_include_metadata': {
        'key': 'ytdl_include_metadata',
        'path': 'YoutubeDLMaterial.Downloader.include_metadata'
    },
    'ytdl_max_concurrent_downloads': {
        'key': 'ytdl_max_concurrent_downloads',
        'path': 'YoutubeDLMaterial.Downloader.max_concurrent_downloads'
    },
    'ytdl_download_rate_limit': {
        'key': 'ytdl_download_rate_limit',
        'path': 'YoutubeDLMaterial.Downloader.download_rate_limit'
    },

    // Extra
    'ytdl_title_top': {
        'key': 'ytdl_title_top',
        'path': 'YoutubeDLMaterial.Extra.title_top'
    },
    'ytdl_file_manager_enabled': {
        'key': 'ytdl_file_manager_enabled',
        'path': 'YoutubeDLMaterial.Extra.file_manager_enabled'
    },
    'ytdl_allow_quality_select': {
        'key': 'ytdl_allow_quality_select',
        'path': 'YoutubeDLMaterial.Extra.allow_quality_select'
    },
    'ytdl_download_only_mode': {
        'key': 'ytdl_download_only_mode',
        'path': 'YoutubeDLMaterial.Extra.download_only_mode'
    },
    'ytdl_force_autoplay': {
        'key': 'ytdl_force_autoplay',
        'path': 'YoutubeDLMaterial.Extra.force_autoplay'
    },
    'ytdl_enable_downloads_manager': {
        'key': 'ytdl_enable_downloads_manager',
        'path': 'YoutubeDLMaterial.Extra.enable_downloads_manager'
    },
    'ytdl_allow_playlist_categorization': {
        'key': 'ytdl_allow_playlist_categorization',
        'path': 'YoutubeDLMaterial.Extra.allow_playlist_categorization'
    },
    'ytdl_enable_notifications': {
        'key': 'ytdl_enable_notifications',
        'path': 'YoutubeDLMaterial.Extra.enable_notifications'
    },
    'ytdl_enable_all_notifications': {
        'key': 'ytdl_enable_all_notifications',
        'path': 'YoutubeDLMaterial.Extra.enable_all_notifications'
    },
    'ytdl_allowed_notification_types': {
        'key': 'ytdl_allowed_notification_types',
        'path': 'YoutubeDLMaterial.Extra.allowed_notification_types'
    },
    'ytdl_enable_rss_feed': {
        'key': 'ytdl_enable_rss_feed',
        'path': 'YoutubeDLMaterial.Extra.enable_rss_feed'
    },

    // API
    'ytdl_use_api_key': {
        'key': 'ytdl_use_api_key',
        'path': 'YoutubeDLMaterial.API.use_API_key'
    },
    'ytdl_api_key': {
        'key': 'ytdl_api_key',
        'path': 'YoutubeDLMaterial.API.API_key'
    },
    'ytdl_use_youtube_api': {
        'key': 'ytdl_use_youtube_api',
        'path': 'YoutubeDLMaterial.API.use_youtube_API'
    },
    'ytdl_youtube_api_key': {
        'key': 'ytdl_youtube_api_key',
        'path': 'YoutubeDLMaterial.API.youtube_API_key'
    },
    'ytdl_twitch_auto_download_chat': {
        'key': 'ytdl_twitch_auto_download_chat',
        'path': 'YoutubeDLMaterial.API.twitch_auto_download_chat'
    },
    'ytdl_use_sponsorblock_api': {
        'key': 'ytdl_use_sponsorblock_api',
        'path': 'YoutubeDLMaterial.API.use_sponsorblock_API'
    },
    'ytdl_generate_nfo_files': {
        'key': 'ytdl_generate_nfo_files',
        'path': 'YoutubeDLMaterial.API.generate_NFO_files'
    },
    'ytdl_use_ntfy_API': {
        'key': 'ytdl_use_ntfy_API',
        'path': 'YoutubeDLMaterial.API.use_ntfy_API'
    },
    'ytdl_ntfy_topic_url': {
        'key': 'ytdl_ntfy_topic_url',
        'path': 'YoutubeDLMaterial.API.ntfy_topic_URL'
    },
    'ytdl_use_gotify_API': {
        'key': 'ytdl_use_gotify_API',
        'path': 'YoutubeDLMaterial.API.use_gotify_API'
    },
    'ytdl_gotify_server_url': {
        'key': 'ytdl_gotify_server_url',
        'path': 'YoutubeDLMaterial.API.gotify_server_URL'
    },
    'ytdl_gotify_app_token': {
        'key': 'ytdl_gotify_app_token',
        'path': 'YoutubeDLMaterial.API.gotify_app_token'
    },
    'ytdl_use_telegram_API': {
        'key': 'ytdl_use_telegram_API',
        'path': 'YoutubeDLMaterial.API.use_telegram_API'
    },
    'ytdl_telegram_bot_token': {
        'key': 'ytdl_telegram_bot_token',
        'path': 'YoutubeDLMaterial.API.telegram_bot_token'
    },
    'ytdl_telegram_chat_id': {
        'key': 'ytdl_telegram_chat_id',
        'path': 'YoutubeDLMaterial.API.telegram_chat_id'
    },
    'ytdl_telegram_webhook_proxy': {
        'key': 'ytdl_telegram_webhook_proxy',
        'path': 'YoutubeDLMaterial.API.telegram_webhook_proxy'
    },
    'ytdl_webhook_url': {
        'key': 'ytdl_webhook_url',
        'path': 'YoutubeDLMaterial.API.webhook_URL'
    },
    'ytdl_discord_webhook_url': {
        'key': 'ytdl_discord_webhook_url',
        'path': 'YoutubeDLMaterial.API.discord_webhook_URL'
    },
    'ytdl_slack_webhook_url': {
        'key': 'ytdl_slack_webhook_url',
        'path': 'YoutubeDLMaterial.API.slack_webhook_URL'
    },


    // Themes
    'ytdl_default_theme': {
        'key': 'ytdl_default_theme',
        'path': 'YoutubeDLMaterial.Themes.default_theme'
    },
    'ytdl_allow_theme_change': {
        'key': 'ytdl_allow_theme_change',
        'path': 'YoutubeDLMaterial.Themes.allow_theme_change'
    },

    // Subscriptions
    'ytdl_allow_subscriptions': {
        'key': 'ytdl_allow_subscriptions',
        'path': 'YoutubeDLMaterial.Subscriptions.allow_subscriptions'
    },
    'ytdl_subscriptions_base_path': {
        'key': 'ytdl_subscriptions_base_path',
        'path': 'YoutubeDLMaterial.Subscriptions.subscriptions_base_path'
    },
    'ytdl_subscriptions_check_interval': {
        'key': 'ytdl_subscriptions_check_interval',
        'path': 'YoutubeDLMaterial.Subscriptions.subscriptions_check_interval'
    },
    'ytdl_subscriptions_redownload_fresh_uploads': {
        'key': 'ytdl_subscriptions_redownload_fresh_uploads',
        'path': 'YoutubeDLMaterial.Subscriptions.redownload_fresh_uploads'
    },

    // Users
    'ytdl_users_base_path': {
        'key': 'ytdl_users_base_path',
        'path': 'YoutubeDLMaterial.Users.base_path'
    },
    'ytdl_allow_registration': {
        'key': 'ytdl_allow_registration',
        'path': 'YoutubeDLMaterial.Users.allow_registration'
    },
    'ytdl_auth_method': {
        'key': 'ytdl_auth_method',
        'path': 'YoutubeDLMaterial.Users.auth_method'
    },
    'ytdl_ldap_config': {
        'key': 'ytdl_ldap_config',
        'path': 'YoutubeDLMaterial.Users.ldap_config'
    },
    'ytdl_oidc_enabled': {
        'key': 'ytdl_oidc_enabled',
        'path': 'YoutubeDLMaterial.Users.oidc.enabled'
    },
    'ytdl_oidc_issuer_url': {
        'key': 'ytdl_oidc_issuer_url',
        'path': 'YoutubeDLMaterial.Users.oidc.issuer_url'
    },
    'ytdl_oidc_client_id': {
        'key': 'ytdl_oidc_client_id',
        'path': 'YoutubeDLMaterial.Users.oidc.client_id'
    },
    'ytdl_oidc_client_secret': {
        'key': 'ytdl_oidc_client_secret',
        'path': 'YoutubeDLMaterial.Users.oidc.client_secret'
    },
    'ytdl_oidc_redirect_uri': {
        'key': 'ytdl_oidc_redirect_uri',
        'path': 'YoutubeDLMaterial.Users.oidc.redirect_uri'
    },
    'ytdl_oidc_scope': {
        'key': 'ytdl_oidc_scope',
        'path': 'YoutubeDLMaterial.Users.oidc.scope'
    },
    'ytdl_oidc_auto_register': {
        'key': 'ytdl_oidc_auto_register',
        'path': 'YoutubeDLMaterial.Users.oidc.auto_register'
    },
    'ytdl_oidc_admin_claim': {
        'key': 'ytdl_oidc_admin_claim',
        'path': 'YoutubeDLMaterial.Users.oidc.admin_claim'
    },
    'ytdl_oidc_admin_value': {
        'key': 'ytdl_oidc_admin_value',
        'path': 'YoutubeDLMaterial.Users.oidc.admin_value'
    },
    'ytdl_oidc_group_claim': {
        'key': 'ytdl_oidc_group_claim',
        'path': 'YoutubeDLMaterial.Users.oidc.group_claim'
    },
    'ytdl_oidc_allowed_groups': {
        'key': 'ytdl_oidc_allowed_groups',
        'path': 'YoutubeDLMaterial.Users.oidc.allowed_groups'
    },
    'ytdl_oidc_username_claim': {
        'key': 'ytdl_oidc_username_claim',
        'path': 'YoutubeDLMaterial.Users.oidc.username_claim'
    },
    'ytdl_oidc_display_name_claim': {
        'key': 'ytdl_oidc_display_name_claim',
        'path': 'YoutubeDLMaterial.Users.oidc.display_name_claim'
    },

    // Database
    'ytdl_use_local_db': {
        'key': 'ytdl_use_local_db',
        'path': 'YoutubeDLMaterial.Database.use_local_db'
    },
    'ytdl_mongodb_connection_string': {
        'key': 'ytdl_mongodb_connection_string',
        'path': 'YoutubeDLMaterial.Database.mongodb_connection_string'
    },

    // Advanced
    'ytdl_default_downloader': {
        'key': 'ytdl_default_downloader',
        'path': 'YoutubeDLMaterial.Advanced.default_downloader'
    },
    'ytdl_use_default_downloading_agent': {
        'key': 'ytdl_use_default_downloading_agent',
        'path': 'YoutubeDLMaterial.Advanced.use_default_downloading_agent'
    },
    'ytdl_custom_downloading_agent': {
        'key': 'ytdl_custom_downloading_agent',
        'path': 'YoutubeDLMaterial.Advanced.custom_downloading_agent'
    },
    'ytdl_multi_user_mode': {
        'key': 'ytdl_multi_user_mode',
        'path': 'YoutubeDLMaterial.Advanced.multi_user_mode'
    },
    'ytdl_allow_advanced_download': {
        'key': 'ytdl_allow_advanced_download',
        'path': 'YoutubeDLMaterial.Advanced.allow_advanced_download'
    },
    'ytdl_use_cookies': {
        'key': 'ytdl_use_cookies',
        'path': 'YoutubeDLMaterial.Advanced.use_cookies'
    },
    'ytdl_jwt_expiration': {
        'key': 'ytdl_jwt_expiration',
        'path': 'YoutubeDLMaterial.Advanced.jwt_expiration'
    },
    'ytdl_logger_level': {
        'key': 'ytdl_logger_level',
        'path': 'YoutubeDLMaterial.Advanced.logger_level'
    }
};

exports.AVAILABLE_PERMISSIONS = [
    'filemanager',
    'settings',
    'subscriptions',
    'sharing',
    'advanced_download',
    'downloads_manager',
    'tasks_manager'
];

exports.DETAILS_BIN_PATH = 'appdata/youtube-dl.json'
exports.OUTDATED_YOUTUBEDL_VERSION = "2020.00.00";

// args that have a value after it (e.g. -o <output> or -f <format>)
const YTDL_ARGS_WITH_VALUES = [
    '--default-search',
    '--config-location',
    '--proxy',
    '--socket-timeout',
    '--source-address',
    '--geo-verification-proxy',
    '--geo-bypass-country',
    '--geo-bypass-ip-block',
    '--playlist-start',
    '--playlist-end',
    '--playlist-items',
    '--match-title',
    '--reject-title',
    '--max-downloads',
    '--min-filesize',
    '--max-filesize',
    '--date',
    '--datebefore',
    '--dateafter',
    '--min-views',
    '--max-views',
    '--match-filter',
    '--age-limit',
    '--download-archive',
    '-r',
    '--limit-rate',
    '-R',
    '--retries',
    '--fragment-retries',
    '--buffer-size',
    '--http-chunk-size',
    '--external-downloader',
    '--external-downloader-args',
    '-a',
    '--batch-file',
    '-o',
    '--output',
    '--output-na-placeholder',
    '--autonumber-start',
    '--load-info-json',
    '--cookies',
    '--cache-dir',
    '--encoding',
    '--user-agent',
    '--referer',
    '--add-header',
    '--sleep-interval',
    '--max-sleep-interval',
    '-f',
    '--format',
    '--merge-output-format',
    '--sub-format',
    '--sub-lang',
    '-u',
    '--username',
    '-p',
    '--password',
    '-2',
    '--twofactor',
    '--video-password',
    '--ap-mso',
    '--ap-username',
    '--ap-password',
    '--audio-format',
    '--audio-quality',
    '--recode-video',
    '--postprocessor-args',
    '--metadata-from-title',
    '--fixup',
    '--ffmpeg-location',
    '--exec',
    '--convert-subs'
];

exports.SUBSCRIPTION_BACKUP_PATH = 'subscription_backup.json'

// we're using a Set here for performance
exports.YTDL_ARGS_WITH_VALUES = new Set(YTDL_ARGS_WITH_VALUES);

exports.ICON_URL = 'https://i.imgur.com/IKOlr0N.png';

exports.CURRENT_VERSION = 'v4.3.2';
