1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 18:42:42 +01:00

Update dl-clients (#732)

This commit is contained in:
Devin Buhl 2017-02-12 20:07:57 -05:00 committed by GitHub
parent 1b900a006f
commit 758228e159
16 changed files with 35 additions and 109 deletions

View File

@ -40,23 +40,23 @@ public TorrentBlackhole(IScanWatchFolder scanWatchFolder,
protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string hash, string magnetLink)
protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink)
{
if (!Settings.SaveMagnetFiles)
{
throw new NotSupportedException("Blackhole does not support magnet links.");
}
var title = remoteEpisode.Release.Title;
var title = remoteMovie.Release.Title;
title = FileNameBuilder.CleanFileName(title);
@ -73,9 +73,9 @@ protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string ha
return null;
}
protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent)
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent)
{
var title = remoteEpisode.Release.Title;
var title = remoteMovie.Release.Title;
title = FileNameBuilder.CleanFileName(title);

View File

@ -34,7 +34,7 @@ public UsenetBlackhole(IScanWatchFolder scanWatchFolder,
protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents)

View File

@ -45,7 +45,7 @@ protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash
return actualHash.ToUpper();
}
protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent)
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent)
{
var actualHash = _proxy.AddTorrentFromFile(filename, fileContent, Settings);
@ -61,12 +61,12 @@ protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string h
protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
public override string Name => "Deluge";

View File

@ -25,7 +25,7 @@ public DelugeSettings()
Host = "localhost";
Port = 8112;
Password = "deluge";
MovieCategory = "movie-radarr";
MovieCategory = "radarr";
}
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]

View File

@ -151,22 +151,22 @@ protected override void Test(List<ValidationFailure> failures)
protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string hash, string magnetLink)
protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink)
{
_proxy.AddTorrentUri(Settings, magnetLink);
return hash.ToUpper();
}
protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent)
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent)
{
return _proxy.AddTorrentFile(Settings, fileContent).ToUpper();
}

View File

@ -31,16 +31,7 @@ public NzbVortex(INzbVortexProxy proxy,
protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents)
{
var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority;
var response = _proxy.DownloadNzb(fileContents, filename, priority, Settings);
if (response == null)
{
throw new DownloadClientException("Failed to add nzb {0}", filename);
}
return response;
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents)

View File

@ -29,7 +29,7 @@ public NzbVortexSettings()
{
Host = "localhost";
Port = 4321;
TvCategory = "TV Shows";
TvCategory = "Movies";
RecentTvPriority = (int)NzbVortexPriority.Normal;
OlderTvPriority = (int)NzbVortexPriority.Normal;
}

View File

@ -31,20 +31,7 @@ public Nzbget(INzbgetProxy proxy,
protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents)
{
var category = Settings.TvCategory;
var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority;
var addpaused = Settings.AddPaused;
var response = _proxy.DownloadNzb(fileContents, filename, category, priority, addpaused, Settings);
if (response == null)
{
throw new DownloadClientException("Failed to add nzb {0}", filename);
}
return response;
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents)

View File

@ -34,36 +34,15 @@ public Pneumatic(IHttpClient httpClient,
public override string Download(RemoteEpisode remoteEpisode)
{
var url = remoteEpisode.Release.DownloadUrl;
var title = remoteEpisode.Release.Title;
if (remoteEpisode.ParsedEpisodeInfo.FullSeason)
{
throw new NotSupportedException("Full season releases are not supported with Pneumatic.");
}
title = FileNameBuilder.CleanFileName(title);
//Save to the Pneumatic directory (The user will need to ensure its accessible by XBMC)
var nzbFile = Path.Combine(Settings.NzbFolder, title + ".nzb");
_logger.Debug("Downloading NZB from: {0} to: {1}", url, nzbFile);
_httpClient.DownloadFile(url, nzbFile);
_logger.Debug("NZB Download succeeded, saved to: {0}", nzbFile);
var strmFile = WriteStrmFile(title, nzbFile);
return GetDownloadClientId(strmFile);
throw new DownloadClientException("Episodes are not working with Radarr");
}
public override string Download(RemoteMovie remoteEpisode)
public override string Download(RemoteMovie remoteMovie)
{
var url = remoteEpisode.Release.DownloadUrl;
var title = remoteEpisode.Release.Title;
var url = remoteMovie.Release.DownloadUrl;
var title = remoteMovie.Release.Title;
if (remoteEpisode.ParsedEpisodeInfo.FullSeason)
if (remoteMovie.ParsedEpisodeInfo.FullSeason)
{
throw new NotSupportedException("Full season releases are not supported with Pneumatic.");
}

View File

@ -33,12 +33,12 @@ public QBittorrent(IQBittorrentProxy proxy,
protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, Byte[] fileContent)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink)

View File

@ -22,7 +22,7 @@ public QBittorrentSettings()
{
Host = "localhost";
Port = 9091;
MovieCategory = "movie-radarr";
MovieCategory = "radarr";
}
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]

