gethomepage / homepage

A highly customizable homepage (or startpage / application dashboard) with Docker and service API integrations.
https://gethomepage.dev
GNU General Public License v3.0
18.73k stars 1.1k forks source link

Bug: Radarr widget incorrectly interprets `isAvailable` #397

Closed Magelo closed 1 year ago

Magelo commented 1 year ago
    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 https://github.com/benphelps/homepage/issues/43#issuecomment-1279971986

Magelo commented 1 year ago

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.

ToqQrrl commented 1 year ago

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 commented 1 year ago

Please see https://github.com/benphelps/homepage/pull/418#issuecomment-1286020469 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 commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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.

github-actions[bot] commented 8 months ago

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.