Documentation ¶
Index ¶
- Constants
- Variables
- func Base64Decode(encodedData string) (string, error)
- func Base64Encode(decodedData string) string
- func CreateTagInRadarr(tagLabel string) (*int, error)
- func DeleteExpiredMovies(moviesdata []byte, moviesIgnored []string, nextMaintenanceCycle time.Time, ...) ([]string, error)
- func GetMovieAge(movie Movie) (*float64, error)
- func GetMoviesData() ([]byte, error)
- func GetMoviesIgnored(ignoreTagId int, moviesdata []byte) ([]string, error)
- func GetTagIdFromRadarr(tagLabel string) (*int, error)
- func InitializeConfig(configFile string) error
- func InitializeStatus(statusFile string) error
- func Job(statusFile string, isDryRun bool) error
- func MaintenanceCycleInInt(period Interval) int
- func MarkMoviesForDeletion(moviesdata []byte, moviesIgnored []string, nextMaintenanceCycle time.Time, ...) ([]string, error)
- func SendEmailNotification(subject, body string) error
- func SendGotifyNotification(title, body string) error
- func SendTelegramNotification(body string) error
- func UpdateStatusFile(lastMaintenanceDate string, ...) error
- type Configuration
- type GotifyConfig
- type Interval
- type Movie
- type MovieFileDetail
- type MovieImportEvent
- type NotificationChannel
- type RadarrConfig
- type SMTPConfig
- type Security
- type SonarrConfig
- type Status
- type Tag
- type TelegramConfig
Constants ¶
View Source
const JobSyncInterval time.Duration = 1 // Job syncs with config in every 1 hours
View Source
const StatusFileName string = "status.yaml"
Variables ¶
View Source
var Now time.Time
Functions ¶
func Base64Decode ¶
func Base64Encode ¶
func CreateTagInRadarr ¶
func DeleteExpiredMovies ¶
func GetMovieAge ¶
func GetMoviesData ¶
func GetTagIdFromRadarr ¶
func InitializeConfig ¶
func InitializeStatus ¶
func MaintenanceCycleInInt ¶
func MarkMoviesForDeletion ¶
func SendEmailNotification ¶
func SendGotifyNotification ¶
Types ¶
type Configuration ¶
type Configuration struct { MaintenanceCycle Interval `yaml:"maintenanceCycle"` DeleteAfterDays int `yaml:"deleteAfterDays"` IgnoreTag string `yaml:"ignoreTag"` NotificationChannel NotificationChannel `yaml:"notificationChannel"` Radarr RadarrConfig `yaml:"radarr"` Sonarr SonarrConfig `yaml:"sonarr"` }
var Config Configuration = Configuration{ MaintenanceCycle: Daily, DeleteAfterDays: 90, IgnoreTag: "cma-donotdelete", NotificationChannel: NotificationChannel{ SMTP: SMTPConfig{ Enabled: false, Server: "smtp.gmail.com", Port: 587, Security: TLS, Username: "example@gmail.com", B64Password: "dGgxc2lzbjB0QSQzY3IzdAo=", FromEmail: "example@gmail.com", ToEmail: []string{"alert@example.com"}, CcEmail: []string{""}, BccEmail: []string{""}, }, Gotify: GotifyConfig{ Enabled: false, URL: "gotify.local", B64AppToken: "dGgxc2lzbjB0QSQzY3IzdAo=", Priority: 5, }, Telegram: TelegramConfig{ Enabled: false, B64BotToken: "dGhpc2lzbm90YWJvdHRva2VuCg==", ChatId: "000000000", }, }, Radarr: RadarrConfig{ Enabled: false, URL: "http://radarr:7878", B64APIKey: "dGhpc2lzbm90YW5hcGlrZXkK", Notification: false, }, Sonarr: SonarrConfig{ Enabled: false, URL: "http://sonarr:8989", B64APIKey: "dGhpc2lzbm90YW5hcGlrZXkK", Notification: false, }, }
Default configurations
func ReadConfig ¶
func ReadConfig(configFile string) (*Configuration, error)
type GotifyConfig ¶
type Movie ¶
type Movie struct { Title string `json:"title"` HasFile bool `json:"hasFile"` Tags []int `json:"tags"` ID int `json:"id"` MovieFile MovieFileDetail `json:"movieFile"` }
type MovieFileDetail ¶
type MovieImportEvent ¶
func GetMovieImportEvents ¶
func GetMovieImportEvents(movieId int) ([]MovieImportEvent, error)
type NotificationChannel ¶
type NotificationChannel struct { SMTP SMTPConfig Gotify GotifyConfig Telegram TelegramConfig }
type RadarrConfig ¶
type SMTPConfig ¶
type SMTPConfig struct { Enabled bool `yaml:"enabled"` Server string `yaml:"server"` Port int `yaml:"port"` Security Security `yaml:"security"` Username string `yaml:"username"` B64Password string `yaml:"b64Password"` FromEmail string `yaml:"fromEmail"` ToEmail []string `yaml:"toEmail"` CcEmail []string `yaml:"ccEmail"` BccEmail []string `yaml:"bccEmail"` }
type SonarrConfig ¶
type Status ¶
type Status struct { LastMaintenanceDate string `yaml:"lastMaintenanceDate"` NextMaintenanceDate string `yaml:"nextMaintenanceDate"` DeletedMovies []string `yaml:"deletedMovies"` DeletedShows []string `yaml:"deletedShows"` IgnoredMovies []string `yaml:"ignoredMovies"` IgnoredShows []string `yaml:"ignoredShows"` MoviesMarkedForDeletion []string `yaml:"moviesMarkedForDeletion"` ShowsMarkedForDeletion []string `yaml:"showsMarkedForDeletion"` }
var State Status
func ReadStatus ¶
type TelegramConfig ¶
Click to show internal directories.
Click to hide internal directories.