nixplay

package
v0.0.0-...-a508f9c Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Album

type Album struct {
	AlbumType  string `json:"album_type"` // "Web"?
	PhotoCount int    `json:"photo_count"`
	// PendingAlbumId
	AllowReorder        bool     `json:"allow_reorder"`
	Title               string   `json:"title"`
	IsUpdated           bool     `json:"is_updated"`
	CoverUrls           []string `json:"cover_urls"`  // []string?
	DateCreated         string   `json:"dateCreated"` // 31/Jul/2018
	AllowUpload         bool     `json:"allow_upload"`
	AllowDelete         bool     `json:"allow_delete"`
	Thumbs              []Img    `json:"thumbs"`
	Published           bool     `json:"published"`
	ID                  int      `json:"id"`
	AllowDeletePictures bool     `json:"allow_delete_pictures"`
	PictureStorageType  string   `json:"picture_storage_type"`
	Email               string   `json:"email"` // Empty if owned by you?
}

Album is a set of Imgs; Albums can be added to Playlists

func (Album) String

func (a Album) String() string

type Client

type Client interface {
	GetAlbums() ([]*Album, error)
	GetAlbumsByName(albumName string) ([]*Album, error)
	CreateAlbum(albumName string) (*Album, error)
	DeleteAlbumsByName(albumName string, allowMultiple bool) (int, error)
	DeleteAlbumByID(albumID int) error
	GetPhotos(albumID int, page int, limit int) ([]*Photo, error)
	UploadPhoto(albumID int, filename string, filetype string, filesize uint64, body io.ReadCloser) error
	DeletePhoto(id int) error
	CreatePlaylist(name string) (int, error)
	GetPlaylists() ([]*Playlist, error)
	GetPlaylistByName(name string) (*Playlist, error)
	PublishPlaylist(playlistId int, photos []*Photo) error
}

func NewClient

func NewClient(username, password string, reg prometheus.Registerer) (Client, error)

NewClient logs in to Nixplay and returns a Client for future requests

type Img

type Img struct {
	Src         string `json:"src"` // URL in cloudfront
	Rotation    int    `json:"rotation"`
	Orientation int    `json:"orientation"` // 1 means portrait?  Not rotated?
}

Img is a reference to an image

type Photo

type Photo struct {
	OriginalURL     string `json:"original_url"`
	Orientation     int    `json:"orientation"`
	Caption         string `json:"caption"`
	URL             string `json:"url"`
	RotationAllowed bool   `json:"rotation_allowed"`
	Filename        string `json:"filename"` // Looks like the user's filename when uploaded
	SortDate        string `json:"sortDate"` // 20180731232531
	AlbumID         int    `json:"albumId"`
	S3Filename      string `json:"s3filename"`
	PreviewURL      string `json:"previewUrl"`
	Published       bool   `json:"published"`
	SourceID        string `json:"source_id"` // Literally "unused" for my examples
	Rotation        int    `json:"rotation"`
	ThumbnailURL    string `json:"thumbnailUrl"`
	ID              int    `json:"id"`
	Md5             string `json:"md5"`
}

Photo is a reference to a photo in an album

func (Photo) String

func (p Photo) String() string

type Playlist

type Playlist struct {
	Id              int    `json:"id"`
	Name            string `json:"name"`
	PlaylistName    string `json:"playlist_name"`
	CoverUrls       string `json:"cover_urls"` // of a JSON, weird.
	CreatedDate     string `json:"created_date"`
	ConfigFile      string `json:"config_file"`
	Converted       bool   `json:"converted"`
	Duration        int    `json:"duration"` // often -1?
	LastUpdatedDate string `json:"last_updated_date"`
	PictureCount    int    `json:"picture_count"`
	Type            string `json:"type"`
	Version         int    `json:"version"`
}

Jump to

Keyboard shortcuts

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