jellyseerr

package module
v0.0.0-...-0ccc314 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	API_SUFFIX      = "/api/v1"
	BogusIdentifier = "123412341234123456"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorDTO

type ErrorDTO struct {
	Message string `json:"message,omitempty"`
}

type GetUsersDTO

type GetUsersDTO struct {
	Page    PageInfo `json:"pageInfo,omitempty"`
	Results []User   `json:"results,omitempty"`
}

type Jellyseerr

type Jellyseerr struct {
	LogRequestBodies bool
	AutoImportUsers  bool
	// contains filtered or unexported fields
}

Jellyseerr represents a running Jellyseerr instance.

func NewJellyseerr

func NewJellyseerr(server, key string, timeoutHandler co.TimeoutHandler) *Jellyseerr

NewJellyseerr returns an Ombi object.

func (*Jellyseerr) ApplyNotificationsTemplateToUser

func (js *Jellyseerr) ApplyNotificationsTemplateToUser(jfID string, tmpl NotificationsTemplate) error

func (*Jellyseerr) ApplyTemplateToUser

func (js *Jellyseerr) ApplyTemplateToUser(jfID string, tmpl UserTemplate) error

func (*Jellyseerr) DeleteUser

func (js *Jellyseerr) DeleteUser(jfID string) error

func (*Jellyseerr) GetExistingUser

func (js *Jellyseerr) GetExistingUser(jfID string) (u User, err error)

func (*Jellyseerr) GetNotificationPreferences

func (js *Jellyseerr) GetNotificationPreferences(jfID string) (Notifications, error)

func (*Jellyseerr) GetNotificationPreferencesByID

func (js *Jellyseerr) GetNotificationPreferencesByID(jellyseerrID int64) (Notifications, error)

func (*Jellyseerr) GetOrImportUser

func (js *Jellyseerr) GetOrImportUser(jfID string) (u User, imported bool, err error)

GetImportedUser provides the same function as ImportFromJellyfin, but will always return the user, even if they already existed. Also returns whether the user was imported or not,

func (*Jellyseerr) GetPermissions

func (js *Jellyseerr) GetPermissions(jfID string) (Permissions, error)

func (*Jellyseerr) GetUsers

func (js *Jellyseerr) GetUsers() (map[string]User, error)

func (*Jellyseerr) ImportFromJellyfin

func (js *Jellyseerr) ImportFromJellyfin(jfIDs ...string) ([]User, error)

func (*Jellyseerr) Me

func (js *Jellyseerr) Me() (User, error)

func (*Jellyseerr) ModifyMainUserSettings

func (js *Jellyseerr) ModifyMainUserSettings(jfID string, conf MainUserSettings) error

func (*Jellyseerr) ModifyNotifications

func (js *Jellyseerr) ModifyNotifications(jfID string, conf map[NotificationsField]any) error

func (*Jellyseerr) ModifyUser

func (js *Jellyseerr) ModifyUser(jfID string, conf map[UserField]any) error

func (*Jellyseerr) MustGetUser

func (js *Jellyseerr) MustGetUser(jfID string) (User, error)

func (*Jellyseerr) SetPermissions

func (js *Jellyseerr) SetPermissions(jfID string, perm Permissions) error

func (*Jellyseerr) SetTransport

func (js *Jellyseerr) SetTransport(t *http.Transport)

SetTransport sets the http.Transport to use for requests. Can be used to set a proxy.

func (*Jellyseerr) UserByID

func (js *Jellyseerr) UserByID(jellyseerrID int64) (User, error)

type MainUserSettings

type MainUserSettings struct {
	Username            string `json:"username,omitempty"`
	Email               string `json:"email,omitempty"`
	DiscordID           string `json:"discordId,omitempty"`
	Locale              string `json:"locale,omitempty"`
	Region              string `json:"region,omitempty"`
	OriginalLanguage    any    `json:"originalLanguage,omitempty"`
	MovieQuotaLimit     any    `json:"movieQuotaLimit,omitempty"`
	MovieQuotaDays      any    `json:"movieQuotaDays,omitempty"`
	TvQuotaLimit        any    `json:"tvQuotaLimit,omitempty"`
	TvQuotaDays         any    `json:"tvQuotaDays,omitempty"`
	WatchlistSyncMovies any    `json:"watchlistSyncMovies,omitempty"`
	WatchlistSyncTv     any    `json:"watchlistSyncTv,omitempty"`
}

