api

package
v0.0.0-...-aeae457 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

API -

func NewAPI

func NewAPI() *API

NewAPI -

func (*API) DeleteTracksPlaylist

func (cc *API) DeleteTracksPlaylist(key string, tracks int, callback func(error))

DeleteTracksPlaylist -

func (*API) GetAudioPlaylist

func (cc *API) GetAudioPlaylist(key string, callback func(LibraryContents, error))

GetAudioPlaylist gets all videos in a playlist.

func (*API) GetLibraries

func (cc *API) GetLibraries(callback func(Library, error))

GetLibraries -

func (*API) GetLibraryContent

func (cc *API) GetLibraryContent(option LibraryContentOptions, callback func(LibraryContents, error))

GetLibraryContent -

func (*API) GetLibraryContentChildren

func (cc *API) GetLibraryContentChildren(key string, callback func(LibraryContents, error))

GetLibraryContentChildren -

func (*API) InsertTracksPlaylist

func (cc *API) InsertTracksPlaylist(key, hash string, tracks []string, callback func(error))

InsertTracksPlaylist -

func (*API) NewPlaylist

func (cc *API) NewPlaylist(key, ptype, hash string, tracks []string, callback func(error))

NewPlaylist -

func (*API) RemovePlaylist

func (cc *API) RemovePlaylist(key string, callback func(error))

func (*API) SetServerAddress

func (cc *API) SetServerAddress(url string)

SetServerAddress -

func (*API) TestServer

func (cc *API) TestServer(callback func(Servers, error))

TestServer -

func (*API) TranscodeImages

func (cc *API) TranscodeImages(key, output string, w, h int, format string, c context.Context, cf context.CancelFunc, callback func(string, error))

TranscodeImages -

func (*API) TranscodeImagesURL

func (cc *API) TranscodeImagesURL(key string, w, h int, format string) string

type Library

type Library struct {
	MediaContainer struct {
		Size            int    `json:"size"`
		AllowSync       bool   `json:"allowSync"`
		Identifier      string `json:"identifier"`
		MediaTagPrefix  string `json:"mediaTagPrefix"`
		MediaTagVersion int64  `json:"mediaTagVersion"`
		Title1          string `json:"title1"`
		Directory       []struct {
			AllowSync        bool   `json:"allowSync"`
			Art              string `json:"art"`
			Composite        string `json:"composite"`
			Filters          bool   `json:"filters"`
			Refreshing       bool   `json:"refreshing"`
			Thumb            string `json:"thumb"`
			Key              string `json:"key"`
			Type             string `json:"type"`
			Title            string `json:"title"`
			Agent            string `json:"agent"`
			Scanner          string `json:"scanner"`
			Language         string `json:"language"`
			UUID             string `json:"uuid"`
			UpdatedAt        int64  `json:"updatedAt"`
			CreatedAt        int64  `json:"createdAt"`
			ScannedAt        int64  `json:"scannedAt"`
			Content          bool   `json:"content"`
			Directory        bool   `json:"directory"`
			ContentChangedAt int64  `json:"contentChangedAt"`
			Hidden           int    `json:"hidden"`
			Location         []struct {
				ID   int    `json:"id"`
				Path string `json:"path"`
			} `json:"Location"`
		} `json:"Directory"`
	} `json:"MediaContainer"`
}

Library -

type LibraryContentOptions

type LibraryContentOptions struct {
	Key                string
	Type               LibraryFilterType
	Start              int
	Limit              int
	IncludeCollections int
	IncludeAdvanced    int
	IncludeMeta        int
}

LibraryContentOptions -

type LibraryContents

type LibraryContents struct {
	MediaContainer struct {
		Size                 int    `json:"size"`
		TotalSize            int    `json:"totalSize"`
		AllowSync            bool   `json:"allowSync"`
		Art                  string `json:"art"`
		GrandparentRatingKey int    `json:"grandparentRatingKey"`
		GrandparentThumb     string `json:"grandparentThumb"`
		GrandparentTitle     string `json:"grandparentTitle"`
		Identifier           string `json:"identifier"`
		Key                  string `json:"key"`
		LibrarySectionID     int    `json:"librarySectionID"`
		LibrarySectionTitle  string `json:"librarySectionTitle"`
		LibrarySectionUUID   string `json:"librarySectionUUID"`
		MediaTagPrefix       string `json:"mediaTagPrefix"`
		MediaTagVersion      int64  `json:"mediaTagVersion"`
		Nocache              bool   `json:"nocache"`
		ParentIndex          int    `json:"parentIndex"`
		ParentTitle          string `json:"parentTitle"`
		ParentYear           int    `json:"parentYear"`
		Summary              string `json:"summary"`
		Offset               int    `json:"offset"`
		Thumb                string `json:"thumb"`
		Title1               string `json:"title1"`
		Title2               string `json:"title2"`
		ViewGroup            string `json:"viewGroup"`
		ViewMode             int    `json:"viewMode"`
		Metadata             []struct {
			RatingKey            string `json:"ratingKey"`
			Key                  string `json:"key"`
			ParentRatingKey      string `json:"parentRatingKey"`
			GrandparentRatingKey string `json:"grandparentRatingKey"`
			GUID                 string `json:"guid"`
			ParentGUID           string `json:"parentGuid"`
			GrandparentGUID      string `json:"grandparentGuid"`
			Type                 string `json:"type"`
			Title                string `json:"title"`
			GrandparentKey       string `json:"grandparentKey"`
			ParentKey            string `json:"parentKey"`
			GrandparentTitle     string `json:"grandparentTitle"`
			ParentTitle          string `json:"parentTitle"`
			OriginalTitle        string `json:"originalTitle"`
			Summary              string `json:"summary"`
			Index                int    `json:"index"`
			ParentIndex          int    `json:"parentIndex"`
			RatingCount          int    `json:"ratingCount"`
			ParentYear           int    `json:"parentYear"`
			Thumb                string `json:"thumb"`
			Art                  string `json:"art"`
			ParentThumb          string `json:"parentThumb"`
			GrandparentThumb     string `json:"grandparentThumb"`
			GrandparentArt       string `json:"grandparentArt"`
			Duration             int64  `json:"duration"`
			AddedAt              int64  `json:"addedAt"`
			UpdatedAt            int64  `json:"updatedAt"`
			//for playlist
			Smart          bool   `json:"smart"`
			PlaylistType   string `json:"playlistType"`
			PlaylistItemID int    `json:"playlistItemID"`
			Media          []struct {
				ID            int    `json:"id"`
				Duration      int64  `json:"duration"`
				Bitrate       int    `json:"bitrate"`
				AudioChannels int    `json:"audioChannels"`
				AudioCodec    string `json:"audioCodec"`
				Container     string `json:"container"`
				Part          []struct {
					ID           int    `json:"id"`
					Key          string `json:"key"`
					Duration     int64  `json:"duration"`
					File         string `json:"file"`
					Size         int64  `json:"size"`
					Container    string `json:"container"`
					HasThumbnail string `json:"hasThumbnail"`
				} `json:"Part"`
			} `json:"Media"`
		} `json:"Metadata"`
	} `json:"MediaContainer"`
}

LibraryContents -

type LibraryFilterType

type LibraryFilterType int

LibraryFilterType -

const (
	//LibraryFilterTypeAlbum -
	LibraryFilterTypeAlbum LibraryFilterType = 9
	//LibraryFilterTypeArtist -
	LibraryFilterTypeArtist LibraryFilterType = 8
	//LibraryFilterTypeTracks -
	LibraryFilterTypeTracks LibraryFilterType = 10
)

type Server

type Server struct {
	Name              string `json:"name"`
	Host              string `json:"host"`
	Address           string `json:"address"`
	Port              int    `json:"port"`
	MachineIdentifier string `json:"machineIdentifier"`
	Version           string `json:"version"`
}

Server -

type Servers

type Servers struct {
	MediaContainer struct {
		Size   int      `json:"size"`
		Server []Server `json:"Server"`
	} `json:"MediaContainer"`
}

Servers -

Jump to

Keyboard shortcuts

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