mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-10-30 15:32:31 +01:00
Redownload after failure is an advanced option.
New: Handle failed downloads and attempt to find another release (SABnzbd only)
This commit is contained in:
parent
f99573e334
commit
6dd2951f80
@ -261,6 +261,13 @@ namespace NzbDrone.Core.Configuration
|
|||||||
set { SetValue("AutoDownloadPropers", value); }
|
set { SetValue("AutoDownloadPropers", value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean AutoRedownloadFailed
|
||||||
|
{
|
||||||
|
get { return GetValueBoolean("AutoRedownloadFailed", true); }
|
||||||
|
|
||||||
|
set { SetValue("AutoRedownloadFailed", value); }
|
||||||
|
}
|
||||||
|
|
||||||
public string DownloadClientWorkingFolders
|
public string DownloadClientWorkingFolders
|
||||||
{
|
{
|
||||||
get { return GetValue("DownloadClientWorkingFolders", "_UNPACK_|_FAILED_"); }
|
get { return GetValue("DownloadClientWorkingFolders", "_UNPACK_|_FAILED_"); }
|
||||||
|
@ -39,6 +39,7 @@ namespace NzbDrone.Core.Configuration
|
|||||||
Int32 RssSyncInterval { get; set; }
|
Int32 RssSyncInterval { get; set; }
|
||||||
Boolean AutoDownloadPropers { get; set; }
|
Boolean AutoDownloadPropers { get; set; }
|
||||||
String DownloadClientWorkingFolders { get; set; }
|
String DownloadClientWorkingFolders { get; set; }
|
||||||
|
Boolean AutoRedownloadFailed { get; set; }
|
||||||
void SaveValues(Dictionary<string, object> configValues);
|
void SaveValues(Dictionary<string, object> configValues);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.IndexerSearch;
|
using NzbDrone.Core.IndexerSearch;
|
||||||
using NzbDrone.Core.Messaging.Commands;
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
@ -15,12 +16,14 @@ namespace NzbDrone.Core.Download
|
|||||||
|
|
||||||
public class RedownloadFailedDownloadService : IRedownloadFailedDownloads
|
public class RedownloadFailedDownloadService : IRedownloadFailedDownloads
|
||||||
{
|
{
|
||||||
|
private readonly IConfigService _configService;
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
private readonly ICommandExecutor _commandExecutor;
|
private readonly ICommandExecutor _commandExecutor;
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public RedownloadFailedDownloadService(IEpisodeService episodeService, ICommandExecutor commandExecutor, Logger logger)
|
public RedownloadFailedDownloadService(IConfigService configService, IEpisodeService episodeService, ICommandExecutor commandExecutor, Logger logger)
|
||||||
{
|
{
|
||||||
|
_configService = configService;
|
||||||
_episodeService = episodeService;
|
_episodeService = episodeService;
|
||||||
_commandExecutor = commandExecutor;
|
_commandExecutor = commandExecutor;
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
@ -28,6 +31,12 @@ namespace NzbDrone.Core.Download
|
|||||||
|
|
||||||
public void Redownload(int seriesId, List<int> episodeIds)
|
public void Redownload(int seriesId, List<int> episodeIds)
|
||||||
{
|
{
|
||||||
|
if (!_configService.AutoRedownloadFailed)
|
||||||
|
{
|
||||||
|
_logger.Trace("Auto redownloading failed episodes is disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (episodeIds.Count == 1)
|
if (episodeIds.Count == 1)
|
||||||
{
|
{
|
||||||
_logger.Trace("Failed download only contains one episode, searching again");
|
_logger.Trace("Failed download only contains one episode, searching again");
|
||||||
|
@ -41,6 +41,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="control-group">
|
||||||
|
<label class="control-label">Redownload Failed</label>
|
||||||
|
|
||||||
|
<div class="controls">
|
||||||
|
<label class="checkbox toggle well">
|
||||||
|
<input type="checkbox" name="autoRedownloadFailed"/>
|
||||||
|
<p>
|
||||||
|
<span>Yes</span>
|
||||||
|
<span>No</span>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="btn btn-primary slide-button"/>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<span class="help-inline-checkbox">
|
||||||
|
<i class="icon-question-sign" title="Should NzbDrone automatically search for and attempt to download another release when a download fails?"/>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<label class="control-label">Recycling Bin</label>
|
<label class="control-label">Recycling Bin</label>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user