type NotificationTypes

type NotificationTypes struct {
	Discord    int64 `json:"discord"`
	Email      int64 `json:"email"`
	Pushbullet int64 `json:"pushbullet"`
	Pushover   int64 `json:"pushover"`
	Slack      int64 `json:"slack"`
	Telegram   int64 `json:"telegram"`
	Webhook    int64 `json:"webhook"`
	Webpush    int64 `json:"webpush"`
}

type Notifications

type Notifications struct {
	NotificationsTemplate
	PgpKey                   any    `json:"pgpKey,omitempty"`
	DiscordID                string `json:"discordId,omitempty"`
	PushbulletAccessToken    any    `json:"pushbulletAccessToken,omitempty"`
	PushoverApplicationToken any    `json:"pushoverApplicationToken,omitempty"`
	PushoverUserKey          any    `json:"pushoverUserKey,omitempty"`
	TelegramChatID           string `json:"telegramChatId,omitempty"`
}

type NotificationsField

type NotificationsField string
const (
	FieldDiscord         NotificationsField = "discordId"
	FieldTelegram        NotificationsField = "telegramChatId"
	FieldEmailEnabled    NotificationsField = "emailEnabled"
	FieldDiscordEnabled  NotificationsField = "discordEnabled"
	FieldTelegramEnabled NotificationsField = "telegramEnabled"
)

type NotificationsTemplate

type NotificationsTemplate struct {
	EmailEnabled         bool              `json:"emailEnabled,omitempty"`
	DiscordEnabled       bool              `json:"discordEnabled,omitempty"`
	DiscordEnabledTypes  int64             `json:"discordEnabledTypes,omitempty"`
	PushoverSound        any               `json:"pushoverSound,omitempty"`
	TelegramEnabled      bool              `json:"telegramEnabled,omitempty"`
	TelegramSendSilently any               `json:"telegramSendSilently,omitempty"`
	WebPushEnabled       bool              `json:"webPushEnabled,omitempty"`
	NotifTypes           NotificationTypes `json:"notificationTypes"`
}

type PageInfo

type PageInfo struct {
	Pages    int `json:"pages,omitempty"`
	PageSize int `json:"pageSize,omitempty"`
	Results  int `json:"results,omitempty"`
	Page     int `json:"page,omitempty"`
}

type Permissions

type Permissions int

type User

type User struct {
	UserTemplate                         // Note: You can set this with User.UserTemplate = value.
	UserType                   int64     `json:"userType,omitempty"`
	Warnings                   []any     `json:"warnings,omitempty"`
	ID                         int64     `json:"id,omitempty"`
	Email                      string    `json:"email,omitempty"`
	PlexUsername               string    `json:"plexUsername,omitempty"`
	JellyfinUsername           string    `json:"jellyfinUsername,omitempty"`
	Username                   string    `json:"username,omitempty"`
	RecoveryLinkExpirationDate any       `json:"recoveryLinkExpirationDate,omitempty"`
	PlexID                     string    `json:"plexId,omitempty"`
	JellyfinUserID             string    `json:"jellyfinUserId,omitempty"`
	JellyfinDeviceID           string    `json:"jellyfinDeviceId,omitempty"`
	JellyfinAuthToken          string    `json:"jellyfinAuthToken,omitempty"`
	PlexToken                  string    `json:"plexToken,omitempty"`
	Avatar                     string    `json:"avatar,omitempty"`
	CreatedAt                  time.Time `json:"createdAt,omitempty"`
	UpdatedAt                  time.Time `json:"updatedAt,omitempty"`
	RequestCount               int64     `json:"requestCount,omitempty"`
	DisplayName                string    `json:"displayName,omitempty"`
}

func (User) Name

func (u User) Name() string

type UserField

type UserField string
const (
	FieldDisplayName UserField = "displayName"
	FieldEmail       UserField = "email"
)

type UserTemplate

type UserTemplate struct {
	Permissions     Permissions `json:"permissions,omitempty"`
	MovieQuotaLimit any         `json:"movieQuotaLimit,omitempty"`
	MovieQuotaDays  any         `json:"movieQuotaDays,omitempty"`
	TvQuotaLimit    any         `json:"tvQuotaLimit,omitempty"`
	TvQuotaDays     any         `json:"tvQuotaDays,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL