Skip to content
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

Bug: Radarr widget incorrectly interprets isAvailable #397

Closed
Magelo opened this issue Oct 17, 2022 · 7 comments · Fixed by #418
Closed

Bug: Radarr widget incorrectly interprets isAvailable #397

Magelo opened this issue Oct 17, 2022 · 7 comments · Fixed by #418

Comments

@Magelo
Copy link

Magelo commented Oct 17, 2022

    For radarr, @benphelps, I think you are misinterpreting the value "isAvailable: false"... It mean it's not in local Radarr library **and not yet available**, it simply mean it is not available at all, it's a futur movie not available period. So counting "isAvailable: false" will result in a partial Wanted/Missing totalRecords...

You should count "sizeOnDisk": 0 to determined Wanted/Missing movies in a local Radarr Library.

Originally posted by @Magelo in #43 (comment)

@Magelo
Copy link
Author

Magelo commented Oct 19, 2022

I originally reponded in "Sonarr and Radarr both say 0 wanted #43", but the issue is closed. I first responded and then realize the issue was closed. So I'm repeating here what I wrote in the other issue, hoping someone will make sense about what I'm explaining.

I have mixted result. Depending on certain combination with "Min availability" and "Status", the movie will be "isAvailable: false" or "isAvailable: true"...

Adding "Hancock 2" with min availability "Announced" status will be "Missing" and "isAvailable: true".
Adding "Hancock 2" with min availability "Released" status will be "Not available" and "isAvailable: false".

For Radarr widget, Wanted should be counted with "sizeOnDisk = 0" and Have (Movies) counted with "sizeOnDisk > 0".

Queued is working properly.

JazzFisch added a commit to JazzFisch/homepage that referenced this issue Oct 20, 2022
@shamoon shamoon changed the title For radarr, @benphelps, I think you are misinterpreting the value "isAvailable: false"... It mean it's not in local Radarr library **and not yet available**, it simply mean it is not available at all, it's a futur movie not available period. So counting "isAvailable: false" will result in a partial Wanted/Missing totalRecords... Bug: Radarr widget incorrectly interprets isAvailable Oct 20, 2022
@ToqQrrl
Copy link

ToqQrrl commented Oct 20, 2022

I confirm that the [isAvailable] flag returned by the API is not the proper property that needs to be checked to determine the proper << WANTED >> movie count.

I have tested the use of the [sizeOnDisk = 0] property and the SUM of the movies that have [sizeOnDisk = 0] gives us the proper and real << WANTED >> movie count.

@shamoon
Copy link
Collaborator

shamoon commented Oct 20, 2022

Please see #418 (comment) the Radarr app itself uses monitored && !hasFile && isAvailable see https://github.com/Radarr/Radarr/blob/9b3770a018a2fd9f6a5af71930bbb2a2180c2cce/frontend/src/Store/Actions/movieActions.js#L67

I suggest we use that, but I will leave it up to the PR author

@Magelo
Copy link
Author

Magelo commented Oct 21, 2022

to me it's better to keep it simple :

Wanted: sizeOnDisk = 0
Movies (have): sizeOnDisk > 0
Queued : /api/v3/queue/status is working fine

if I read the code right, two arrays are constructed and counted and give Wanted and Have with those lines

map: (data) => ({
wanted: jsonArrayFilter(data, (item) => item.isAvailable === false).length,
have: jsonArrayFilter(data, (item) => item.isAvailable === true).length,
})

It should be easy to replace item.isAvailable with item.sizeOnDisk and replace boolean with the proper number test.

All this because Radarr's api lack a proper way to get Missing/Wanted movies.

@JazzFisch
Copy link
Collaborator

JazzFisch commented Oct 21, 2022

@Magelo to avoid any ambiguity, I made the widget behave just like Radarr's UI. I have added a new filed "Missing" to round out the available display options. Here's an example of what it will look like:
image

@Magelo
Copy link
Author

Magelo commented Oct 21, 2022

It looks good @JazzFisch.

have: jsonArrayFilter(data, (item) => item.hasFile).length

(I was affraid Monitored would be used to filter the list which would not be ok for me)

wanted: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile && item.isAvailable).length,

Makes sense! If I want it, it should be monitored and in my list with no files, but in my case isAvailable=true is showned "Statut=Missing" in Radarr and isAvailable=false is showned "Status=Not available"

And in the end, missing movies are kind of Wanted too, not?

Thanks for the modifications, hope to test this soon.

Copy link
Contributor

github-actions bot commented Feb 6, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants