plexcron

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const TrigPlexSessions common.TriggerName = "Gathering and sending Plex Sessions."

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// contains filtered or unexported fields
}

Action contains the exported methods for this package.

func New

func New(config *common.Config, plex *plex.Server) *Action

New configures the library.

func (*Action) GetSessions

func (a *Action) GetSessions(wait bool) (*plex.Sessions, error)

GetSessions returns the plex sessions. This uses a channel so concurrent requests are avoided. Passing wait=true makes sure the results are current. Waits up to 10 seconds before requesting. Passing wait=false will allow for sessions up to 10 seconds old. This may return faster.

func (*Action) Run

func (a *Action) Run()

Run initializes the library.

func (*Action) Send

func (a *Action) Send(event website.EventType)

SendPlexSessions sends plex sessions in a go routine through a channel.

func (*Action) SendWebhook

func (a *Action) SendWebhook(hook *plex.IncomingWebhook)

SendWebhook is called in a go routine after a plex media.play webhook is received.

func (*Action) Stop

func (a *Action) Stop()

Stop the Plex session holder.

Jump to

Keyboard shortcuts

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