jfapi

package module
v0.0.0-...-4aae655 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Jellyfin

type Jellyfin struct {
	Server string

	ServerInfo serverInfo
	Username   string

	Authenticated bool
	AccessToken   string

	CacheExpiry time.Time

	Hyphens bool
	// contains filtered or unexported fields
}

Jellyfin represents a running Jellyfin instance.

func NewJellyfin

func NewJellyfin(server, client, version, device, deviceID string, timeoutHandler common.TimeoutHandler, cacheTimeout int) (*Jellyfin, error)

NewJellyfin returns a new Jellyfin object.

func (*Jellyfin) Authenticate

func (jf *Jellyfin) Authenticate(username, password string) (map[string]interface{}, int, error)

Authenticate attempts to authenticate using a username & password

func (*Jellyfin) DeleteUser

func (jf *Jellyfin) DeleteUser(userID string) (int, error)

DeleteUser deletes the user corresponding to the provided ID.

func (*Jellyfin) GetDisplayPreferences

func (jf *Jellyfin) GetDisplayPreferences(userID string) (map[string]interface{}, int, error)

GetDisplayPreferences gets the displayPreferences (part of homescreen layout) for the user corresponding to the provided ID.

func (*Jellyfin) GetUsers

func (jf *Jellyfin) GetUsers(public bool) ([]map[string]interface{}, int, error)

GetUsers returns all (visible) users on the Jellyfin instance.

func (*Jellyfin) NewUser

func (jf *Jellyfin) NewUser(username, password string) (map[string]interface{}, int, error)

NewUser creates a new user with the provided username and password.

func (*Jellyfin) SetConfiguration

func (jf *Jellyfin) SetConfiguration(userID string, configuration map[string]interface{}) (int, error)

SetConfiguration sets the configuration (part of homescreen layout) for the user corresponding to the provided ID.

func (*Jellyfin) SetDisplayPreferences

func (jf *Jellyfin) SetDisplayPreferences(userID string, displayprefs map[string]interface{}) (int, error)

SetDisplayPreferences sets the displayPreferences (part of homescreen layout) for the user corresponding to the provided ID.

func (*Jellyfin) SetPolicy

func (jf *Jellyfin) SetPolicy(userID string, policy map[string]interface{}) (int, error)

SetPolicy sets the access policy for the user corresponding to the provided ID.

func (*Jellyfin) UserByID

func (jf *Jellyfin) UserByID(userID string, public bool) (map[string]interface{}, int, error)

UserByID returns the user corresponding to the provided ID.

func (*Jellyfin) UserByName

func (jf *Jellyfin) UserByName(username string, public bool) (map[string]interface{}, int, error)

UserByName returns the user corresponding to the provided username.

Jump to

Keyboard shortcuts

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