Closed davidnewhall closed 2 years ago
Looks great! Unmonitoring works, but DeleteFiles and AddImportExclusion doesn't work on my end.
Did you mean DeleteMovie
or DeleteMovies
?
We'll have to address AddImportExclusion
in another conversation. edit: oh, derp, you mean AddImportExclusion
as part of the input. I see it now. Can you share your code?
AddImportExclusion
is documented here: https://radarr.video/docs/api/#/MovieEditor/delete_api_v3_movie_editor
...but I don't see any way to trigger it in the UI, so it may not actual work? Can you get an example payload where this works?
I meant DeleteFiles
in this code block
edit := &radarr.EditMovies{
MovieIDs: []int64{1, 2, 3},
Monitored: starr.True(),
DeleteFiles: starr.True(),
}
So it bulk deletes all movies and their files.
For the AddImportExclusion
I created a simple request:
request, _ := json.Marshal(map[string]any{
"movieIds": []int64{1, 2, 3},
"monitored": false,
"deleteFiles": true,
"addImportExclusion": true,
})
and sent it via:
req, err := http.NewRequest("DELETE", url, bytes.NewBuffer(request))
// error handling
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
_, err := client.Do(req);
// error handling
url is xxx/api/v3/movie/editor?apikey=xxx
I suspect those things do not actually work in radarr. Do you know how to do these actions in the UI? So I can reproduce and see what the difference is.
You can bulk delete movies in the UI by going to "Movies" > clicking on the "Movie Editor" button > selecting multiple movies and clicking on Delete on the bottom right. But I don't think you can add movies to the exclusion list via the UI. That's only possible with an api call. The request I sent in the previous message actually works and it deletes all the movie files in the movieID list and puts the movies under "Settings" > "Lists" > "List Exclusions" in the UI.
oh, I see what the problem is.
Okay, I gave delete the same inputs as edit, so you can pass in those fields. Good to know how it works, thanks! I also renamed the struct to BulkEdit
. Try this:
r.DeleteMovies(&radarr.BulkEdit{
MovieIDs: []int64{1, 2, 3},
DeleteFiles: starr.True(),
Monitored: starr.False(),
AddImportExclusion: starr.True(),
})
Awesome it works now :D
AddImportExclusion
is documented here: https://radarr.video/docs/api/#/MovieEditor/delete_api_v3_movie_editor ...but I don't see any way to trigger it in the UI, so it may not actual work? Can you get an example payload where this works?
This is a modal prompt when you delete movies. Same prompt when deleting movie (not via editor)
delete files add To exclusion list
But I don't think you can add movies to the exclusion list via the UI. That's only possible with an api call.
discover tab has this option to select and exclude
Otherwise when deleting a movie or movies the exclusion list is a modal confirmation checkbox
I think I'm gonna turn those inputs into enums. We can probably re-use them in a few places.
How's that look @Fuochi ?
But I don't think you can add movies to the exclusion list via the UI. That's only possible with an api call. The request I sent in the previous message actually works and it deletes all the movie files in the movieID list and puts the movies under "Settings" > "Lists" > "List Exclusions" in the UI.
You can add movies to the exclusion list on the List Exclusions page @NCRoxas ... There is a + at the bottom of the list.
Adds movie editor endpoint. Adds movie delete and bulk delete endpoints. Closes #68. @NCRoxas, can you test this?