entity

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Admin

type Admin struct {
	Permissions datatypes.JSONSlice[shared.Permission] `json:"permissions"`
	TelegramID  int64                                  `gorm:"index" json:"telegram_id"`
	ID          ouid.OUID                              `gorm:"primaryKey;type:uuid" json:"id"`
}

func (*Admin) BeforeCreate

func (a *Admin) BeforeCreate(tx *gorm.DB) (err error)

func (*Admin) HasPermission

func (a *Admin) HasPermission(perm shared.Permission) bool

type ApiKey

type ApiKey struct {
	Key         string                                 `gorm:"type:text;not null;uniqueIndex" json:"key"`
	Description string                                 `gorm:"type:text" json:"description"`
	Permissions datatypes.JSONSlice[shared.Permission] `gorm:"type:json" json:"permissions"`
	Quota       int                                    `gorm:"not null;default:0" json:"quota"`
	Used        int                                    `gorm:"not null;default:0" json:"used"`
	ID          ouid.OUID                              `gorm:"primaryKey;type:uuid" json:"id"`
}

func (*ApiKey) BeforeCreate

func (a *ApiKey) BeforeCreate(tx *gorm.DB) (err error)

func (*ApiKey) CanUse

func (a *ApiKey) CanUse() bool

func (*ApiKey) HasPermission

func (a *ApiKey) HasPermission(p shared.Permission) bool

type Artist

type Artist struct {
	Name     string            `gorm:"type:text;not null;index" json:"name"`
	Type     shared.SourceType `gorm:"type:text;not null;index" json:"type"`
	UID      string            `gorm:"type:text;not null;index" json:"uid"`
	Username string            `gorm:"type:text;not null;index" json:"username"`

	// reverse relation
	Artworks []*Artwork `gorm:"foreignKey:ArtistID" json:"-"` // json ignore to avoid circular reference
	ID       ouid.OUID  `gorm:"primaryKey;type:uuid" json:"id"`
}

func (*Artist) BeforeCreate

func (a *Artist) BeforeCreate(tx *gorm.DB) (err error)

func (*Artist) GetName

func (a *Artist) GetName() string

GetName implements shared.ArtistLike.

func (*Artist) GetUID

func (a *Artist) GetUID() string

GetUID implements shared.ArtistLike.

func (*Artist) GetUserName

func (a *Artist) GetUserName() string

GetUserName implements shared.ArtistLike.

type Artwork

