repository

package
v1.7.3 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2023 License: MIT Imports: 2 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(db *gorm.DB) error

Types

type Audio

type Audio struct {
	Model
	Filename    string
	Language    string
	MediaFileID string    `gorm:"type:uuid;not null"`
	MediaFile   MediaFile `gorm:"reference:MediaFileID"`
}

type Category

type Category struct {
	Model
	Name   string   `gorm:"uniqueIndex"`
	Movies []Movie  `gorm:"many2many:category_movie;constraint:OnDelete:CASCADE;"`
	TvShow []TvShow `gorm:"many2many:category_tv_show;constraint:OnDelete:CASCADE;"`
}

type CategoryMovie added in v1.0.1

type CategoryMovie struct {
	MovieID    int      `gorm:"primaryKey"`
	Movie      Movie    `gorm:"reference:MovieID;constraint:OnDelete:CASCADE;"`
	CategoryID string   `gorm:"type:uuid;primaryKey"`
	Category   Category `gorm:"reference:CategoryID;constraint:OnDelete:CASCADE;"`
}

func (CategoryMovie) TableName added in v1.0.1

func (CategoryMovie) TableName() string

type CategoryTvShow added in v1.0.1

type CategoryTvShow struct {
	TvShowID   int      `gorm:"primaryKey"`
	TvShow     TvShow   `gorm:"reference:TvShowID;constraint:OnDelete:CASCADE;"`
	CategoryID string   `gorm:"type:uuid;primaryKey"`
	Category   Category `gorm:"reference:CategoryID;constraint:OnDelete:CASCADE;"`
}

func (CategoryTvShow) TableName added in v1.0.1

func (CategoryTvShow) TableName() string

type Episode

type Episode struct {
	ID          int       `gorm:"primaryKey"`
	CreatedAt   time.Time `gorm:"autoCreateTime"`
	UpdatedAt   time.Time `gorm:"autoUpdateTime"`
	Name        string
	NbEpisode   int
	NbSeason    int
	ReleaseDate time.Time  `gorm:"type:date"`
	TvShowID    int        `gorm:"not null"`
	TvShow      TvShow     `gorm:"reference:TvShowID"`
	MediaFileID *string    `gorm:"type:uuid"`
	MediaFile   *MediaFile `gorm:"reference:MediaFileID;constraint:OnDelete:SET NULL;"`
}

type MediaFile

type MediaFile struct {
	Model
	Filename  string
	Duration  float64
	Size      int64
	Audios    []Audio    `gorm:"foreignKey:MediaFileID;constraint:OnDelete:CASCADE;"`
	Subtitles []Subtitle `gorm:"foreignKey:MediaFileID;constraint:OnDelete:CASCADE;"`
}

type Model

type Model struct {
	ID        string `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()"`
	CreatedAt time.Time
	UpdatedAt time.Time
}

type Movie

type Movie struct {
	ID          int       `gorm:"primaryKey"`
	CreatedAt   time.Time `gorm:"autoCreateTime"`
	UpdatedAt   time.Time `gorm:"autoUpdateTime"`
	Name        string
	ReleaseDate time.Time      `gorm:"type:date"`
	MediaFileID *string        `gorm:"type:uuid"`
	MediaFile   *MediaFile     `gorm:"reference:MediaFileID;constraint:OnDelete:SET NULL;"`
	Categories  []Category     `gorm:"many2many:category_movie;constraint:OnDelete:CASCADE;"`
	Ratings     []MovieRating  `gorm:"foreignKey:MovieID;constraint:OnDelete:CASCADE;"`
	Comments    []MovieComment `gorm:"foreignKey:MovieID;constraint:OnDelete:CASCADE;"`
}

type MovieComment added in v1.0.1

type MovieComment struct {
	Model
	Content string
	UserID  string `gorm:"type:uuid;not null"`
	MovieID int    `gorm:"not null"`
	Movie   Movie  `gorm:"reference:MovieID;constraint:OnDelete:CASCADE;"`
}

type MovieRating added in v1.0.1

type MovieRating struct {
	UserID    string    `gorm:"type:uuid;primaryKey"`
	MovieID   int       `gorm:"primaryKey"`
	Movie     Movie     `gorm:"reference:MovieID;constraint:OnDelete:CASCADE;"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
	UpdatedAt time.Time `gorm:"autoUpdateTime"`
	Rating    int
}

type MovieWatchListItem added in v1.0.1

type MovieWatchListItem struct {
	UserID  string          `gorm:"type:uuid;primaryKey"`
	MovieID int             `gorm:"primaryKey"`
	Status  WatchListStatus `gorm:"not null;type:varchar"`
}

func (MovieWatchListItem) TableName added in v1.0.1

func (MovieWatchListItem) TableName() string

type Subtitle

type Subtitle struct {
	Model
	Filename    string
	Language    string
	MediaFileID string    `gorm:"type:uuid;not null"`
	MediaFile   MediaFile `gorm:"reference:MediaFileID"`
}

type TvShow

type TvShow struct {
	ID          int       `gorm:"primaryKey"`
	CreatedAt   time.Time `gorm:"autoCreateTime"`
	UpdatedAt   time.Time `gorm:"autoUpdateTime"`
	Name        string
	ReleaseDate time.Time       `gorm:"type:date"`
	Episodes    []Episode       `gorm:"foreignKey:TvShowID;constraint:OnDelete:CASCADE;"`
	Categories  []Category      `gorm:"many2many:category_tv_show;constraint:OnDelete:CASCADE;"`
	Ratings     []TvShowRating  `gorm:"foreignKey:TvShowID;constraint:OnDelete:CASCADE;"`
	Comments    []TvShowComment `gorm:"foreignKey:TvShowID;constraint:OnDelete:CASCADE;"`
}

type TvShowComment added in v1.0.1

type TvShowComment struct {
	Model
	Content  string
	UserID   string `gorm:"type:uuid;not null"`
	TvShowID int    `gorm:"not null"`
	TvShow   TvShow `gorm:"reference:TvShowID;constraint:OnDelete:CASCADE;"`
}

type TvShowRating added in v1.0.1

type TvShowRating struct {
	UserID    string    `gorm:"type:uuid;primaryKey"`
	TvShowID  int       `gorm:"primaryKey"`
	TvShow    TvShow    `gorm:"reference:TvShowID;constraint:OnDelete:CASCADE;"`
	CreatedAt time.Time `gorm:"autoCreateTime"`
	UpdatedAt time.Time `gorm:"autoUpdateTime"`
	Rating    int
}

type TvShowWatchListItem added in v1.0.1

type TvShowWatchListItem struct {
	UserID   string          `gorm:"type:uuid;primaryKey"`
	TvShowID int             `gorm:"primaryKey"`
	Status   WatchListStatus `gorm:"not null;type:varchar"`
}

func (TvShowWatchListItem) TableName added in v1.0.4

func (TvShowWatchListItem) TableName() string

type WatchListStatus added in v0.5.18

type WatchListStatus string
const (
	WatchListStatusPlanToWatch WatchListStatus = "PLAN_TO_WATCH"
	WatchListStatusWatching    WatchListStatus = "WATCHING"
	WatchListStatusFinished    WatchListStatus = "FINISHED"
	WatchListStatusAbandoned   WatchListStatus = "ABANDONED"
)

Jump to

Keyboard shortcuts

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