public GoodReadsDataSource(IPreferenceService preferenceService) { _preferenceService = preferenceService; _client = GoodreadsClient.Create( preferenceService.Get("goodreads.apikey", "ckvsiSDsuqh7omh74ZZ6Q"), // todo: this is the lazylibrarian key... preferenceService.Get("goodreads.apisecret", "") ); }
public TransmissionDownloadClient(IPreferenceService preferencesService) { _preferencesService = preferencesService; _client = new Client( preferencesService.Get("transmission.host", "127.0.0.1"), null, preferencesService.Get("transmission.username", "transmission"), preferencesService.Get("transmission.password", "transmission")); }
public SabnzbdDownloadClient(IPreferenceService preferencesService) { _preferencesService = preferencesService; _category = preferencesService.Get("sabnzbd.category", "audiobooks"); _client = new SabClient( preferencesService.Get("sabnzbd.host", "127.0.0.1"), preferencesService.Get("sabnzbd.port", (ushort)8080), preferencesService.Get("sabnzbd.apikey", "")); }
public DownloadManager(IPreferenceService preferencesService, IServiceProvider provider) { _provider = provider; _random = new Random(); _downloads = new List <DownloadHandle>(); _pollTimer = new Timer( ExecuteDownloadClientPoll, null, TimeSpan.Zero, TimeSpan.FromMinutes(preferencesService.Get("downloadmanager.pollmins", 2))); }
// GET: api/Preference/5 public Preference Get(string id) { if (id == "undefined") { return(null); } string[] input = id.Split(' '); int actorId = int.Parse(input[0]); int scriptId = int.Parse(input[1]); Preference result = preferenceService.Get(preference => preference.ReaderId == actorId && preference.ScriptId == scriptId); return(result); }
public Type GetMainPage() { var isNew = preferenceService.Get("isnew"); //if (isNew == "false") if (true) { preferenceService.Set("isnew", "false"); return(typeof(LoginPageViewModel)); } else { var email = preferenceService.Get("email"); if (string.IsNullOrEmpty(email)) { return(typeof(LoginPageViewModel)); } else { return(typeof(CategoryPageViewModel)); } } }
public bool CheckAuthentication(string username, string password) { if (_preferenceService.Get("authorisation.developerbypass", false)) { return(false); } try { var users = _preferenceService.GetObjectArray <User>("authorisation.users"); if (users.Length == 0) { return(true); } var user = users.First(u => u.Username.ToLower().Trim() == username.ToLower().Trim()); return(user.PasswordHash == HashPassword(password, user.Salt)); } catch (Exception) { return(false); } }
/// <summary> /// Gets value of stored key or null if key not exist. /// </summary> /// <param name="key">Key name.</param> /// <typeparam name="T">Type of stored value.</param> /// <returns>Value assigned to the key.</returns> public object Get <T>(string key) { return(_model.Get <T>(key)); }
public string GetValue(string key) { return(_preferenceService.Get(key, "")); }