Radarr - File Size rule executor always returns null
Describe the bug Every rule with Radarr's size returns null as a size
To Reproduce Steps to reproduce the behavior:
- Add the rule with Radarr's file size > 100mb
- Test the rule via Collections>(collection)>Test Media
- firstValue in a rule is null
Expected behavior firstValue of the operation should = file size in MB.
Screenshots
Device (please complete the following information):
- OS: Arch Linux, docker-compose
- Version: Maintainerr 2.0.4, Radarr 5.7.0.8882
Additional context JSON of the rule executor:
- id: 1
result: false
operator: AND
ruleResults:
- operator: OR
action: bigger
firstValueName: Radarr - File - size in MB
firstValue: null
secondValueName: number
secondValue: 100
result: false
- id: 2
result: true
operator: AND
ruleResults:
- operator: OR
action: not_equals
firstValueName: Radarr - File - file path
firstValue: /mnt/media-library/plex/Movies/2001 A Space Odyssey (1968)/2001 A
Space Odyssey (1968) {imdb-tt0062622} {languages-
{edition-Remastered} [4K Remaster][Bluray-1080p][EAC3
5.1][x264]-hallowed.mkv
secondValueName: text
secondValue: asd
result: true
Hey, thanks for your report! It appears your Radarr instance is not returning the expected 'sizeOnDisk' property needed by Maintainerr.
Is there anything of use in the Maintainerr log while testing this?
Could you return the response from a manual Radarr lookup through the API for this particular movie? You should be able to do it with the 'movie lookup' endpoint, and with the term 'tmdb:62' (62 being 2001 A Space Odyssey's TMDB ID)
https://radarr.video/docs/api/#/MovieLookup/get_api_v3_movie_lookup
I am having this issue as well. I want to create rules using the file size as criteria for building collections. I created a very simple rule (file size greater than 1 MB) but have been unable to get the rule to work:
mediaType: MOVIES
rules:
- "0":
- firstValue: Radarr.fileSize
action: BIGGER
customValue:
type: number
value: 1
I tested within Maintainer for the movie "The Third Man" which is ~2 GB and got the following return. I tailed the log file while doing the test but no logs were produced when I clicked the test button.
- plexId: 55857
result: false
sectionResults:
- id: 0
result: false
ruleResults:
- operator: OR
action: bigger
firstValueName: Radarr - File - size in MB
firstValue: null
secondValueName: number
secondValue: 1
result: false
I then tested against the Radarr API and have attached the output, test.json, to this post.
Hoping this is enough information to lead to a solution/suggestion.
Platform: Debian 12 VM running on Proxmox 8.2.4 Containers: Docker v27.1.1 Maintainerr: v2.0.4 Radarr: v5.8.3.8933 test.json
The Radarr response is missing the expected 'sizeOnDisk' parameter, hence the null value. I wonder if this recently changed on Radarr's side, since that property used to always be there.
I pushed a fallback to moviefile.size in https://github.com/jorenn92/Maintainerr/pull/1205.
Many thanks. When will the fix be released so my docker compose will pick up a fixed image?
Many thanks. When will the fix be released so my docker compose will pick up a fixed image?
There is no timeframe yet. There haven't been that many changes since the last one. However, I might push a small release with a few bug fixes in the following weeks,
The Radarr response is missing the expected 'sizeOnDisk' parameter, hence the null value. I wonder if this recently changed on Radarr's side, since that property used to always be there.
Hello!
Yes, it was moved on Jan 16, 2024 under statistics when I worked on displaying release groups in the UI. Looks like I broke BC on this one but it was the same value as movieFile?.Size ?? 0. 🥲
I noticed this method that uses /movie/lookup and this might be an issue.
https://github.com/jorenn92/Maintainerr/blob/a13d64cd6260ee705905b515e240d14fee23b940/server/src/modules/api/servarr-api/helpers/radarr.helper.ts#L38-L44
/api/v3/movie/lookup?term=tmdb:123 is good for getting the metadata to add a new movie to the library, but for fetching data from users' library I would recommend using /api/v3/movie?tmdbId=92959 to prevent any requests from being sent to Radarr's metadata.
The property movieFile under movie resources is somewhat planned to be eventually removed in future versions when multiple file support would be added.
/api/v3/movie/lookup?term=tmdb:123is good for getting the metadata to add a new movie to the library, but for fetching data from users' library I would recommend using/api/v3/movie?tmdbId=92959to prevent any requests from being sent to Radarr's metadata.
Hey, thanks for the clarification and suggestion! I wasn't aware that lookup wasn't intended to be used for this purpose. I ran a quick test comparing the two endpoints, and it seems that '/movie?tmdbId=' is a bit more reliable. For some reason, lookup didn't show a movie as available, while the other endpoint did. I've made the necessary changes in this pull request.
The property
movieFileunder movie resources is somewhat planned to be eventually removed in future versions when multiple file support would be added.
Thanks for the heads up. I'll need to watch out for that change. When multi-file support is added, the filesize (and potentially others as well) rule will have to be rewritten.
Yea, there was spent more time on /movie to add stats and other necessary data to display in the UI.
Regarding your change, on this line you need to add a new method that uses the old lookup method if you want to add a new movie, since the endpoint I recommended is only returning movies already in your library.
https://github.com/jorenn92/Maintainerr/blob/1a84b8cf505bb6216af8a85ab907b3c912bdd267/server/src/modules/api/servarr-api/helpers/radarr.helper.ts#L53-L57
Hope that clears out things.
Regarding your change, on this line you need to add a new method that uses the old lookup method if you want to add a new movie, since the endpoint I recommended is only returning movies already in your library.
I see, thank you! The addMovie method is leftover code, it's not in use anymore, Maintainerr isn't intended to add anything to *arr apps, I've removed the code in https://github.com/jorenn92/Maintainerr/pull/1215 to avoid future confusion.
Closing the issue, the fix was released in release 2.1.0.