type Artwork struct {
	CreatedAt time.Time `gorm:"not null;autoCreateTime;index:idx_artwork_created_at,sort:desc" json:"created_at"`
	UpdatedAt time.Time `gorm:"not null;autoUpdateTime" json:"updated_at"`
	Artist    *Artist   `gorm:"foreignKey:ArtistID;references:ID;constraint:OnUpdate:CASCADE,OnDelete:SET NULL" json:"artist"`

	Title       string            `gorm:"type:text;not null;index:idx_artwork_title,sort:asc" json:"title"`
	Description string            `gorm:"type:text" json:"description"`
	SourceType  shared.SourceType `gorm:"type:text;not null;index:idx_artwork_source_type" json:"source_type"`
	SourceURL   string            `gorm:"type:text;not null;uniqueIndex" json:"source_url"`

	// many2many relationship with tags
	Tags []*Tag `gorm:"many2many:artwork_tags;constraint:OnDelete:CASCADE" json:"tags"`
	// one-to-many pictures
	Pictures []*Picture `gorm:"foreignKey:ArtworkID;constraint:OnDelete:CASCADE" json:"pictures"`
	// https://www.pixiv.help/hc/en-us/articles/235584628-What-are-Ugoira
	// one-to-many ugoira meta, usually only one
	UgoiraMetas []*UgoiraMeta `gorm:"foreignKey:ArtworkID;constraint:OnDelete:CASCADE" json:"ugoira_meta,omitempty"`
	// one-to-many videos
	Videos    []*Video `gorm:"foreignKey:ArtworkID;constraint:OnDelete:CASCADE" json:"videos"`
	LikeCount uint     `gorm:"not null;default:0" json:"like_count"`

	// keep ObjectID as 24-hex string
	ID ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`

	ArtistID ouid.OUID `gorm:"type:uuid;index" json:"artist_id"`
	R18      bool      `gorm:"not null;default:false;index:idx_artwork_r18" json:"r18"`
}

func (*Artwork) BeforeCreate

func (a *Artwork) BeforeCreate(tx *gorm.DB) (err error)

func (*Artwork) FirstMedia added in v1.5.0

func (a *Artwork) FirstMedia() shared.MediaLike

func (*Artwork) GetArtist

func (a *Artwork) GetArtist() shared.ArtistLike

GetArtist implements ArtworkLike.

func (*Artwork) GetDescription

func (a *Artwork) GetDescription() string

GetDescription implements ArtworkLike.

func (*Artwork) GetID

func (a *Artwork) GetID() string

func (*Artwork) GetPictures

func (a *Artwork) GetPictures() []shared.PictureLike

GetPictures implements ArtworkLike.

func (*Artwork) GetR18

func (a *Artwork) GetR18() bool

func (*Artwork) GetSourceURL

func (a *Artwork) GetSourceURL() string

GetSourceURL implements ArtworkLike.

func (*Artwork) GetTags

func (a *Artwork) GetTags() []string

GetTags implements ArtworkLike.

func (*Artwork) GetTagsWithAlias

func (a *Artwork) GetTagsWithAlias() []string

func (*Artwork) GetTitle

func (a *Artwork) GetTitle() string

GetTitle implements ArtworkLike.

func (*Artwork) GetType

func (a *Artwork) GetType() shared.SourceType

GetType implements shared.ArtworkLike.

func (*Artwork) GetUgoiraMetas

func (a *Artwork) GetUgoiraMetas() []shared.UgoiraMetaLike

GetUgoiraMetas implements shared.UgoiraArtworkLike.

func (*Artwork) GetVideos added in v1.5.0

func (a *Artwork) GetVideos() []shared.VideoLike

GetVideos implements shared.ArtworkLike.

func (*Artwork) MediasCount added in v1.5.0

func (a *Artwork) MediasCount() int

MediasCount implements shared.ArtworkLike.

type CachedArtist

type CachedArtist struct {
	ID       string            `json:"id"`
	Name     string            `json:"name"`
	Type     shared.SourceType `json:"type"`
	UID      string            `json:"uid"`
	Username string            `json:"username"`
}

func (*CachedArtist) GetName

func (c *CachedArtist) GetName() string

GetName implements shared.ArtistLike.

func (*CachedArtist) GetUID

func (c *CachedArtist) GetUID() string

GetUID implements shared.ArtistLike.

func (*CachedArtist) GetUserName

func (c *CachedArtist) GetUserName() string

GetUserName implements shared.ArtistLike.

type CachedArtwork

type CachedArtwork struct {
	CreatedAt time.Time                              `gorm:"autoCreateTime" json:"created_at"`
	Artwork   datatypes.JSONType[*CachedArtworkData] `gorm:"type:json" json:"artwork"`
	SourceURL string                                 `gorm:"type:text;uniqueIndex" json:"source_url"`
	Status    shared.ArtworkStatus                   `gorm:"type:text;index" json:"status"`
	ID        ouid.OUID                              `gorm:"primaryKey;type:uuid" json:"id"`
}

func (*CachedArtwork) BeforeCreate

func (c *CachedArtwork) BeforeCreate(tx *gorm.DB) (err error)

func (*CachedArtwork) FirstMedia added in v1.5.0

func (c *CachedArtwork) FirstMedia() shared.MediaLike

FirstMedia implements shared.ArtworkLike.

func (*CachedArtwork) GetArtist

func (c *CachedArtwork) GetArtist() shared.ArtistLike

GetArtist implements ArtworkLike.

func (*CachedArtwork) GetDescription

func (c *CachedArtwork) GetDescription() string

GetDescription implements ArtworkLike.

func (*CachedArtwork) GetID

func (c *CachedArtwork) GetID() string

func (*CachedArtwork) GetPictures

func (c *CachedArtwork) GetPictures() []shared.PictureLike

GetPictures implements ArtworkLike.

func (*CachedArtwork) GetR18

func (c *CachedArtwork) GetR18() bool

func (*CachedArtwork) GetSourceURL

func (c *CachedArtwork) GetSourceURL() string

GetSourceURL implements ArtworkLike.

func (*CachedArtwork) GetTags

func (c *CachedArtwork) GetTags() []string

GetTags implements ArtworkLike.

func (*CachedArtwork) GetTitle

func (c *CachedArtwork) GetTitle() string

GetTitle implements ArtworkLike.

func (*CachedArtwork) GetType

func (c *CachedArtwork) GetType() shared.SourceType

GetType implements shared.ArtworkLike.

func (*CachedArtwork) GetUgoiraMetas

func (c *CachedArtwork) GetUgoiraMetas() []shared.UgoiraMetaLike

GetUgoiraMetas implements shared.UgoiraArtworkLike.

func (*CachedArtwork) GetVideos added in v1.5.0

func (c *CachedArtwork) GetVideos() []shared.VideoLike

GetVideos implements shared.ArtworkLike.

func (*CachedArtwork) MediasCount added in v1.5.0

func (c *CachedArtwork) MediasCount() int

type CachedArtworkData

type CachedArtworkData struct {
	Artist      *CachedArtist     `json:"artist"`
	ID          string            `json:"id"`
	Title       string            `json:"title"`
	Description string            `json:"description"`
	SourceType  shared.SourceType `json:"source_type"`
	SourceURL   string            `json:"source_url"`

	Tags        []string            `json:"tags"`
	Pictures    []*CachedPicture    `json:"pictures"`
	UgoiraMetas []*CachedUgoiraMeta `json:"ugoira_metas,omitempty"`
	Videos      []*CachedVideo      `json:"videos,omitempty"`

	Version int  `json:"version"` // for future schema changes
	R18     bool `json:"r18"`
}

func (*CachedArtworkData) FirstMedia added in v1.5.0

func (c *CachedArtworkData) FirstMedia() shared.MediaLike

FirstMedia implements shared.ArtworkLike.

func (*CachedArtworkData) GetArtist

func (c *CachedArtworkData) GetArtist() shared.ArtistLike

GetArtist implements ArtworkLike.

func (*CachedArtworkData) GetDescription

func (c *CachedArtworkData) GetDescription() string

GetDescription implements ArtworkLike.

func (*CachedArtworkData) GetID

func (c *CachedArtworkData) GetID() string

func (*CachedArtworkData) GetPictures

func (c *CachedArtworkData) GetPictures() []shared.PictureLike

GetPictures implements ArtworkLike.

func (*CachedArtworkData) GetR18

func (c *CachedArtworkData) GetR18() bool

GetR18 implements ArtworkLike.

func (*CachedArtworkData) GetSourceURL

func (c *CachedArtworkData) GetSourceURL() string

GetSourceURL implements ArtworkLike.

func (*CachedArtworkData) GetTags

func (c *CachedArtworkData) GetTags() []string

GetTags implements ArtworkLike.

func (*CachedArtworkData) GetTitle

func (c *CachedArtworkData) GetTitle() string

GetTitle implements ArtworkLike.

func (*CachedArtworkData) GetType

func (c *CachedArtworkData) GetType() shared.SourceType

func (*CachedArtworkData) GetUgoiraMetas

func (c *CachedArtworkData) GetUgoiraMetas() []shared.UgoiraMetaLike

GetUgoiraMetas implements shared.UgoiraArtworkLike.

func (*CachedArtworkData) GetVideos added in v1.5.0

func (c *CachedArtworkData) GetVideos() []shared.VideoLike

GetVideos implements shared.ArtworkLike.

func (*CachedArtworkData) GetViewablePictures

func (c *CachedArtworkData) GetViewablePictures() []*CachedPicture

func (*CachedArtworkData) MediasCount added in v1.5.0

func (c *CachedArtworkData) MediasCount() int

MediasCount implements shared.ArtworkLike.

type CachedPicture

type CachedPicture struct {
	StorageInfo  shared.StorageInfo  `json:"storage_info"`
	TelegramInfo shared.TelegramInfo `json:"telegram_info"`
	ID           string              `json:"id"`
	ArtworkID    string              `json:"artwork_id"`
	Thumbnail    string              `json:"thumbnail"`
	Original     string              `json:"original"`
	Phash        string              `json:"phash"`      // phash
	ThumbHash    string              `json:"thumb_hash"` // thumbhash

	OrderIndex uint `json:"index"`

	Width  uint `json:"width"`
	Height uint `json:"height"`
	Hidden bool `json:"hidden"` // 设为 true 时不发布到 Artwork 中, 但仍在其他接口中返回

}

func (*CachedPicture) GetIndex

func (c *CachedPicture) GetIndex() uint

GetIndex implements PictureLike.

func (*CachedPicture) GetOriginal

func (c *CachedPicture) GetOriginal() string

GetOriginal implements PictureLike.

func (*CachedPicture) GetSize

func (c *CachedPicture) GetSize() (width uint, height uint)

GetSize implements PictureLike.

func (*CachedPicture) GetStorageInfo

func (c *CachedPicture) GetStorageInfo() shared.StorageInfo

GetStorageInfo implements PictureLike.

func (*CachedPicture) GetTelegramInfo

func (c *CachedPicture) GetTelegramInfo() shared.TelegramInfo

GetTelegramInfo implements PictureLike.

func (*CachedPicture) GetThumbnail

func (c *CachedPicture) GetThumbnail() string

GetThumbnail implements PictureLike.

func (*CachedPicture) IsHide

func (c *CachedPicture) IsHide() bool

IsHide implements PictureLike.

type CachedUgoiraMeta

type CachedUgoiraMeta struct {
	TelegramInfo    shared.TelegramInfo   `json:"telegram_info"`
	OriginalStorage shared.StorageDetail  `json:"original_storage"`
	ID              string                `json:"id"`
	ArtworkID       string                `json:"artwork_id"`
	MetaData        shared.UgoiraMetaData `json:"data"`
	OrderIndex      uint                  `json:"index"`
}

func (*CachedUgoiraMeta) GetData added in v1.7.0

func (c *CachedUgoiraMeta) GetData() shared.UgoiraMetaData

GetData implements shared.UgoiraMetaLike.

func (*CachedUgoiraMeta) GetIndex

func (c *CachedUgoiraMeta) GetIndex() uint

GetIndex implements shared.UgoiraMetaLike.

func (*CachedUgoiraMeta) GetOriginalStorage

func (c *CachedUgoiraMeta) GetOriginalStorage() shared.StorageDetail

GetOriginalStorage implements shared.UgoiraMetaLike.

func (*CachedUgoiraMeta) GetTelegramInfo

func (c *CachedUgoiraMeta) GetTelegramInfo() shared.TelegramInfo

GetTelegramInfo implements shared.UgoiraMetaLike.

type CachedVideo added in v1.5.0

type CachedVideo struct {
	TelegramInfo    shared.TelegramInfo  `json:"telegram_info"`
	OriginalStorage shared.StorageDetail `json:"original_storage"`
	ID              string               `json:"id"`
	ArtworkID       string               `json:"artwork_id"`
	Poster          string               `json:"poster"`
	URL             string               `json:"original"`
	MimeType        string               `json:"mime_type"`
	OrderIndex      uint                 `json:"index"`
	Width           uint                 `json:"width"`
	Height          uint                 `json:"height"`
	Duration        uint                 `json:"duration"` // in milliseconds
}

func (*CachedVideo) GetDuration added in v1.5.0

func (c *CachedVideo) GetDuration() uint

GetDuration implements shared.VideoLike.

func (*CachedVideo) GetHeight added in v1.5.0

func (c *CachedVideo) GetHeight() uint

GetHeight implements shared.VideoLike.

func (*CachedVideo) GetIndex added in v1.5.0

func (c *CachedVideo) GetIndex() uint

GetIndex implements shared.VideoLike.

func (*CachedVideo) GetMimeType added in v1.5.0

func (c *CachedVideo) GetMimeType() string

GetMimeType implements shared.VideoLike.

func (*CachedVideo) GetOriginalStorage added in v1.5.0

func (c *CachedVideo) GetOriginalStorage() shared.StorageDetail

GetStorageInfo implements shared.VideoLike.

func (*CachedVideo) GetPoster added in v1.5.0

func (c *CachedVideo) GetPoster() string

GetPoster implements shared.VideoLike.

func (*CachedVideo) GetTelegramInfo added in v1.5.0

func (c *CachedVideo) GetTelegramInfo() shared.TelegramInfo

GetTelegramInfo implements shared.VideoLike.

func (*CachedVideo) GetURL added in v1.5.0

func (c *CachedVideo) GetURL() string

GetURL implements shared.VideoLike.

func (*CachedVideo) GetWidth added in v1.5.0

func (c *CachedVideo) GetWidth() uint

GetWidth implements shared.VideoLike.

type DeletedRecord

type DeletedRecord struct {
	DeletedAt time.Time `gorm:"not null;autoCreateTime" json:"deleted_at"`
	SourceURL string    `gorm:"type:text;not null;uniqueIndex" json:"source_url"`
	ID        ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`
}

func (*DeletedRecord) BeforeCreate

func (d *DeletedRecord) BeforeCreate(tx *gorm.DB) (err error)

type Picture

type Picture struct {
	StorageInfo datatypes.JSONType[shared.StorageInfo] `json:"storage_info"`

	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`

	TelegramInfo datatypes.JSONType[shared.TelegramInfo] `json:"telegram_info"`
	Artwork      *Artwork                                `gorm:"foreignKey:ArtworkID;references:ID;constraint:OnDelete:CASCADE" json:"-"`

	Thumbnail string `gorm:"type:text" json:"thumbnail"`
	Original  string `gorm:"type:text;index" json:"original"`
	Phash     string `gorm:"type:text;index" json:"phash"` // phash
	ThumbHash string `gorm:"type:text" json:"thumb_hash"`  // thumbhash

	OrderIndex uint      `gorm:"column:order_index;not null;default:0;index:idx_picture_artwork_index,priority:1" json:"index"`
	Width      uint      `json:"width"`
	Height     uint      `json:"height"`
	ID         ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`
	ArtworkID  ouid.OUID `gorm:"type:uuid;index" json:"artwork_id"`
}

func (*Picture) BeforeCreate

func (p *Picture) BeforeCreate(tx *gorm.DB) (err error)

func (*Picture) GetIndex

func (p *Picture) GetIndex() uint

GetIndex implements PictureLike.

func (*Picture) GetOriginal

func (p *Picture) GetOriginal() string

GetOriginal implements PictureLike.

func (*Picture) GetSize

func (p *Picture) GetSize() (width uint, height uint)

GetSize implements PictureLike.

func (*Picture) GetStorageInfo

func (p *Picture) GetStorageInfo() shared.StorageInfo

GetStorageInfo implements PictureLike.

func (*Picture) GetTelegramInfo

func (p *Picture) GetTelegramInfo() shared.TelegramInfo

GetTelegramInfo implements PictureLike.

func (*Picture) GetThumbnail

func (p *Picture) GetThumbnail() string

GetThumbnail implements PictureLike.

func (*Picture) IsHide

func (p *Picture) IsHide() bool

IsHide implements PictureLike.

type Tag

type Tag struct {
	Name  string     `gorm:"type:text;not null;uniqueIndex" json:"name"`
	Alias []TagAlias `gorm:"foreignKey:TagID;constraint:OnDelete:CASCADE" json:"alias"` // one-to-many relation

	// reverse relation via many2many
	Artworks []*Artwork `gorm:"many2many:artwork_tags" json:"-"`
	ID       ouid.OUID  `gorm:"primaryKey;type:uuid" json:"id"`
}

func (*Tag) BeforeCreate

func (t *Tag) BeforeCreate(tx *gorm.DB) (err error)

type TagAlias

type TagAlias struct {
	Alias string    `gorm:"type:text;not null;index" json:"alias"`
	ID    ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`
	TagID ouid.OUID `gorm:"type:uuid;index" json:"tag_id"`
}

func (*TagAlias) BeforeCreate

func (ta *TagAlias) BeforeCreate(tx *gorm.DB) (err error)

type UgoiraMeta

type UgoiraMeta struct {
	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`

	TelegramInfo datatypes.JSONType[shared.TelegramInfo] `json:"telegram_info"`
	Artwork      *Artwork                                `gorm:"foreignKey:ArtworkID;references:ID;constraint:OnDelete:CASCADE" json:"-"`

	OriginalStorage datatypes.JSONType[shared.StorageDetail]  `json:"original_storage"`
	Data            datatypes.JSONType[shared.UgoiraMetaData] `json:"data"`

	OrderIndex uint      `gorm:"column:order_index;not null;default:0;index:idx_ugoira_artwork_index,priority:1" json:"index"`
	ID         ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`
	ArtworkID  ouid.OUID `gorm:"type:uuid;index" json:"artwork_id"`
}

func (*UgoiraMeta) BeforeCreate

func (u *UgoiraMeta) BeforeCreate(tx *gorm.DB) (err error)

func (*UgoiraMeta) GetData added in v1.7.0

func (u *UgoiraMeta) GetData() shared.UgoiraMetaData

GetData implements shared.UgoiraMetaLike.

func (*UgoiraMeta) GetIndex

func (u *UgoiraMeta) GetIndex() uint

GetIndex implements shared.UgoiraMetaLike.

func (*UgoiraMeta) GetOriginalStorage

func (u *UgoiraMeta) GetOriginalStorage() shared.StorageDetail

GetOriginalStorage implements shared.UgoiraMetaLike.

func (*UgoiraMeta) GetTelegramInfo

func (u *UgoiraMeta) GetTelegramInfo() shared.TelegramInfo

GetTelegramInfo implements shared.UgoiraMetaLike.

type User

type User struct {
	UpdatedAt  time.Time `gorm:"autoUpdateTime" json:"updated_at"`
	Email      *string   `gorm:"type:text;uniqueIndex" json:"email"`
	TelegramID *int64    `gorm:"type:bigint;uniqueIndex" json:"telegram_id"`

	Settings  datatypes.JSONType[*UserSettings] `gorm:"type:json" json:"settings"`
	DeletedAt gorm.DeletedAt                    `gorm:"index" json:"deleted_at"`

	Username string `gorm:"type:text;uniqueIndex" json:"username"`
	Password string `gorm:"type:text;not null" json:"password"`

	Favorites []*Artwork `gorm:"many2many:user_favorites;constraint:OnDelete:CASCADE" json:"favorites"`

	ID      ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`
	Blocked bool      `gorm:"not null;default:false;index" json:"blocked"`
}

只是为了兼容...

V1 里或许永远用不上

func (*User) BeforeCreate

func (u *User) BeforeCreate(tx *gorm.DB) (err error)

type UserSettings

type UserSettings struct {
	Language string `json:"language"`
	Theme    string `json:"theme"`
	R18      bool   `json:"r18"`
}

type Video added in v1.5.0

type Video struct {
	CreatedAt time.Time `gorm:"autoCreateTime" json:"created_at"`
	UpdatedAt time.Time `gorm:"autoUpdateTime" json:"updated_at"`

	TelegramInfo    datatypes.JSONType[shared.TelegramInfo]  `json:"telegram_info"`
	Artwork         *Artwork                                 `gorm:"foreignKey:ArtworkID;references:ID;constraint:OnDelete:CASCADE" json:"-"`
	OriginalStorage datatypes.JSONType[shared.StorageDetail] `json:"original_storage"`

	Poster   string `gorm:"type:text" json:"poster"` // poster image URL
	MimeType string `gorm:"type:text" json:"mime_type"`
	URL      string `gorm:"type:text;index" json:"url"` // video URL

	OrderIndex uint      `gorm:"column:order_index;not null;default:0;index:idx_video_artwork_index,priority:1" json:"index"`
	Duration   uint      `json:"duration"` // duration in ms
	Width      uint      `json:"width"`
	Height     uint      `json:"height"`
	ID         ouid.OUID `gorm:"primaryKey;type:uuid" json:"id"`
	ArtworkID  ouid.OUID `gorm:"type:uuid;index" json:"artwork_id"`
}

func (*Video) BeforeCreate added in v1.5.0

func (v *Video) BeforeCreate(tx *gorm.DB) (err error)

func (*Video) GetDuration added in v1.5.0

func (v *Video) GetDuration() uint

GetDuration implements shared.VideoLike.

func (*Video) GetHeight added in v1.5.0

func (v *Video) GetHeight() uint

GetHeight implements shared.VideoLike.

func (*Video) GetIndex added in v1.5.0

func (v *Video) GetIndex() uint

GetIndex implements shared.VideoLike.

func (*Video) GetMimeType added in v1.5.0

func (v *Video) GetMimeType() string

GetMimeType implements shared.VideoLike.

func (*Video) GetOriginalStorage added in v1.5.0

func (v *Video) GetOriginalStorage() shared.StorageDetail

GetStorageInfo implements shared.VideoLike.

func (*Video) GetPoster added in v1.5.0

func (v *Video) GetPoster() string

GetPoster implements shared.VideoLike.

func (*Video) GetTelegramInfo added in v1.5.0

func (v *Video) GetTelegramInfo() shared.TelegramInfo

GetTelegramInfo implements shared.VideoLike.

func (*Video) GetURL added in v1.5.0

func (v *Video) GetURL() string

GetURL implements shared.VideoLike.

func (*Video) GetWidth added in v1.5.0

func (v *Video) GetWidth() uint

GetWidth implements shared.VideoLike.

Jump to

Keyboard shortcuts

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