model

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityArtist

type ActivityArtist struct {
	Artist Artist
	Count  int
}

type ActivityCount

type ActivityCount struct {
	Date  time.Time
	Count int
}

type ActivityEpisode

type ActivityEpisode struct {
	Episode Episode
	Count   int
}

type ActivityMovie

type ActivityMovie struct {
	Movie Movie
	Count int
}

type ActivityRelease

type ActivityRelease struct {
	Release Release
	Count   int
}

type ActivityTrack

type ActivityTrack struct {
	Track Track
	Count int
}

type Artist

type Artist struct {
	gorm.Model
	Name           string `gorm:"uniqueIndex:idx_artist_name"`
	SortName       string
	ARID           string `gorm:"uniqueIndex:idx_artist_arid"`
	Disambiguation string
	Country        string
	Area           string
	Date           time.Time
	EndDate        time.Time
	Genre          string
}

Artist info from MusicBrainz.

type ArtistBackground

type ArtistBackground struct {
	gorm.Model
	Artist string `gorm:"uniqueIndex:idx_artist_bg"`
	URL    string `gorm:"uniqueIndex:idx_artist_bg"`
	Source string `gorm:"uniqueIndex:idx_artist_bg"`
	Rank   int
}

type ArtistImage

type ArtistImage struct {
	gorm.Model
	Artist string `gorm:"uniqueIndex:idx_artist_img"`
	URL    string `gorm:"uniqueIndex:idx_artist_img"`
	Source string `gorm:"uniqueIndex:idx_artist_img"`
	Rank   int
}

type ArtistTag

type ArtistTag struct {
	gorm.Model
	Artist string `gorm:"uniqueIndex:idx_tag"`
	Tag    string `gorm:"uniqueIndex:idx_tag"`
	Count  int
}

Artist tags from MusicBrainz.

type Billing

type Billing struct {
	Actors    []Person
	Directors []Person
	Producers []Person
	Writers   []Person
}

type Cast

type Cast struct {
	gorm.Model
	TMID      int64 `gorm:"index:idx_cast_tmid"`
	PEID      int64 `gorm:"index:idx_cast_peid"`
	Character string
	Rank      int
	Person    Person `gorm:"-"`
}

func (Cast) GetPerson

func (c Cast) GetPerson() Person

func (Cast) HasJob

func (c Cast) HasJob(name string) bool

func (Cast) TableName

func (Cast) TableName() string

type Collection

type Collection struct {
	gorm.Model
	Name     string
	SortName string
	TMID     int64
}

type CoverArt

type CoverArt interface {
	HasArtwork() bool
	HasFrontArtwork() bool
	HasBackArtwork() bool
	HasOtherArtwork() bool
	HasGroupArtwork() bool
	ArtworkMBIDs() (string, string)
}

type Crew

type Crew struct {
	gorm.Model
	TMID       int64 `gorm:"index:idx_crew_tmid"`
	PEID       int64 `gorm:"index:idx_crew_peid"`
	Department string
	Job        string
	Person     Person `gorm:"-"`
}

func (Crew) GetPerson

func (c Crew) GetPerson() Person

func (Crew) HasJob

func (c Crew) HasJob(name string) bool

func (Crew) TableName

func (Crew) TableName() string

type Episode

type Episode struct {
	gorm.Model
	SID         string // series ID
	EID         string `gorm:"uniqueIndex:idx_episode"` // GUID
	Title       string
	Author      string
	Link        string
	Description string
	ContentType string
	Size        int64
	URL         string
	Date        time.Time // publish time
	Image       string
}

type EpisodeEvent

type EpisodeEvent struct {
	gorm.Model
	User string    `gorm:"index:idx_episode_user" json:"-"`
	Date time.Time `gorm:"uniqueIndex:idx_episode_date"`
	EID  string
}

func (*EpisodeEvent) IsValid

func (e *EpisodeEvent) IsValid() bool

type Events

type Events struct {
	MovieEvents   []MovieEvent
	EpisodeEvents []EpisodeEvent
	TrackEvents   []TrackEvent
}

type Genre

type Genre struct {
	gorm.Model
	TMID int64
	Name string
}

type Keyword

type Keyword struct {
	gorm.Model
	TMID int64 `gorm:"index:idx_keyword_tmid"`
	Name string
}

type Media

type Media struct {
	gorm.Model
	REID       string `gorm:"uniqueIndex:idx_media"`
	Name       string `gorm:"uniqueIndex:idx_media"`
	Position   int    `gorm:"uniqueIndex:idx_media"`
	Format     string
	TrackCount int
}

Release Media from MusicBrainz.

type Movie

type Movie struct {
	gorm.Model
	UUID             string `gorm:"index:idx_movie_uuid" json:"-"`
	TMID             int64  `gorm:"uniqueIndex:idx_movie_tmid"`
	IMID             string
	Title            string
	Date             time.Time
	Rating           string
	Tagline          string
	OriginalTitle    string
	OriginalLanguage string
	Overview         string
	Budget           int64
	Revenue          int64
	Runtime          int
	VoteAverage      float32
	VoteCount        int
	BackdropPath     string
	PosterPath       string
	SortTitle        string
	Key              string
	Size             int64
	ETag             string
	LastModified     time.Time
}

func (*Movie) BeforeCreate

func (m *Movie) BeforeCreate(tx *g.DB) (err error)

type MovieEvent

type MovieEvent struct {
	gorm.Model
	User string    `gorm:"index:idx_movie_user" json:"-"`
	Date time.Time `gorm:"uniqueIndex:idx_movie_date"`
	TMID string
	IMID string
	ETag string `gorm:"-"`
}

func (*MovieEvent) IsValid

func (m *MovieEvent) IsValid() bool

type Offset

type Offset struct {
	gorm.Model
	User     string    `gorm:"index:idx_offset_user" json:"-"`
	ETag     string    `gorm:"uniqueIndex:idx_offset_etag;uniqueIndex:idx_offset_date"`
	Offset   int       `gorm:"default:0"`
	Duration int       `gorm:"default:0"`
	Date     time.Time `gorm:"uniqueIndex:idx_offset_date"`
}

func (Offset) Valid

func (o Offset) Valid() bool

type Offsets

type Offsets struct {
	Offsets []Offset
}

type Person

type Person struct {
	gorm.Model
	PEID        int64 `gorm:"uniqueIndex:idx_person_peid"`
	IMID        string
	Name        string
	ProfilePath string
	Bio         string
	Birthplace  string
	Birthday    time.Time
	Deathday    time.Time
}

func (Person) TableName

func (Person) TableName() string

type Playlist

type Playlist struct {
	gorm.Model
	User       string `gorm:"uniqueIndex:idx_playlist"`
	Name       string `gorm:"uniqueIndex:idx_playlist"`
	Playlist   []byte
	TrackCount int
}
type Popular struct {
	gorm.Model
	Artist string `gorm:"uniqueIndex:idx_popular"`
	Title  string `gorm:"uniqueIndex:idx_popular"`
	Rank   int
}

Popular tracks for an artist from Last.fm.

func (Popular) TableName

func (Popular) TableName() string

type Recommend

type Recommend struct {
	Name   string
	Movies []Movie
}

type Release

type Release struct {
	gorm.Model
	Artist         string `gorm:"uniqueIndex:idx_release;index:idx_release_artist"`
	Name           string `gorm:"uniqueIndex:idx_release;index:idx_release_name" sql:"collate:nocase"`
	RGID           string `gorm:"index:idx_release_rgid"`
	REID           string `gorm:"uniqueIndex:idx_release;index:idx_release_reid"`
	Disambiguation string
	Asin           string
	Country        string
	Type           string `gorm:"index:idx_release_type"`
	SecondaryType  string
	Date           time.Time `gorm:"index:idx_release_rgdate"` // rg first release
	ReleaseDate    time.Time `gorm:"index:idx_release_redate"` // re release date
	Status         string
	TrackCount     int
	DiscCount      int
	Artwork        bool
	FrontArtwork   bool
	BackArtwork    bool
	OtherArtwork   string
	GroupArtwork   bool
	Media          []Media `gorm:"-"`
	SingleName     string  `gorm:"index:idx_release_single_name"`
	GroupName      string  `gorm:"index:idx_release_group_name"`
}

Release info from MusicBrainz.

func (Release) ArtworkMBIDs

func (r Release) ArtworkMBIDs() (string, string)

func (Release) HasArtwork

func (r Release) HasArtwork() bool

func (Release) HasBackArtwork

func (r Release) HasBackArtwork() bool

func (Release) HasFrontArtwork

func (r Release) HasFrontArtwork() bool

func (Release) HasGroupArtwork

func (r Release) HasGroupArtwork() bool

func (Release) HasOtherArtwork

