mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-05 12:48:27 +02:00
Api keys: add class instead single functions to check api keys
Without class build was broken, with static versions it should working.
Origin commit data
------------------
Branch: ni/coolstream
Commit: 7d6a4db686
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-04-29 (Sun, 29 Apr 2018)
------------------
This commit was generated by Migit
This commit is contained in:
@@ -158,14 +158,17 @@ class CAutoModeNotifier : public CChangeObserver
|
||||
bool changeNotify(const neutrino_locale_t, void * data);
|
||||
};
|
||||
|
||||
//do we need a class?
|
||||
int check_api_key(const std::string& api_key_setting, const std::string& api_key_pattern)
|
||||
class CApiKey
|
||||
{
|
||||
return ((api_key_setting != api_key_pattern) && !api_key_setting.empty());
|
||||
}
|
||||
inline int check_shoutcast_dev_id() { return check_api_key(g_settings.shoutcast_dev_id, "XXXXXXXXXXXXXXXX"); }
|
||||
inline int check_youtube_dev_id() { return check_api_key(g_settings.youtube_dev_id, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); }
|
||||
inline int check_tmdb_api_key() { return check_api_key(g_settings.tmdb_api_key, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); }
|
||||
inline int check_omdb_api_key() { return check_api_key(g_settings.omdb_api_key, "XXXXXXXX"); }
|
||||
public:
|
||||
static int check_api_key(const std::string& api_key_setting, const std::string& api_key_pattern)
|
||||
{
|
||||
return ((api_key_setting != api_key_pattern) && !api_key_setting.empty());
|
||||
}
|
||||
static int check_shoutcast_dev_id() { return CApiKey::check_api_key(g_settings.shoutcast_dev_id, "XXXXXXXXXXXXXXXX"); }
|
||||
static int check_youtube_dev_id() { return CApiKey::check_api_key(g_settings.youtube_dev_id, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); }
|
||||
static int check_tmdb_api_key() { return CApiKey::check_api_key(g_settings.tmdb_api_key, "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"); }
|
||||
static int check_omdb_api_key() { return CApiKey::check_api_key(g_settings.omdb_api_key, "XXXXXXXX"); }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user