mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-24 15:00:54 +00:00
New: Download client option for redownloading failed releases from Interactive Search
(cherry picked from commit 87e0a7983a437a4d166aa8b9c9eaf78ea5431969)
This commit is contained in:
parent
4c2f17f1cf
commit
1551f336f4
9 changed files with 59 additions and 8 deletions
|
@ -2,8 +2,10 @@
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-right: $formLabelRightMarginWidth;
|
margin-right: $formLabelRightMarginWidth;
|
||||||
|
padding-top: 8px;
|
||||||
|
min-height: 35px;
|
||||||
|
text-align: end;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
line-height: 35px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.hasError {
|
.hasError {
|
||||||
|
|
|
@ -61,10 +61,12 @@ function DownloadClientOptions(props) {
|
||||||
legend={translate('FailedDownloadHandling')}
|
legend={translate('FailedDownloadHandling')}
|
||||||
>
|
>
|
||||||
<Form>
|
<Form>
|
||||||
<FormGroup size={sizes.MEDIUM}>
|
<FormGroup
|
||||||
<FormLabel>
|
advancedSettings={advancedSettings}
|
||||||
{translate('Redownload')}
|
isAdvanced={true}
|
||||||
</FormLabel>
|
size={sizes.MEDIUM}
|
||||||
|
>
|
||||||
|
<FormLabel>{translate('AutoRedownloadFailed')}</FormLabel>
|
||||||
|
|
||||||
<FormInputGroup
|
<FormInputGroup
|
||||||
type={inputTypes.CHECK}
|
type={inputTypes.CHECK}
|
||||||
|
@ -74,7 +76,28 @@ function DownloadClientOptions(props) {
|
||||||
{...settings.autoRedownloadFailed}
|
{...settings.autoRedownloadFailed}
|
||||||
/>
|
/>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
|
{
|
||||||
|
settings.autoRedownloadFailed.value ?
|
||||||
|
<FormGroup
|
||||||
|
advancedSettings={advancedSettings}
|
||||||
|
isAdvanced={true}
|
||||||
|
size={sizes.MEDIUM}
|
||||||
|
>
|
||||||
|
<FormLabel>{translate('AutoRedownloadFailedFromInteractiveSearch')}</FormLabel>
|
||||||
|
|
||||||
|
<FormInputGroup
|
||||||
|
type={inputTypes.CHECK}
|
||||||
|
name="autoRedownloadFailedFromInteractiveSearch"
|
||||||
|
helpText={translate('AutoRedownloadFailedFromInteractiveSearchHelpText')}
|
||||||
|
onChange={onInputChange}
|
||||||
|
{...settings.autoRedownloadFailedFromInteractiveSearch}
|
||||||
|
/>
|
||||||
|
</FormGroup> :
|
||||||
|
null
|
||||||
|
}
|
||||||
</Form>
|
</Form>
|
||||||
|
|
||||||
<Alert kind={kinds.INFO}>
|
<Alert kind={kinds.INFO}>
|
||||||
{translate('RemoveDownloadsAlert')}
|
{translate('RemoveDownloadsAlert')}
|
||||||
</Alert>
|
</Alert>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using Lidarr.Http.REST;
|
using Lidarr.Http.REST;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
|
||||||
namespace Lidarr.Api.V1.Config
|
namespace Lidarr.Api.V1.Config
|
||||||
|
@ -8,6 +8,7 @@ public class DownloadClientConfigResource : RestResource
|
||||||
public string DownloadClientWorkingFolders { get; set; }
|
public string DownloadClientWorkingFolders { get; set; }
|
||||||
public bool EnableCompletedDownloadHandling { get; set; }
|
public bool EnableCompletedDownloadHandling { get; set; }
|
||||||
public bool AutoRedownloadFailed { get; set; }
|
public bool AutoRedownloadFailed { get; set; }
|
||||||
|
public bool AutoRedownloadFailedFromInteractiveSearch { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class DownloadClientConfigResourceMapper
|
public static class DownloadClientConfigResourceMapper
|
||||||
|
@ -19,7 +20,8 @@ public static DownloadClientConfigResource ToResource(IConfigService model)
|
||||||
DownloadClientWorkingFolders = model.DownloadClientWorkingFolders,
|
DownloadClientWorkingFolders = model.DownloadClientWorkingFolders,
|
||||||
|
|
||||||
EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling,
|
EnableCompletedDownloadHandling = model.EnableCompletedDownloadHandling,
|
||||||
AutoRedownloadFailed = model.AutoRedownloadFailed
|
AutoRedownloadFailed = model.AutoRedownloadFailed,
|
||||||
|
AutoRedownloadFailedFromInteractiveSearch = model.AutoRedownloadFailedFromInteractiveSearch
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,13 @@ public bool AutoRedownloadFailed
|
||||||
set { SetValue("AutoRedownloadFailed", value); }
|
set { SetValue("AutoRedownloadFailed", value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public bool AutoRedownloadFailedFromInteractiveSearch
|
||||||
|
{
|
||||||
|
get { return GetValueBoolean("AutoRedownloadFailedFromInteractiveSearch", true); }
|
||||||
|
|
||||||
|
set { SetValue("AutoRedownloadFailedFromInteractiveSearch", value); }
|
||||||
|
}
|
||||||
|
|
||||||
public bool CreateEmptyArtistFolders
|
public bool CreateEmptyArtistFolders
|
||||||
{
|
{
|
||||||
get { return GetValueBoolean("CreateEmptyArtistFolders", false); }
|
get { return GetValueBoolean("CreateEmptyArtistFolders", false); }
|
||||||
|
|
|
@ -20,6 +20,7 @@ public interface IConfigService
|
||||||
bool EnableCompletedDownloadHandling { get; set; }
|
bool EnableCompletedDownloadHandling { get; set; }
|
||||||
|
|
||||||
bool AutoRedownloadFailed { get; set; }
|
bool AutoRedownloadFailed { get; set; }
|
||||||
|
bool AutoRedownloadFailedFromInteractiveSearch { get; set; }
|
||||||
|
|
||||||
// Media Management
|
// Media Management
|
||||||
bool AutoUnmonitorPreviouslyDownloadedTracks { get; set; }
|
bool AutoUnmonitorPreviouslyDownloadedTracks { get; set; }
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NzbDrone.Common.Messaging;
|
using NzbDrone.Common.Messaging;
|
||||||
using NzbDrone.Core.Download.TrackedDownloads;
|
using NzbDrone.Core.Download.TrackedDownloads;
|
||||||
|
using NzbDrone.Core.Parser.Model;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Download
|
namespace NzbDrone.Core.Download
|
||||||
|
@ -22,5 +23,6 @@ public DownloadFailedEvent()
|
||||||
public Dictionary<string, string> Data { get; set; }
|
public Dictionary<string, string> Data { get; set; }
|
||||||
public TrackedDownload TrackedDownload { get; set; }
|
public TrackedDownload TrackedDownload { get; set; }
|
||||||
public bool SkipRedownload { get; set; }
|
public bool SkipRedownload { get; set; }
|
||||||
|
public ReleaseSourceType ReleaseSource { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Download.TrackedDownloads;
|
using NzbDrone.Core.Download.TrackedDownloads;
|
||||||
using NzbDrone.Core.History;
|
using NzbDrone.Core.History;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
|
using NzbDrone.Core.Parser.Model;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Download
|
namespace NzbDrone.Core.Download
|
||||||
{
|
{
|
||||||
|
@ -117,6 +119,7 @@ public void ProcessFailed(TrackedDownload trackedDownload)
|
||||||
private void PublishDownloadFailedEvent(List<EntityHistory> historyItems, string message, TrackedDownload trackedDownload = null, bool skipRedownload = false)
|
private void PublishDownloadFailedEvent(List<EntityHistory> historyItems, string message, TrackedDownload trackedDownload = null, bool skipRedownload = false)
|
||||||
{
|
{
|
||||||
var historyItem = historyItems.Last();
|
var historyItem = historyItems.Last();
|
||||||
|
Enum.TryParse(historyItem.Data.GetValueOrDefault(EntityHistory.RELEASE_SOURCE, ReleaseSourceType.Unknown.ToString()), out ReleaseSourceType releaseSource);
|
||||||
|
|
||||||
var downloadFailedEvent = new DownloadFailedEvent
|
var downloadFailedEvent = new DownloadFailedEvent
|
||||||
{
|
{
|
||||||
|
@ -129,7 +132,8 @@ private void PublishDownloadFailedEvent(List<EntityHistory> historyItems, string
|
||||||
Message = message,
|
Message = message,
|
||||||
Data = historyItem.Data,
|
Data = historyItem.Data,
|
||||||
TrackedDownload = trackedDownload,
|
TrackedDownload = trackedDownload,
|
||||||
SkipRedownload = skipRedownload
|
SkipRedownload = skipRedownload,
|
||||||
|
ReleaseSource = releaseSource
|
||||||
};
|
};
|
||||||
|
|
||||||
_eventAggregator.PublishEvent(downloadFailedEvent);
|
_eventAggregator.PublishEvent(downloadFailedEvent);
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
using NzbDrone.Core.Messaging.Commands;
|
using NzbDrone.Core.Messaging.Commands;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Core.Music;
|
using NzbDrone.Core.Music;
|
||||||
|
using NzbDrone.Core.Parser.Model;
|
||||||
|
|
||||||
namespace NzbDrone.Core.Download
|
namespace NzbDrone.Core.Download
|
||||||
{
|
{
|
||||||
|
@ -41,6 +42,12 @@ public void Handle(DownloadFailedEvent message)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (message.ReleaseSource == ReleaseSourceType.InteractiveSearch && !_configService.AutoRedownloadFailedFromInteractiveSearch)
|
||||||
|
{
|
||||||
|
_logger.Debug("Auto redownloading failed albumbs from interactive search is disabled");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (message.AlbumIds.Count == 1)
|
if (message.AlbumIds.Count == 1)
|
||||||
{
|
{
|
||||||
_logger.Debug("Failed download only contains one album, searching again");
|
_logger.Debug("Failed download only contains one album, searching again");
|
||||||
|
|
|
@ -135,6 +135,9 @@
|
||||||
"AuthenticationRequiredWarning": "To prevent remote access without authentication, {appName} now requires authentication to be enabled. You can optionally disable authentication from local addresses.",
|
"AuthenticationRequiredWarning": "To prevent remote access without authentication, {appName} now requires authentication to be enabled. You can optionally disable authentication from local addresses.",
|
||||||
"Auto": "Auto",
|
"Auto": "Auto",
|
||||||
"AutoAdd": "Auto Add",
|
"AutoAdd": "Auto Add",
|
||||||
|
"AutoRedownloadFailed": "Redownload Failed",
|
||||||
|
"AutoRedownloadFailedFromInteractiveSearch": "Redownload Failed from Interactive Search",
|
||||||
|
"AutoRedownloadFailedFromInteractiveSearchHelpText": "Automatically search for and attempt to download a different release when failed release was grabbed from interactive search",
|
||||||
"AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release",
|
"AutoRedownloadFailedHelpText": "Automatically search for and attempt to download a different release",
|
||||||
"AutoTagging": "Auto Tagging",
|
"AutoTagging": "Auto Tagging",
|
||||||
"AutoTaggingLoadError": "Unable to load auto tagging",
|
"AutoTaggingLoadError": "Unable to load auto tagging",
|
||||||
|
|
Loading…
Reference in a new issue