func (r Release) HasOtherArtwork() bool

func (Release) Official

func (r Release) Official() bool

type Role

type Role interface {
	GetPerson() Person
	HasJob(string) bool
}

type Scrobble

type Scrobble struct {
	Artist      string    `json:""` // Required
	Track       string    `json:""` // Required
	Timestamp   time.Time `json:""` // Required
	Album       string    `json:""` // Optional
	AlbumArtist string    `json:""` // Optional
	TrackNumber int       `json:""` // Optional
	Duration    int       `json:""` // Optional - Length of track in seconds
	MBID        string    `json:""` // Optional - recording (or track?) MBID
}

Scrobble is a track listening event.

Spec location: https://www.last.fm/api/show/track.scrobble not using: context, streamId, chosenByUser

func (Scrobble) PreferredArtist

func (s Scrobble) PreferredArtist() string

type Series

type Series struct {
	gorm.Model
	SID         string `gorm:"uniqueIndex:idx_series"` // hash of link
	Title       string
	Description string
	Author      string
	Link        string
	Image       string
	Copyright   string
	Date        time.Time // last build date
	TTL         int
}

func (Series) TableName

func (Series) TableName() string

type Similar

type Similar struct {
	gorm.Model
	Artist string `gorm:"uniqueIndex:idx_similar"`
	ARID   string `gorm:"uniqueIndex:idx_similar"`
	Rank   int
}

Similar artist info from Last.fm

func (Similar) TableName

func (Similar) TableName() string

type Station

type Station struct {
	gorm.Model
	User        string `gorm:"uniqueIndex:idx_station" json:"-"`
	Name        string `gorm:"uniqueIndex:idx_station"`
	Creator     string
	Ref         string `json:"-"`
	Shared      bool   `json:"-"`
	Type        string
	Image       string
	Description string
	Playlist    []byte `json:"-"`
}

func (*Station) Visible

func (s *Station) Visible(user string) bool

type Subscription

type Subscription struct {
	gorm.Model
	SID  string `gorm:"primaryKey"`
	User string `gorm:"primaryKey"`
}

type TVEpisode

type TVEpisode struct {
	gorm.Model
	UUID         string `gorm:"index:idx_episode_uuid" json:"-"`
	TVID         int64  `gorm:"index:idx_episode_tvid"`
	Name         string
	Overview     string
	Date         time.Time
	StillPath    string
	Season       int `gorm:"index:idx_episode_season"`
	Episode      int `gorm:"index:idx_episode_episode"`
	VoteAverage  float32
	VoteCount    int
	Runtime      int
	Key          string
	Size         int64
	ETag         string
	LastModified time.Time
}

unique key is TVID, season, episode

func (*TVEpisode) BeforeCreate

func (e *TVEpisode) BeforeCreate(tx *g.DB) (err error)

func (TVEpisode) TableName

func (TVEpisode) TableName() string

type TVEpisodeCast

type TVEpisodeCast struct {
	gorm.Model
	EID       uint  `gorm:"index:idx_episode_cast_eid"`
	PEID      int64 `gorm:"index:idx_episode_cast_peid"`
	Character string
	Rank      int
	Person    Person `gorm:"-"`
}

func (TVEpisodeCast) GetPerson

func (c TVEpisodeCast) GetPerson() Person

func (TVEpisodeCast) HasJob

func (c TVEpisodeCast) HasJob(name string) bool

func (TVEpisodeCast) TableName

func (TVEpisodeCast) TableName() string

type TVEpisodeCrew

type TVEpisodeCrew struct {
	gorm.Model
	EID        uint  `gorm:"index:idx_episode_crew_eid"`
	PEID       int64 `gorm:"index:idx_episode_crew_peid"`
	Department string
	Job        string
	Person     Person `gorm:"-"`
}

func (TVEpisodeCrew) GetPerson

func (c TVEpisodeCrew) GetPerson() Person

func (TVEpisodeCrew) HasJob

func (c TVEpisodeCrew) HasJob(name string) bool

func (TVEpisodeCrew) TableName

func (TVEpisodeCrew) TableName() string

type TVGenre

type TVGenre struct {
	gorm.Model
	TVID int64 `gorm:"index:idx_genre_tvid"`
	Name string
}

func (TVGenre) TableName

func (TVGenre) TableName() string

type TVKeyword

type TVKeyword struct {
	gorm.Model
	TVID int64 `gorm:"index:idx_keyword_tvid"`
	Name string
}

