|
|
@ -41,6 +41,8 @@ public class ReleaseProfileUpdater : IReleaseProfileUpdater
|
|
|
|
|
|
|
|
|
|
|
|
public async Task Process(bool isPreview, SonarrConfiguration config)
|
|
|
|
public async Task Process(bool isPreview, SonarrConfiguration config)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
await DoVersionEnforcement(config);
|
|
|
|
|
|
|
|
|
|
|
|
var profilesFromGuide = _guide.GetReleaseProfileData();
|
|
|
|
var profilesFromGuide = _guide.GetReleaseProfileData();
|
|
|
|
|
|
|
|
|
|
|
|
var filteredProfiles = new List<(ReleaseProfileData Profile, IReadOnlyCollection<string> Tags)>();
|
|
|
|
var filteredProfiles = new List<(ReleaseProfileData Profile, IReadOnlyCollection<string> Tags)>();
|
|
|
@ -129,8 +131,6 @@ public class ReleaseProfileUpdater : IReleaseProfileUpdater
|
|
|
|
private async Task ProcessReleaseProfiles(
|
|
|
|
private async Task ProcessReleaseProfiles(
|
|
|
|
List<(ReleaseProfileData Profile, IReadOnlyCollection<string> Tags)> profilesAndTags)
|
|
|
|
List<(ReleaseProfileData Profile, IReadOnlyCollection<string> Tags)> profilesAndTags)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await DoVersionEnforcement();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Obtain all of the existing release profiles first. If any were previously created by our program
|
|
|
|
// Obtain all of the existing release profiles first. If any were previously created by our program
|
|
|
|
// here, we favor replacing those instead of creating new ones, which would just be mostly duplicates
|
|
|
|
// here, we favor replacing those instead of creating new ones, which would just be mostly duplicates
|
|
|
|
// (but with some differences, since there have likely been updates since the last run).
|
|
|
|
// (but with some differences, since there have likely been updates since the last run).
|
|
|
@ -196,7 +196,7 @@ public class ReleaseProfileUpdater : IReleaseProfileUpdater
|
|
|
|
.ToList();
|
|
|
|
.ToList();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async Task DoVersionEnforcement()
|
|
|
|
private async Task DoVersionEnforcement(SonarrConfiguration config)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var capabilities = await _compatibility.Capabilities.LastAsync();
|
|
|
|
var capabilities = await _compatibility.Capabilities.LastAsync();
|
|
|
|
if (!capabilities.SupportsNamedReleaseProfiles)
|
|
|
|
if (!capabilities.SupportsNamedReleaseProfiles)
|
|
|
@ -205,6 +205,11 @@ public class ReleaseProfileUpdater : IReleaseProfileUpdater
|
|
|
|
$"Your Sonarr version {capabilities.Version} does not meet the minimum " +
|
|
|
|
$"Your Sonarr version {capabilities.Version} does not meet the minimum " +
|
|
|
|
$"required version of {_compatibility.MinimumVersion} to use this program");
|
|
|
|
$"required version of {_compatibility.MinimumVersion} to use this program");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (capabilities.SupportsCustomFormats && config.ReleaseProfiles.Any())
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
throw new VersionException("Sonarr v4 does not support Release Profiles. Please use Sonarr v3 instead.");
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private async Task CreateMissingTags(ICollection<SonarrTag> sonarrTags, IEnumerable<string> configTags)
|
|
|
|
private async Task CreateMissingTags(ICollection<SonarrTag> sonarrTags, IEnumerable<string> configTags)
|
|
|
|