Skip to content

Commit

Permalink
graceful handling of duplicate subreddits
Browse files Browse the repository at this point in the history
  • Loading branch information
mabako committed Mar 17, 2015
1 parent c158a79 commit 8ce2d71
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion RedditSkylines/RedditUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ public override void OnCreated(IChirper threading)
DebugOutputPanel.AddMessage(ColossalFramework.Plugins.PluginManager.MessageType.Message, string.Format("Going to show a new message from one of {0} subreddits every {1} seconds (NoSound = {2})", Configuration.Subreddits.Count, Configuration.TimerInSeconds, Configuration.NoSound));

foreach (string subreddit in Configuration.Subreddits)
lastPostIds.Add(subreddit, new Queue<string>());
{
if(!lastPostIds.ContainsKey(subreddit))
lastPostIds.Add(subreddit, new Queue<string>());
}

timer.AutoReset = true;
timer.Elapsed += new ElapsedEventHandler((sender, e) => UpdateRedditPosts());
Expand Down

0 comments on commit 8ce2d71

Please sign in to comment.