func (TVKeyword) TableName

func (TVKeyword) TableName() string

type TVSeries

type TVSeries struct {
	gorm.Model
	TVID             int64 `gorm:"uniqueIndex:idx_series_tvid"`
	Name             string
	SortName         string
	Date             time.Time
	EndDate          time.Time
	Tagline          string
	OriginalName     string
	OriginalLanguage string
	Overview         string
	BackdropPath     string
	PosterPath       string
	SeasonCount      int
	EpisodeCount     int
	VoteAverage      float32
	VoteCount        int
	Rating           string
}

func (TVSeries) TableName

func (TVSeries) TableName() string

type TVSeriesCast

type TVSeriesCast struct {
	gorm.Model
	TVID      int64 `gorm:"index:idx_cast_tvid"`
	PEID      int64 `gorm:"index:idx_cast_peid"`
	Character string
	Rank      int
	Person    Person `gorm:"-"`
}

func (TVSeriesCast) GetPerson

func (c TVSeriesCast) GetPerson() Person

func (TVSeriesCast) HasJob

func (c TVSeriesCast) HasJob(name string) bool

func (TVSeriesCast) TableName

func (TVSeriesCast) TableName() string

type TVSeriesCrew

type TVSeriesCrew struct {
	gorm.Model
	TVID       int64 `gorm:"index:idx_crew_tvid"`
	PEID       int64 `gorm:"index:idx_crew_peid"`
	Department string
	Job        string
	Person     Person `gorm:"-"`
}

func (TVSeriesCrew) GetPerson

func (c TVSeriesCrew) GetPerson() Person

func (TVSeriesCrew) HasJob

func (c TVSeriesCrew) HasJob(name string) bool

func (TVSeriesCrew) TableName

func (TVSeriesCrew) TableName() string

type Track

type Track struct {
	gorm.Model
	UUID         string `gorm:"index:idx_track_uuid"`
	Artist       string `spiff:"creator" gorm:"index:idx_track_artist"`
	Release      string `gorm:"index:idx_track_release"`
	Date         string `gorm:"index:idx_track_date"`
	TrackNum     int    `spiff:"tracknum"`
	DiscNum      int
	Title        string `spiff:"title" gorm:"index:idx_track_title"`
	Key          string // TODO - unique constraint
	Size         int64
	ETag         string
	LastModified time.Time
	TrackCount   int
	DiscCount    int
	REID         string `gorm:"index:idx_track_reid"`
	RGID         string `gorm:"index:idx_track_rgid"`
	RID          string `gorm:"index:idx_track_rid"`  // recording id
	ARID         string `gorm:"index:idx_track_arid"` // TODO only for local right now
	MediaTitle   string
	ReleaseTitle string `spiff:"album"`
	TrackArtist  string // artist with featured artists
	ReleaseDate  time.Time
	Artwork      bool
	FrontArtwork bool
	BackArtwork  bool
	OtherArtwork string
	GroupArtwork bool
}

Tracks from S3 bucket object names. Naming is adjusted based on data from MusicBrainz.

func (Track) ArtworkMBIDs

func (t Track) ArtworkMBIDs() (string, string)

func (*Track) BeforeCreate

func (t *Track) BeforeCreate(tx *g.DB) (err error)

func (Track) HasArtwork

func (t Track) HasArtwork() bool

func (Track) HasBackArtwork

func (t Track) HasBackArtwork() bool

func (Track) HasFrontArtwork

func (t Track) HasFrontArtwork() bool

func (Track) HasGroupArtwork

func (t Track) HasGroupArtwork() bool

func (Track) HasOtherArtwork

func (t Track) HasOtherArtwork() bool

func (Track) PreferredArtist

func (t Track) PreferredArtist() string

Prefer A feat. B instead of just A.

type TrackEvent

type TrackEvent struct {
	gorm.Model
	User string    `gorm:"index:idx_track_user" json:"-"`
	Date time.Time `gorm:"uniqueIndex:idx_track_date"` // TODO dup index name w/ music
	RID  string
	RGID string
	ETag string `gorm:"-"`
}

func (*TrackEvent) IsValid

func (t *TrackEvent) IsValid() bool

type Trailer

type Trailer struct {
	gorm.Model
	TMID     int64
	Name     string
	Site     string
	Key      string
	Size     int
	Date     time.Time
	Official bool
	URL      string
}

Jump to

Keyboard shortcuts

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