Skip to content

Commit

Permalink
these do not need to be pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Jul 7, 2024
1 parent 38b86ef commit eecfdce
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
20 changes: 10 additions & 10 deletions radarr/movieeditor.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ const bpMovieEditor = bpMovie + "/editor"
// 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 *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
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.
Expand Down
4 changes: 2 additions & 2 deletions radarr/movieeditor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ func TestEditMovies(t *testing.T) {
WithRequest: &radarr.BulkEdit{
MovieIDs: []int64{17, 13},
Tags: []int{44, 55, 66},
ApplyTags: starr.TagsAdd.Ptr(),
MinimumAvailability: radarr.AvailabilityToBeAnnounced.Ptr(),
ApplyTags: starr.TagsAdd,
MinimumAvailability: radarr.AvailabilityToBeAnnounced,
},
ExpectedRequest: `{"movieIds":[17,13],"minimumAvailability":"tba","tags":[44,55,66],"applyTags":"add"}` + "\n",
ExpectedMethod: http.MethodPut,
Expand Down
5 changes: 0 additions & 5 deletions shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,6 @@ const (
TagsReplace ApplyTags = "replace"
)

// Ptr returns a pointer to an apply tags value. Useful for a BulkEdit struct.
func (a ApplyTags) Ptr() *ApplyTags {
return &a
}

// TimeSpan is part of AudioTags and possibly used other places.
type TimeSpan struct {
Ticks int64 `json:"ticks"`
Expand Down

0 comments on commit eecfdce

Please sign in to comment.