Example #1
0
        public NsfwEntry GetNsfwInfo(string server)
        {
            NsfwEntry existingEntry = null;

            if (!nsfwServerEntries.TryGetValue(server, out existingEntry))
            {
                existingEntry = new NsfwEntry()
                {
                    Channel = null, Enabled = false
                };
            }
            return(existingEntry);
        }
Example #2
0
        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();
        }