golift.io/starr@v1.0.0/starrcmd/lidarr.go (about)

     1  //nolint:lll
     2  package starrcmd
     3  
     4  /*
     5  All 7 Lidarr events are accounted for; 1/30/2022.
     6  https://github.com/Lidarr/Lidarr/blob/develop/src/NzbDrone.Core/Notifications/CustomScript/CustomScript.cs
     7  */
     8  
     9  import (
    10  	"time"
    11  )
    12  
    13  // LidarrApplicationUpdate is the ApplicationUpdate event.
    14  type LidarrApplicationUpdate struct {
    15  	PreviousVersion string `env:"lidarr_update_previousversion"` // 4.0.3.5875
    16  	NewVersion      string `env:"lidarr_update_newversion"`      // 4.0.4.5909
    17  	Message         string `env:"lidarr_update_message"`         // Lidarr updated from 4.0.3.5875 to 4.0.4.5909
    18  }
    19  
    20  // LidarrHealthIssue is the HealthIssue event.
    21  type LidarrHealthIssue struct {
    22  	Message   string `env:"lidarr_health_issue_message"` // Lists unavailable due to failures: List name here
    23  	IssueType string `env:"lidarr_health_issue_type"`    // ImportListStatusCheck
    24  	Wiki      string `env:"lidarr_health_issue_wiki"`    // https://wiki.servarr.com/lidarr/
    25  	Level     string `env:"lidarr_health_issue_level"`   // Warning
    26  }
    27  
    28  // LidarrGrab is the Grab event.
    29  type LidarrGrab struct {
    30  	DownloadClient string      `env:"lidarr_download_client"`             // Deluge
    31  	AlbumCount     int         `env:"lidarr_release_albumcount"`          // 1
    32  	Size           int64       `env:"lidarr_release_size"`                // 433061888
    33  	ReleaseDates   []time.Time `env:"lidarr_release_albumreleasedates,,"` // 4/21/2010 12:00:00 AM
    34  	ArtistID       int64       `env:"lidarr_artist_id"`                   // 262
    35  	ArtistName     string      `env:"lidarr_artist_name"`                 // Tom Petty and the Heartbreakers
    36  	MBID           string      `env:"lidarr_artist_mbid"`                 // f93dbc64-6f08-4033-bcc7-8a0bb4689849
    37  	Indexer        string      `env:"lidarr_release_indexer"`             // Indexilate (Prowlarr)
    38  	QualityVerson  int64       `env:"lidarr_release_qualityversion"`      // 1
    39  	Quality        string      `env:"lidarr_release_quality"`             // FLAC
    40  	ReleaseGroup   string      `env:"lidarr_release_releasegroup"`        //
    41  	ReleaseTitle   string      `env:"lidarr_release_title"`               // Tom Petty & The Heartbreakers - Mojo (2010) [FLAC (tracks + cue)]
    42  	AlbumMBIDs     []string    `env:"lidarr_release_albummbids,|"`        // 75f6f410-73e6-485b-898d-6fdaea4c0266
    43  	DownloadID     string      `env:"lidarr_download_id"`                 // 4A87D9F5F92D82DF4076463E90CC49F27077CB10
    44  	Titles         []string    `env:"lidarr_release_albumtitles,|"`       // Mojo
    45  	ArtistType     string      `env:"lidarr_artist_type"`                 // Group
    46  }
    47  
    48  // LidarrAlbumDownload is the AlbumDownload event.
    49  type LidarrAlbumDownload struct {
    50  	ArtistID         int64     `env:"lidarr_artist_id"`         // artist.Id.ToString())
    51  	ArtistName       string    `env:"lidarr_artist_name"`       // artist.Metadata.Value.Name)
    52  	Path             string    `env:"lidarr_artist_path"`       // artist.Path)
    53  	ArtistMBID       string    `env:"lidarr_artist_mbid"`       // artist.Metadata.Value.ForeignArtistId)
    54  	ArtistType       string    `env:"lidarr_artist_type"`       // artist.Metadata.Value.Type)
    55  	AlbumID          int64     `env:"lidarr_album_id"`          // album.Id.ToString())
    56  	Title            string    `env:"lidarr_album_title"`       // album.Title)
    57  	MBID             string    `env:"lidarr_album_mbid"`        // album.ForeignAlbumId)
    58  	AlbumReleaseMBID string    `env:"lidarr_albumrelease_mbid"` // release.ForeignReleaseId)
    59  	ReleaseDate      time.Time `env:"lidarr_album_releasedate"` // album.ReleaseDate.ToString())
    60  	DownloadClient   string    `env:"lidarr_download_client"`   // message.DownloadClient ?? string.Empty)
    61  	DownloadID       string    `env:"lidarr_download_id"`       // message.DownloadId ?? string.Empty)
    62  	AddedTrackPaths  []string  `env:"lidarr_addedtrackpaths,|"` // string.Join("|", message.TrackFiles.Select(e => e.Path)))
    63  	DeletedPaths     []string  `env:"lidarr_deletedpaths,|"`    // string.Join("|", message.OldFiles.Select(e => e.Path)))
    64  }
    65  
    66  // LidarrRename is the Rename event.
    67  type LidarrRename struct {
    68  	ArtistID   int64  `env:"lidarr_artist_id"`   // artist.Id.ToString())
    69  	ArtistName string `env:"lidarr_artist_name"` // artist.Metadata.Value.Name)
    70  	Path       string `env:"lidarr_artist_path"` // artist.Path)
    71  	ArtistMBID string `env:"lidarr_artist_mbid"` // artist.Metadata.Value.ForeignArtistId)
    72  	ArtistType string `env:"lidarr_artist_type"` // artist.Metadata.Value.Type)
    73  }
    74  
    75  // LidarrTrackRetag is the TrackRetag event.
    76  type LidarrTrackRetag struct {
    77  	ArtistID         int64     `env:"lidarr_artist_id"`                // artist.Id.ToString())
    78  	ArtistName       string    `env:"lidarr_artist_name"`              // artist.Metadata.Value.Name)
    79  	Path             string    `env:"lidarr_artist_path"`              // artist.Path)
    80  	ArtistMBID       string    `env:"lidarr_artist_mbid"`              // artist.Metadata.Value.ForeignArtistId)
    81  	ArtistType       string    `env:"lidarr_artist_type"`              // artist.Metadata.Value.Type)
    82  	ID               int64     `env:"lidarr_album_id"`                 // album.Id.ToString())
    83  	Title            string    `env:"lidarr_album_title"`              // album.Title)
    84  	MBID             string    `env:"lidarr_album_mbid"`               // album.ForeignAlbumId)
    85  	AlbumReleaseMBID string    `env:"lidarr_albumrelease_mbid"`        // release.ForeignReleaseId)
    86  	ReleaseDate      time.Time `env:"lidarr_album_releasedate"`        // album.ReleaseDate.ToString())
    87  	FileID           int64     `env:"lidarr_trackfile_id"`             // trackFile.Id.ToString())
    88  	TrackCount       string    `env:"lidarr_trackfile_trackcount"`     // trackFile.Tracks.Value.Count.ToString())
    89  	FilePath         string    `env:"lidarr_trackfile_path"`           // trackFile.Path)
    90  	TrackNumbers     []int     `env:"lidarr_trackfile_tracknumbers,,"` // string.Join(",", trackFile.Tracks.Value.Select(e => e.TrackNumber)))
    91  	TrackTitles      []string  `env:"lidarr_trackfile_tracktitles,|"`  // string.Join("|", trackFile.Tracks.Value.Select(e => e.Title)))
    92  	Quality          string    `env:"lidarr_trackfile_quality"`        // trackFile.Quality.Quality.Name)
    93  	QualityVersion   int64     `env:"lidarr_trackfile_qualityversion"` // trackFile.Quality.Revision.Version.ToString())
    94  	ReleaseGroup     string    `env:"lidarr_trackfile_releasegroup"`   // trackFile.ReleaseGroup ?? string.Empty)
    95  	SceneName        string    `env:"lidarr_trackfile_scenename"`      // trackFile.SceneName ?? string.Empty)
    96  	TagsDiff         string    `env:"lidarr_tags_diff"`                // message.Diff.ToJson())
    97  	TagsScrubbed     bool      `env:"lidarr_tags_scrubbed"`            // message.Scrubbed.ToString())
    98  }
    99  
   100  // LidarrTest has no members.
   101  type LidarrTest struct{}
   102  
   103  // GetLidarrApplicationUpdate returns the ApplicationUpdate event data.
   104  func (c *CmdEvent) GetLidarrApplicationUpdate() (output LidarrApplicationUpdate, err error) {
   105  	return output, c.get(EventApplicationUpdate, &output)
   106  }
   107  
   108  // GetLidarrHealthIssue returns the ApplicationUpdate event data.
   109  func (c *CmdEvent) GetLidarrHealthIssue() (output LidarrHealthIssue, err error) {
   110  	return output, c.get(EventHealthIssue, &output)
   111  }
   112  
   113  // GetLidarrGrab returns the Grab event data.
   114  func (c *CmdEvent) GetLidarrGrab() (output LidarrGrab, err error) {
   115  	return output, c.get(EventGrab, &output)
   116  }
   117  
   118  // GetLidarrAlbumDownload returns the AlbumDownload event data.
   119  func (c *CmdEvent) GetLidarrAlbumDownload() (output LidarrAlbumDownload, err error) {
   120  	return output, c.get(EventAlbumDownload, &output)
   121  }
   122  
   123  // GetLidarrRename returns the Rename event data.
   124  func (c *CmdEvent) GetLidarrRename() (output LidarrRename, err error) {
   125  	return output, c.get(EventRename, &output)
   126  }
   127  
   128  // GetLidarrTrackRetag returns the TrackRetag event data.
   129  func (c *CmdEvent) GetLidarrTrackRetag() (output LidarrTrackRetag, err error) {
   130  	return output, c.get(EventTrackRetag, &output)
   131  }
   132  
   133  // GetLidarrTest returns the ApplicationUpdate event data.
   134  func (c *CmdEvent) GetLidarrTest() (output LidarrTest, err error) {
   135  	return output, c.get(EventTest, &output)
   136  }