Lidarr/NzbDrone.Core/Providers/ExternalNotification/Twitter.cs

48 lines
1.3 KiB
C#

using System;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Providers.Core;
using NzbDrone.Core.Repository;
namespace NzbDrone.Core.Providers.ExternalNotification
{
public class Twitter : ExternalNotificationBase
{
private readonly TwitterProvider _twitterProvider;
public Twitter(IConfigService configService, TwitterProvider twitterProvider)
: base(configService)
{
_twitterProvider = twitterProvider;
}
public override string Name
{
get { return "Twitter"; }
}
public override void OnGrab(string message)
{
if (_configService.TwitterNotifyOnGrab)
{
_logger.Trace("Sending Notification to Twitter (On Grab)");
_twitterProvider.SendTweet("Download Started: " + message);
}
}
public override void OnDownload(string message, Series series)
{
if (_configService.TwitterNotifyOnDownload)
{
_logger.Trace("Sending Notification to Twitter (On Grab)");
_twitterProvider.SendTweet("Download Completed: " + message);
}
}
public override void AfterRename(string message, Series series)
{
}
}
}