setting_helpers.h: add generic function for api keys

Origin commit data
------------------
Branch: ni/coolstream
Commit: f2d3b96160
Author: Thilo Graf <dbt@novatux.de>
Date: 2018-04-29 (Sun, 29 Apr 2018)


------------------
No further description and justification available within origin commit message!

------------------
This commit was generated by Migit
This commit is contained in:
2018-04-29 03:13:08 +02:00
committed by vanhofen
parent 2d6da494ab
commit f4a66c8def

View File

@@ -159,9 +159,13 @@ class CAutoModeNotifier : public CChangeObserver
};
//do we need a class?
inline int check_shoutcast_dev_id() { return ((g_settings.shoutcast_dev_id != "XXXXXXXXXXXXXXXX") && !g_settings.shoutcast_dev_id.empty()); }
inline int check_youtube_dev_id() { return ((g_settings.youtube_dev_id != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.youtube_dev_id.empty()); }
inline int check_tmdb_api_key() { return ((g_settings.tmdb_api_key != "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX") && !g_settings.tmdb_api_key.empty()); }
inline int check_omdb_api_key() { return ((g_settings.omdb_api_key != "XXXXXXXX") && !g_settings.omdb_api_key.empty()); }
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());
}
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"); }
#endif