Registering this type fails the unit tests because it cannot be
constructed unless you use Lazy<> otherwise it throws due to the active
service command not being set yet in the IActiveServiceCommandProvider
class.
The Sonarr developers made a backward-breaking API change resulting in
Trash Updater being unable to obtain, create, or update release
profiles. This fix keeps backward compatibility with the previous and
current schema at the cost of additional code complexity.
The specific breakage was in the Ignored and Required properties of the
Release Profile JSON schema. They were converted from string type to
array.
Offending change:
deed85d2f9/src/NzbDrone.Core/Datastore/Migration/162_release_profile_to_array.csFixes#16
Move non-CLI specific code from Trash project to TrashLib. This is for
future code sharing with Recyclarr. Trash project is officially
deprecated and will eventually go away in favor of the web app.
A new setting under `quality_profiles` of the custom format listing
named `reset_unmatched_scores` that allows the user to specify if
unmapped scores (those CFs not specified in config) should be reset to 0
during quality profile updates.
Fixes#10.
Trash has started putting scores in the actual importable JSON data. If
a score is found in the JSON data, that takes precedence over any score
parsed from the guide markdown. The `trash_score` field is not required
for backward compatibility.
There was an ambiguity with one custom format named 'DoVi'. This one had
two custom formats in the guide. The intent was for the user to choose
only one of these, but the name was kept identical so that name appeared
in the filename for media when it was renamed.
This allows the user to choose which of those two they want using the
`trash_id` property.
Add a version number field to the custom format cache object. This is an
attempt at future-proofing the cache in case I ever need to update the
schema in a non-backward compatible way.
- Synchronize custom formats to Radarr
- Quality profiles can be assigned scores from the guide
- Deletion support for custom formats removed from config or the guide.
- Caching system for keeping track of Custom Format IDs and Trash IDs to
better support renames, deletions, and other stateful behavior.
Also added some code sharing between Radarr and Sonarr for this stuff,
since they are largely similar (Radarr has preferred size but the rest
is the same).
This allows for code to access the active IServiceCommand object, which
represents a subcommand that provides an implementation for a service
like Radarr or Sonarr.
- Executable is now compiled using Ready to Run. This increases the size
of the executable but makes the code much faster.
- `src` directory is no longer the cwd
- The matrix build in build.yml now runs on its respective platform to
avoid cross compilation. Cross compiling does not work with the
ReadyToRun optimization on, see:
https://docs.microsoft.com/en-us/dotnet/core/deploying/ready-to-run#cross-platformarchitecture-restrictions
- publish and zip steps in the workflow have been put in a powershell
script for reusability and to keep the workflow YAML minimal.
Terms marked "optional" (preferred, ignored, and required) are now
separated out from the main list of terms. Right now, any optional terms
are NOT uploaded to Sonarr. In the future, I plan to add ways to
explicitly include optional terms.
The structure for optional terms in the guide is similar to that of
categories. A header OR line within the header section can mention the
word "optional" and that means any code blocks past that point until the
end of the section are treated as optional.
Other changes:
- Delete test trash.yml
- Add new ScopedState class
Used to manage resetting certain parser state between different
sections of the guide (for single code blocks or whole header
sections)
A potential score is one where a number between brackets is found (e.g.
[100]) but the word "score" is not before it. A warning is logged to
notify the user of a potential issue with the guide itself.
Other changes:
- `Serilog.Sinks.TestCorrelator` package added to test log output
messages.
- New StringUtils class in TestLibrary
- Refactored `Regex.Match()` calls to use new extension method that
allows the match to be directly used as an expression in an `if`
condition while also providing the match object as output.
If a tag was not specified in the YAML configuration, an exception would
occur. Logic has been added to properly check for (and allow) empty tags
elements.
The `--strict-negative-scores` option will take any negative preferred
term scores and move those terms to the "Must Not Contains" (ignored)
field of the release profile.
The hybrid quality is auto-generated and takes values between the anime
and non-anime tables in the following way:
* The lowest minimum and highest maximum between the non-anime and anime
tables are used as the min/max for each quality in the generated
hybrid table.
* Only 720/1080 qualities are "combined". Qualities outside of this,
such as 2160, use the non-anime min/max values.
From the Quality Definitions (File Sizes) page of the TRaSH guides, you
can now sync the anime or non-anime quality profile to your Sonarr
instance. There is also a hybrid mode but that is not yet implemented.