content

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModeMetadata = "BrowseMetadata"
	ModeChildren = "BrowseDirectChildren"
)

values of the BrowseFlag attribute of the ContentDirectory service

View Source
const (
	MusicFolder   = "/music/"
	PictureFolder = "/pictures/"
)

root folder for music and picture requests note: they must end with a slash!

Variables

This section is empty.

Functions

This section is empty.

Types

type Content

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

Content contains the different muserv content objects, such as tracks, albums, hierarchies and methods to management them

func New

func New(cfg *config.Cfg) (cnt *Content, err error)

New creats a new Content instance

func (*Content) Browse

func (me *Content) Browse(id ObjID, mode string, start, wanted uint32) (result string, returned, total uint32, err error)

Browse implements the Browse SOAP action of the ContentDirectory service

func (*Content) ContainerUpdateIDs

func (me *Content) ContainerUpdateIDs() (updates string)

ContainerUpdateIDs assembles the new value for the state variable ContainerUpdateIDs

func (*Content) Errors

func (me *Content) Errors() <-chan error

Errors returns a receive-only channel for errors from the regular update

func (*Content) InitialUpdate

func (me *Content) InitialUpdate(ctx context.Context) (err error)

InitialUpdate executes a one-time content update after muserv has been started

func (*Content) Picture

func (me *Content) Picture(id uint64) *[]byte

Picture returns the picture with the given ID. If it doesn't exist, nil is returned

func (*Content) ResetCtrUpdCounts

func (me *Content) ResetCtrUpdCounts()

ResetCtrUpdCounts resets the ContainerUpdateIDValues for all container objects

func (*Content) Run

func (me *Content) Run(ctx context.Context, wg *sync.WaitGroup)

Run starts the regular content updates

func (*Content) UpdateNotification

func (me *Content) UpdateNotification() <-chan UpdateNotification

UpdateNotification returns a receive-only channel to notify about updates

func (*Content) WriteStatus

func (me *Content) WriteStatus(w io.Writer)

WriteStatus writes the content status to w

type ObjID

type ObjID int64

ObjID is the unique identified of an object

func ObjIDFromString

func ObjIDFromString(s string) (ObjID, error)

ObjIDFromString create an object ID from a string

type UpdateNotification

type UpdateNotification struct {
	// Update triggers update
	Update func()
	// Updated provides the info update was done and how many objects were
	// changed, deleted or added
	Updated chan uint32
}

UpdateNotification is used to inform the caller about updates. It contains a function to execute the update and a channel to inform the caller that the update was done

Jump to

Keyboard shortcuts

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