Standardize Trakt Import List Settings#8413
Standardize Trakt Import List Settings#8413Andrew-Ukkonen wants to merge 6 commits intoSonarr:v5-developfrom
Conversation
|
I always understood that filtering was not possible on user lists, only on popular lists. Have you tested this? |
|
@stevietv I partially tested this. I never fully created the list, but I did test (you can see the checkmark). I also tested in Trakt's URL by adding genres. I've tried tests that created both positive results and negative results to see if it returns data. I'll create the import list and get back to you. |
|
That just confirms that the request doesn't fail. If they're not outright rejecting invalid parameters that doesn't really test that it works. Additional parameters was intentionally removed because things didn't work for user lists. |
I think they used the wrong filter. the filter is 'years' not 'year' |
* enforce consistency between generators * separate additional parameters from manually added parameters. update years text between popular and user lists
markus101
left a comment
There was a problem hiding this comment.
Thanks for the fixes, looking better, mostly small clean up and more validation limits.
| RuleFor(c => c.Listname).NotEmpty(); | ||
|
|
||
| RuleFor(c => c.Years) | ||
| .Matches(@"^\d+(\-\d+)?$", RegexOptions.IgnoreCase) |
There was a problem hiding this comment.
This should be further limited to supported year formats, otherwise something like 234923498237423-234723477 would still pass.
| RuleFor(c => c.AuthUser).NotEmpty(); | ||
|
|
||
| RuleFor(c => c.Rating) | ||
| .Matches(@"^\d+\-\d+$", RegexOptions.IgnoreCase) |
There was a problem hiding this comment.
This should also be more restrictive, if the range is 0-100, something like this might work better
| .Matches(@"^\d+\-\d+$", RegexOptions.IgnoreCase) | |
| .Matches(@"^\d{1,2}\-(?:\d{1-2}|100)$", RegexOptions.IgnoreCase) |
Unless 100-100 is valid, then both sides of the - should be the same.
| .WithMessage("Not a valid rating"); | ||
|
|
||
| RuleFor(c => c.Years) | ||
| .Matches(@"^\d+(\-\d+)?$", RegexOptions.IgnoreCase) |
| .WithMessage("Must be integer greater than 0"); | ||
|
|
||
| RuleFor(c => c.Rating) | ||
| .Matches(@"^\d+\-\d+$", RegexOptions.IgnoreCase) |
| var key = parts[0].Trim(); | ||
|
|
||
| // Skip explicitly handled parameters | ||
| if (key.Equals("genres", StringComparison.OrdinalIgnoreCase) || |
There was a problem hiding this comment.
Can we add validation to prevent this as well as this safety net?
| { | ||
| var key = parts[0].Trim(); | ||
|
|
||
| // Skip explicitly handled parameters |
| { | ||
| var parameters = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase); | ||
|
|
||
| // Parse additional parameters first (lower priority) |
Co-authored-by: Mark McDowall <[email protected]>








Description
Added rating, genres, and years to all trakt import lists
Screenshots for UI Changes