public NsfwEntry GetNsfwInfo(string server) { NsfwEntry existingEntry = null; if (!nsfwServerEntries.TryGetValue(server, out existingEntry)) { existingEntry = new NsfwEntry() { Channel = null, Enabled = false }; } return(existingEntry); }
public void UpdateServer(string server, bool?enabled = null, string channel = "") { NsfwEntry existingEntry = null; if (!nsfwServerEntries.TryGetValue(server, out existingEntry)) { existingEntry = new NsfwEntry() { Channel = null, Enabled = false }; } nsfwServerEntries[server] = new NsfwEntry() { Channel = channel != "" ? channel : existingEntry.Channel, Enabled = enabled ?? existingEntry.Enabled }; Update(); }