media

package
v0.0.0-...-8a04328 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2018 License: GPL-3.0, GPL-3.0-only Imports: 10 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 {
	MediaObject
	Name     string `json:"name"`
	ArtistID string `gorm:"size:64" json:"-"`
	Artist   Artist `json:"-"`
}
func (a *Album) GetApiLink() string

func (*Album) GetSongs

func (a *Album) GetSongs() []Song
func (a *Album) GetUiLink() string

func (Album) MarshalJSON

func (a Album) MarshalJSON() ([]byte, error)

type Artist

type Artist struct {
	MediaObject
	Name   string  `json:"name"`
	Albums []Album `json:"-"`
}
func (a *Artist) GetApiLink() string
func (a *Artist) GetUiLink() string

func (Artist) MarshalJSON

func (a Artist) MarshalJSON() ([]byte, error)

type JsonAlbum

type JsonAlbum Album

type JsonArtist

type JsonArtist Artist

type JsonPlaylist

type JsonPlaylist Playlist

type JsonSong

type JsonSong Song

type MediaObject

type MediaObject struct {
	special.UserBelongingObject
	Covername string `gorm:"size:128" json:"-"`
}
func (m *MediaObject) GetCoverLink() string

GetCoverLink returns the link for the cover art

func (m *MediaObject) GetUiLink() string

GetUiLink returns the link for the specific media objects ui

type Playlist

type Playlist struct {
	MediaObject
	Name  string `json:"name"`
	Songs []Song `gorm:"many2many:playlist_songs;" json:"-"`
}

func (*Playlist) AddSong

func (p *Playlist) AddSong(song Song) bool

AddSong adds the given song to the playlist. Returns true, if song could be added, false if the song was already inside of the playlist

func (*Playlist) ContainsSong

func (p *Playlist) ContainsSong(song Song) bool

ContainsSong checks if the playlist contains the given song

func (p *Playlist) GetApiLink() string
func (p *Playlist) GetUiLink() string

func (Playlist) MarshalJSON

func (p Playlist) MarshalJSON() ([]byte, error)

type Song

type Song struct {
	MediaObject
	Artists   []Artist   `gorm:"many2many:song_artists;" json:"-"`
	Title     string     `json:"title"`
	Track     int        `json:"track"`
	Size      int64      `json:"size"`
	Duration  float64    `json:"duration"`
	Filename  string     `gorm:"size:40" json:"-"`
	AlbumID   string     `gorm:"size:64" json:"-"`
	Album     Album      `json:"-"`
	Type      string     `json:"type"`
	Playlists []Playlist `gorm:"many2many:playlist_songs;" json:"-"`
}

func (*Song) Create

func (s *Song) Create()
func (s *Song) GetApiLink() string

func (*Song) GetUploadFilePath

func (s *Song) GetUploadFilePath() (string, error)

func (Song) MarshalJSON

func (s Song) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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