dynamiccookies / Radarr-Assistant

An interface that ties into Radarr's API to allow searching for movies, verifying movies currently in the Radarr library, and adding movies to Radarr's queue.
MIT License
0 stars 0 forks source link

Add collection link to search for entire collections #15

Open dynamiccookies opened 2 years ago

dynamiccookies commented 2 years ago

If you see one movie in a collection, you may want to search/add the entire collection.

dynamiccookies commented 2 years ago

The Collections API has not been released on the master branch of Radarr yet.

Additionally, /api/v3/collection/{id} uses the internal database's ID, not the tmdbId. BUT, in talking with devs on the Discord server, Qstick said they would add the option to search by tmdbId!

I'm still not sure if the searching by tmdbId will only search movies currently in the library that are part of that collection, or if it will search all movies for that collection regardless of their hasFile status.

The goal for this issue will be to pull the collection tmdbId from the movie's JSON data:

"collection": {
      "name": "Iron Man Collection",
      "tmdbId": 131292,
      "images": []
    },

Currently the entire collection array is being returned here:

https://github.com/dynamiccookies/Radarr-Assistant/blob/8a711fb0fe5ccea2dd78d9bebd1962a186f36584/script.js#L79

so to pull the ID it would just be if (collection) var collectionId = collection.tmdbId;

At that point, the new collection API specific to querying by tmdbId could be used to return the collection data.

If this doesn't return the full collection data regardless of whether they're in the library, the next step would be to query the tmdb online API.

dynamiccookies commented 1 year ago

As of Radarr stable release 4.2.4.6635, the API allows for searching collections by tmdbId. However, unfortunately, it only returns movies in the collection that you currently have added to your Radarr server. It does not return any missing items.

Just submitted request to Qstick on discord for feature enhancement.

dynamiccookies commented 1 year ago

Discovered it does query all missing and non-missing movies. I just had to run the Refresh Collections job to update the metadata.

Unfortunately, there doesn't seem to be a hasFile attribute on in the movie results. So, I'll either need to take the collection results and check each movie against another API call, or perhaps they'll add the feature.

I requested the feature on discord.

dynamiccookies commented 1 year ago

It turns out hasFile will be deprecated in a future release, and it's recommended to use sizeOnDisk for determining whether a file exists on the server. If no file exists, the value will be 0.

Unforunately, sizeOnDisk is also missing from the Collections return JSON, so this will need to wait until it can be added.