2011-10-28 08:14:13 +00:00
|
|
|
|
using System;
|
2013-02-24 06:48:52 +00:00
|
|
|
|
using NzbDrone.Core.Configuration;
|
2013-02-19 06:01:03 +00:00
|
|
|
|
using NzbDrone.Core.Tv;
|
2011-10-28 08:14:13 +00:00
|
|
|
|
using NzbDrone.Core.Providers.Core;
|
|
|
|
|
using NzbDrone.Core.Repository;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Providers.ExternalNotification
|
|
|
|
|
{
|
|
|
|
|
public class Twitter : ExternalNotificationBase
|
|
|
|
|
{
|
|
|
|
|
private readonly TwitterProvider _twitterProvider;
|
|
|
|
|
|
2013-02-24 06:48:52 +00:00
|
|
|
|
public Twitter(IConfigService configService, TwitterProvider twitterProvider)
|
|
|
|
|
: base(configService)
|
2011-10-28 08:14:13 +00:00
|
|
|
|
{
|
|
|
|
|
_twitterProvider = twitterProvider;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Name
|
|
|
|
|
{
|
|
|
|
|
get { return "Twitter"; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnGrab(string message)
|
|
|
|
|
{
|
2013-02-24 06:48:52 +00:00
|
|
|
|
if (_configService.TwitterNotifyOnGrab)
|
2011-10-28 08:14:13 +00:00
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Sending Notification to Twitter (On Grab)");
|
|
|
|
|
_twitterProvider.SendTweet("Download Started: " + message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnDownload(string message, Series series)
|
|
|
|
|
{
|
2013-02-24 06:48:52 +00:00
|
|
|
|
if (_configService.TwitterNotifyOnDownload)
|
2011-10-28 08:14:13 +00:00
|
|
|
|
{
|
|
|
|
|
_logger.Trace("Sending Notification to Twitter (On Grab)");
|
2012-04-18 06:10:24 +00:00
|
|
|
|
_twitterProvider.SendTweet("Download Completed: " + message);
|
2011-10-28 08:14:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void OnRename(string message, Series series)
|
|
|
|
|
{
|
2012-01-05 03:40:25 +00:00
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void AfterRename(string message, Series series)
|
|
|
|
|
{
|
|
|
|
|
|
2011-10-28 08:14:13 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|