fix: Do not perform actual logic when doing preview

Fixes #158
snyk
Robert Dailey 1 year ago
parent f7a7902c2c
commit d71bce4990

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed ### Fixed
- Releases now retain executable permissions on Linux and macOS. - Releases now retain executable permissions on Linux and macOS.
- Sonarr: Do not modify or delete release profiles when using `--preview`
## [4.0.1] - 2022-12-21 ## [4.0.1] - 2022-12-21

@ -47,9 +47,9 @@ internal class CustomFormatUpdater : ICustomFormatUpdater
if (isPreview) if (isPreview)
{ {
PreviewCustomFormats(); PreviewCustomFormats();
return;
} }
else
{
await _persistenceProcessor.PersistCustomFormats(_guideProcessor.ProcessedCustomFormats, await _persistenceProcessor.PersistCustomFormats(_guideProcessor.ProcessedCustomFormats,
_guideProcessor.DeletedCustomFormatsInCache, _guideProcessor.ProfileScores); _guideProcessor.DeletedCustomFormatsInCache, _guideProcessor.ProfileScores);
@ -60,7 +60,6 @@ internal class CustomFormatUpdater : ICustomFormatUpdater
_cache.Update(_guideProcessor.ProcessedCustomFormats); _cache.Update(_guideProcessor.ProcessedCustomFormats);
_cache.Save(); _cache.Save();
} }
}
private void PrintQualityProfileUpdates() private void PrintQualityProfileUpdates()
{ {

@ -55,14 +55,17 @@ public class ReleaseProfileUpdater : IReleaseProfileUpdater
selectedProfile.TrashId); selectedProfile.TrashId);
selectedProfile = _pipeline.Process(selectedProfile, configProfile); selectedProfile = _pipeline.Process(selectedProfile, configProfile);
filteredProfiles.Add((selectedProfile, configProfile.Tags));
}
if (isPreview) if (isPreview)
{ {
PrintTermsAndScores(selectedProfile); foreach (var profile in filteredProfiles.Select(x => x.Profile))
continue; {
PrintTermsAndScores(profile);
} }
filteredProfiles.Add((selectedProfile, configProfile.Tags)); return;
} }
await ProcessReleaseProfiles(filteredProfiles); await ProcessReleaseProfiles(filteredProfiles);

Loading…
Cancel
Save