Documentation
¶
Index ¶
- func New(cfg *config.Config) (db *gorm.DB, err error)
- type Actor
- type ActorAlias
- type ActorLink
- type Category
- type CategorySub
- type Channel
- type Configuration
- type Provider
- type Task
- type TaskStatus
- type User
- type UserSession
- type Video
- func (v *Video) BeforeCreate(tx *gorm.DB) error
- func (v *Video) FolderRelativePath() string
- func (v *Video) HasDuration() bool
- func (v *Video) NiceDuration() string
- func (v *Video) NiceDurationShort() string
- func (v *Video) RelativePath() string
- func (v *Video) String() string
- func (v *Video) ThumbnailRelativePath() string
- func (v *Video) ThumbnailXSRelativePath() string
- func (v *Video) TypeAsString() string
- func (v *Video) URLAdmEdit() string
- func (v *Video) URLStream() string
- func (v *Video) URLThumb() string
- func (v *Video) URLThumbXS() string
- func (v *Video) URLView() string
- type VideoStatus
- type VideoView
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Actor ¶
type Actor struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string
Videos []Video `gorm:"many2many:video_actors;"`
Thumbnail bool
Sex string `gorm:"size:2;"`
Aliases []ActorAlias
Links []ActorLink
Categories []CategorySub `gorm:"many2many:actor_categories;"`
Description string
}
func (*Actor) AliasesAsNiceString ¶
func (*Actor) SexTypeAsString ¶
func (*Actor) URLAdmDelete ¶
func (*Actor) URLAdmEdit ¶
type ActorAlias ¶
type ActorAlias struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string
ActorID string
Actor Actor
}
func (*ActorAlias) BeforeCreate ¶
func (a *ActorAlias) BeforeCreate(tx *gorm.DB) error
UUID pre-hook
type ActorLink ¶
type Category ¶
type CategorySub ¶
type CategorySub struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string
Category string `gorm:"type:uuid"`
Thumbnail bool
Videos []*Video `gorm:"many2many:video_categories;"`
Actors []*Actor `gorm:"many2many:actor_categories;"`
}
func (*CategorySub) BeforeCreate ¶
func (c *CategorySub) BeforeCreate(tx *gorm.DB) error
UUID pre-hook
func (*CategorySub) URLThumb ¶
func (c *CategorySub) URLThumb() string
type Channel ¶
type Channel struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string
Thumbnail bool
}
func (*Channel) URLAdmEdit ¶
type Configuration ¶
type Task ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskStatusTodo TaskStatus = "todo" TaskStatusInProgress TaskStatus = "in-progress" TaskStatusDone TaskStatus = "done" TaskStatusError TaskStatus = "error" )
type User ¶
type User struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Username string
Password string
Admin bool
Session UserSession
}
func (*User) URLAdmDelete ¶
type UserSession ¶
type UserSession struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
UserID *string
ValidUntil time.Time
}
func (*UserSession) BeforeCreate ¶
func (u *UserSession) BeforeCreate(tx *gorm.DB) error
UUID pre-hook
type Video ¶
type Video struct {
ID string `gorm:"type:uuid;primary_key"`
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt gorm.DeletedAt `gorm:"index"`
Name string
Filename string
Actors []Actor `gorm:"many2many:video_actors;"`
Channel *Channel
ChannelID *string
Thumbnail bool
ThumbnailMini bool
Duration time.Duration
Type string `gorm:"size:1;"`
Imported bool `gorm:"default:false"`
Status VideoStatus `gorm:"default:creating"`
Categories []CategorySub `gorm:"many2many:video_categories;"`
}
Video model defines the generic video type used for videos, clips and movies
func (*Video) FolderRelativePath ¶
func (*Video) HasDuration ¶
func (*Video) NiceDuration ¶
func (*Video) NiceDurationShort ¶
func (*Video) RelativePath ¶
func (*Video) ThumbnailRelativePath ¶
func (*Video) ThumbnailXSRelativePath ¶
func (*Video) TypeAsString ¶
func (*Video) URLAdmEdit ¶
func (*Video) URLThumbXS ¶
type VideoStatus ¶
type VideoStatus string
const ( VideoStatusCreating VideoStatus = "creating" VideoStatusReady VideoStatus = "ready" VideoStatusDeleting VideoStatus = "deleting" )
Click to show internal directories.
Click to hide internal directories.