golift.io/starr@v1.0.0/lidarr/lidarr.go (about) 1 package lidarr 2 3 import ( 4 "strings" 5 6 "golift.io/starr" 7 ) 8 9 // APIver is the Lidarr API version supported by this library. 10 const APIver = "v1" 11 12 // Lidarr contains all the methods to interact with a Lidarr server. 13 type Lidarr struct { 14 starr.APIer 15 } 16 17 // Filter values are integers. Given names for ease of discovery. 18 // https://github.com/Lidarr/Lidarr/blob/c2adf078345f81012ddb5d2f384e2ee45ff7f1af/src/NzbDrone.Core/History/History.cs#L35-L45 19 // 20 //nolint:lll 21 const ( 22 FilterUnknown starr.Filtering = iota 23 FilterGrabbed 24 FilterArtistFolderImported 25 FilterTrackFileImported 26 FilterDownloadFailed 27 FilterDeleted 28 FilterRenamed 29 FilterImportFailed 30 FilterDownloadImported 31 FilterRetagged 32 FilterIgnored 33 ) 34 35 // New returns a Lidarr object used to interact with the Lidarr API. 36 func New(config *starr.Config) *Lidarr { 37 if config.Client == nil { 38 config.Client = starr.Client(0, false) 39 } 40 41 config.URL = strings.TrimSuffix(config.URL, "/") 42 43 return &Lidarr{APIer: config} 44 }