-
Notifications
You must be signed in to change notification settings - Fork 19
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
Add movie editor endpoints #69
Changes from 1 commit
0ab5fd5
9735b7c
dedd989
574338e
e14d1f8
cc0cd9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,5 +30,10 @@ linters: | |
- dupl | ||
- nlreturn | ||
|
||
#linters-settings: | ||
# govet: | ||
# enable: | ||
# - fieldalignment | ||
|
||
run: | ||
timeout: 35m |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,17 +13,36 @@ const bpMovieEditor = bpMovie + "/editor" | |
|
||
// BulkEdit is the input for the bulk movie editor endpoint. | ||
// You may use starr.True(), starr.False(), starr.Int64(), and starr.String() to add data to the struct members. | ||
// Use Availability.Ptr() to add a value to minimum availability, and starr.ApplyTags.Ptr() for apply tags. | ||
type BulkEdit struct { | ||
MovieIDs []int64 `json:"movieIds"` | ||
Monitored *bool `json:"monitored,omitempty"` | ||
QualityProfileID *int64 `json:"qualityProfileId,omitempty"` | ||
MinimumAvailability *string `json:"minimumAvailability,omitempty"` // tba | ||
RootFolderPath *string `json:"rootFolderPath,omitempty"` // path | ||
Tags []int `json:"tags,omitempty"` // [0] | ||
ApplyTags *string `json:"applyTags,omitempty"` // add | ||
MoveFiles *bool `json:"moveFiles,omitempty"` | ||
DeleteFiles *bool `json:"deleteFiles,omitempty"` // delete only | ||
AddImportExclusion *bool `json:"addImportExclusion,omitempty"` // delete only | ||
MovieIDs []int64 `json:"movieIds"` | ||
Monitored *bool `json:"monitored,omitempty"` | ||
QualityProfileID *int64 `json:"qualityProfileId,omitempty"` | ||
MinimumAvailability *Availability `json:"minimumAvailability,omitempty"` // tba | ||
RootFolderPath *string `json:"rootFolderPath,omitempty"` // path | ||
Tags []int `json:"tags,omitempty"` // [0] | ||
ApplyTags *starr.ApplyTags `json:"applyTags,omitempty"` // add | ||
MoveFiles *bool `json:"moveFiles,omitempty"` | ||
DeleteFiles *bool `json:"deleteFiles,omitempty"` // delete only | ||
AddImportExclusion *bool `json:"addImportExclusion,omitempty"` // delete only | ||
} | ||
|
||
// Availability is an enum used as MinimumAvailability in a few places throughout Radarr. | ||
type Availability string | ||
|
||
// Availability / MinimumAvailability constants. | ||
// https://radarr.video/docs/api/#/MovieEditor/put_api_v3_movie_editor | ||
const ( | ||
AvailabilityToBeAnnounced Availability = "tba" | ||
AvailabilityAnnounced Availability = "announced" | ||
AvailabilityInCinemas Availability = "inCinemas" | ||
AvailabilityReleased Availability = "released" | ||
AvailabilityDeleted Availability = "deleted" | ||
) | ||
|
||
// Ptr returns a pointer to a minimum availability. Useful for a BulkEdit struct. | ||
func (a Availability) Ptr() *Availability { | ||
return &a | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't get the use case of this, can't you just use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You cannot make pointers to constants, so the user would have to do:
Then pass in |
||
|
||
// EditMovies allows bulk diting many movies at once. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is nice for a user perspective since it provides users with valid values. However, users can still use any string they want... so I'd say it doesn't make much difference for me, if you like this approach you can continue to use it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's all about users. This, if nothing else, gives them an easy way to see what values are appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a difference in status and availability. tba and deleted will not work as a minimum availability in radarr. "announced", "released" & "inCinemas"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Practical use would be the 3 nit mentioned
neither really has any practical use
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good. I just made them constants. Users don't have to use them. :)