-
Notifications
You must be signed in to change notification settings - Fork 2
Simplify and correct quality profile module format #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Well, CI really isn't liking me. I don't think the issues with the ansible-test suite are my doing, as those are always the same even for code I didn't touch. The linter warnings I think I fixed? Though I don't understand the warning about the trailing newlines seeing as there is only a single new line at the end of the file which is correct. |
|
Sanity is coming from |
| formats_dict = {item['name']: item for item in want.format_items} | ||
| for key, value in module.params['formats'].items(): | ||
| formats_dict[key].score = value | ||
| want.format_items = list(formats_dict.values()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get this, let's say I want to specify different scores to different custom formats, am I able to do that?
However, I like the idea of populating the formats from here. Right now there is probably an issue if you add a custom format but you don't update your quality profile with the new custom format. On the first edit it'll surely fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, custom formats are now just speicifed as
formats:
AAC: 1000
DTS: 2000Or something like that. If you add a custom format and don't update the quality profile nothing should break though. It'll grab the new schema, apply the modifications, see that the result is the same as you get in Sonarr(when a new custom format is added it's added to each quality profile with a score of zero) and everything will be fine?
|
Hi @francoiseger, Maybe the test task is just having some issue. Since you already tested this, can you share the task you already tested? |
|
It should work and this error doesn't make much sense-is it possible that you are running the initial commit of this PR rather than the most recent? That one was broken in just this way. |
|
Well the code is still working for me. It's rebased now, maybe CI will like me this time. |
|
That should hopefully be all that's needed to fix this. If not, I'll only really have time to take a more in depth look in two weeks or so. |
|
Any chance this could be merged ? The inability of ordering disabled qualities is a pretty big issue. |
|
Hi @RomLecat I'm sorry but this has diverged too much, it's not going to be merged. The issue this PR was solving (#68) was about missing disabled qualities, and should be solved since v1.1.1 but neither this PR, nor the fix that was merged, is giving you the ability of ordering disabled qualities. |
|
Yes, Sonarr actually evaluates disabled qualities as well. Enabling/disabling qualities only allows Sonarr to grab them. For instance, if WEBDL-2160p (disabled) is rated above WEBDL-1080p (enabled) and the files on the disk are WEBDL-2160p, Sonarr will not download WEBDL-1080p releases. This PR also was more convenient at managing qualities by their name, instead of having to fetch them using info module beforehand. |
|
Understood, thanks! I guess I've just never encountered the case where there are episodes in a quality not enabled on the quality profile itself. Could you please open a new issue about ordering disabled qualities? About the quality name, it is a nice feature indeed. I just thought that fetching the quality by info module was less error prone. We can think of changing that, but we'll have to make a breaking change for this module. |
Fixed #68, I didn't want to wait. I can't say I've ever written an Ansible module before so I am not entirely sure about the documentation format and the like, nor am I sure how to run the tests, but it works in my testing. Basically I am just editing the schema's return value rather than creating our own resource, which is likely the intended usage anyway.