View File

@ -34,17 +34,7 @@ public Sabnzbd(ISabnzbdProxy proxy,
protected override string AddFromNzbFile(RemoteEpisode remoteEpisode, string filename, byte[] fileContents)
{
var category = Settings.TvCategory;
var priority = remoteEpisode.IsRecentEpisode() ? Settings.RecentTvPriority : Settings.OlderTvPriority;
var response = _proxy.DownloadNzb(fileContents, filename, category, priority, Settings);
if (response != null && response.Ids.Any())
{
return response.Ids.First();
}
return null;
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromNzbFile(RemoteMovie remoteMovie, string filename, byte[] fileContents)

View File

@ -38,7 +38,7 @@ public SabnzbdSettings()
{
Host = "localhost";
Port = 8080;
TvCategory = "tv";
TvCategory = "movies";
RecentTvPriority = (int)SabnzbdPriority.Default;
OlderTvPriority = (int)SabnzbdPriority.Default;
}

View File

@ -137,12 +137,12 @@ public override DownloadClientStatus GetStatus()
protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
{
throw new NotImplementedException("Episodes are not working with Radarr");
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink)

View File

@ -33,6 +33,7 @@ public TransmissionSettings()
Host = "localhost";
Port = 9091;
UrlBase = "/transmission/";
MovieCategory = "radarr";
}
[FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)]

View File

@ -38,37 +38,15 @@ public UTorrent(IUTorrentProxy proxy,
protected override string AddFromMagnetLink(RemoteEpisode remoteEpisode, string hash, string magnetLink)
{
_proxy.AddTorrentFromUrl(magnetLink, Settings);
_proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);
var isRecentEpisode = remoteEpisode.IsRecentEpisode();
if (isRecentEpisode && Settings.RecentTvPriority == (int)UTorrentPriority.First ||
!isRecentEpisode && Settings.OlderTvPriority == (int)UTorrentPriority.First)
{
_proxy.MoveTorrentToTopInQueue(hash, Settings);
}
return hash;
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromTorrentFile(RemoteEpisode remoteEpisode, string hash, string filename, byte[] fileContent)
{
_proxy.AddTorrentFromFile(filename, fileContent, Settings);
_proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);
var isRecentEpisode = remoteEpisode.IsRecentEpisode();
if (isRecentEpisode && Settings.RecentTvPriority == (int)UTorrentPriority.First ||
!isRecentEpisode && Settings.OlderTvPriority == (int)UTorrentPriority.First)
{
_proxy.MoveTorrentToTopInQueue(hash, Settings);
}
return hash;
throw new DownloadClientException("Episodes are not working with Radarr");
}
protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string hash, string magnetLink)
protected override string AddFromMagnetLink(RemoteMovie remoteMovie, string hash, string magnetLink)
{
_proxy.AddTorrentFromUrl(magnetLink, Settings);
_proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);
@ -84,7 +62,7 @@ protected override string AddFromMagnetLink(RemoteMovie remoteEpisode, string ha
return hash;
}
protected override string AddFromTorrentFile(RemoteMovie remoteEpisode, string hash, string filename, byte[] fileContent)
protected override string AddFromTorrentFile(RemoteMovie remoteMovie, string hash, string filename, byte[] fileContent)
{
_proxy.AddTorrentFromFile(filename, fileContent, Settings);
_proxy.SetTorrentLabel(hash, Settings.TvCategory, Settings);