mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 13:33:34 -07:00
Twitter notifications working from end-to-end.
This commit is contained in:
parent
a2735d7716
commit
d9bef59ec2
6 changed files with 77 additions and 6 deletions
44
NzbDrone.Core/Providers/ExternalNotification/Twitter.cs
Normal file
44
NzbDrone.Core/Providers/ExternalNotification/Twitter.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
using NzbDrone.Core.Providers.Core;
|
||||
using NzbDrone.Core.Repository;
|
||||
|
||||
namespace NzbDrone.Core.Providers.ExternalNotification
|
||||
{
|
||||
public class Twitter : ExternalNotificationBase
|
||||
{
|
||||
private readonly TwitterProvider _twitterProvider;
|
||||
|
||||
public Twitter(ConfigProvider configProvider, TwitterProvider twitterProvider)
|
||||
: base(configProvider)
|
||||
{
|
||||
_twitterProvider = twitterProvider;
|
||||
}
|
||||
|
||||
public override string Name
|
||||
{
|
||||
get { return "Twitter"; }
|
||||
}
|
||||
|
||||
public override void OnGrab(string message)
|
||||
{
|
||||
if (_configProvider.TwitterNotifyOnGrab)
|
||||
{
|
||||
_logger.Trace("Sending Notification to Twitter (On Grab)");
|
||||
_twitterProvider.SendTweet("Download Started: " + message);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnDownload(string message, Series series)
|
||||
{
|
||||
if (_configProvider.TwitterNotifyOnDownload)
|
||||
{
|
||||
_logger.Trace("Sending Notification to Twitter (On Grab)");
|
||||
_twitterProvider.SendTweet("Downloaded Complete: " + message);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnRename(string message, Series series)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue