Documentation
¶
Index ¶
- func CountUserDomains(db *pg.DB, userID uuid.UUID) (int, error)
- func CreateDomain(db *pg.DB, userID uuid.UUID, domain string) error
- func DeleteUserDomain(db *pg.DB, domainID uuid.UUID, userID uuid.UUID) error
- func DomainExists(db *pg.DB, domain string) (bool, error)
- func IsInLibrary(ctx context.Context, db *pg.DB, uID uuid.UUID, resourceID string) (bool, error)
- func LinkMovieToMetadata(ctx context.Context, db *pg.DB, movieID uuid.UUID, metadataID uuid.UUID) error
- func LinkSeriesToMetadata(ctx context.Context, db *pg.DB, seriesID uuid.UUID, metadataID uuid.UUID) error
- func RemoveFromLibrary(ctx context.Context, db *pg.DB, uID uuid.UUID, rID string) error
- func ReplaceMoviesForResource(ctx context.Context, db *pg.DB, resourceID string, movies []*Movie) error
- func ReplaceSeriesForResource(ctx context.Context, db *pg.DB, resourceID string, seriesList []*Series) error
- func RevokeAccessToken(db *pg.DB, userID uuid.UUID, name string) error
- func UpdateLibraryName(ctx context.Context, db *pg.DB, l *Library) error
- func UpdateMediaInfo(ctx context.Context, db *pg.DB, info *MediaInfo) error
- func UpdateUserTier(db *pg.DB, u *User) error
- func UpsertMovieMetadata(ctx context.Context, db *pg.DB, md *VideoMetadata) (uuid.UUID, error)
- func UpsertSeriesMetadata(ctx context.Context, db *pg.DB, md *VideoMetadata) (uuid.UUID, error)
- type AccessToken
- type ContentType
- type EmbedDomain
- type EmbedSettings
- type Episode
- type ExternalData
- type ExternalTrack
- type Library
- func AddTorrentToLibrary(ctx context.Context, db *pg.DB, uID uuid.UUID, resourceID string, ...) (*Library, error)
- func GetLibraryByName(ctx context.Context, db *pg.DB, uID uuid.UUID, name string) (*Library, error)
- func GetLibraryByTorrentName(ctx context.Context, db *pg.DB, uID uuid.UUID, name string) (*Library, error)
- func GetLibraryMovieTorrentList(ctx context.Context, db *pg.DB, uID uuid.UUID, sort SortType) ([]*Library, error)
- func GetLibrarySeriesTorrentList(ctx context.Context, db *pg.DB, uID uuid.UUID, sort SortType) ([]*Library, error)
- func GetLibraryTorrentsList(ctx context.Context, db *pg.DB, uID uuid.UUID, sort SortType) ([]*Library, error)
- type MediaInfo
- type MediaInfoMediaType
- type MediaInfoStatus
- type Movie
- func GetLibraryMovieList(ctx context.Context, db *pg.DB, uID uuid.UUID, sort SortType) ([]*Movie, error)
- func GetMovieByID(ctx context.Context, db *pg.DB, uID uuid.UUID, movieID string) (*Movie, error)
- func GetMoviesByResourceID(ctx context.Context, db *pg.DB, resourceID string) ([]*Movie, error)
- func GetMoviesByVideoID(ctx context.Context, db *pg.DB, uID uuid.UUID, videoID string) ([]*Movie, error)
- type MovieMetadata
- type Series
- func GetLibrarySeriesList(ctx context.Context, db *pg.DB, uID uuid.UUID, sort SortType) ([]*Series, error)
- func GetSeriesByID(ctx context.Context, db *pg.DB, uID uuid.UUID, seriesID string) (*Series, error)
- func GetSeriesByResourceID(ctx context.Context, db *pg.DB, resourceID string) ([]*Series, error)
- func GetSeriesByVideoID(ctx context.Context, db *pg.DB, uID uuid.UUID, videoID string) ([]*Series, error)
- func GetSeriesWithEpisodes(ctx context.Context, db *pg.DB, sID uuid.UUID) (*Series, error)
- func (s *Series) GetContent() *VideoContent
- func (s *Series) GetContentType() ContentType
- func (s *Series) GetEpisode(season int, episode int) *Episode
- func (s *Series) GetID() uuid.UUID
- func (s *Series) GetIntYear() int
- func (s *Series) GetMetadata() *VideoMetadata
- func (s *Series) GetPath() *string
- type SeriesMetadata
- type SettingsTrack
- type SortType
- type StreamSettings
- type TorrentResource
- func GetAllResources(ctx context.Context, db *pg.DB) ([]*TorrentResource, error)
- func GetErrorResources(ctx context.Context, db *pg.DB) ([]*TorrentResource, error)
- func GetResourceByID(ctx context.Context, db *pg.DB, id string) (*TorrentResource, error)
- func GetResourcesWithoutMediaInfo(ctx context.Context, db *pg.DB) ([]*TorrentResource, error)
- type URLAlias
- type User
- type VideoContent
- type VideoContentWithMetadata
- type VideoMetadata
- type VideoStreamUserData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountUserDomains ¶
CountUserDomains returns the number of domains for a specific user
func CreateDomain ¶
CreateDomain creates a new embed domain for a user
func DeleteUserDomain ¶
DeleteUserDomain deletes a domain owned by a specific user
func DomainExists ¶
DomainExists checks if a domain already exists in the system
func IsInLibrary ¶
func LinkMovieToMetadata ¶
func LinkSeriesToMetadata ¶
func RemoveFromLibrary ¶
func UpdateUserTier ¶
func UpsertMovieMetadata ¶
func UpsertSeriesMetadata ¶
Types ¶
type AccessToken ¶
type AccessToken struct { Token uuid.UUID `pg:"token,pk"` UserID uuid.UUID `pg:"user_id,notnull"` Name string `pg:"name,notnull"` Scope []string `pg:"scope,array"` ExpiresAt *time.Time `pg:"expires_at"` CreatedAt time.Time `pg:"created_at,notnull"` User *User `pg:"rel:has-one,fk:user_id"` // contains filtered or unexported fields }
func GetAccessTokenByName ¶
func GetAccessTokenByName(db *pg.DB, userID uuid.UUID, name string) (*AccessToken, error)
func GetUserByAccessTokenWithUser ¶
func GetUserByAccessTokenWithUser(db *pg.DB, token uuid.UUID) (*AccessToken, error)
func MakeAccessToken ¶
type ContentType ¶
type ContentType string
const ( ContentTypeMovie ContentType = "movie" ContentTypeSeries ContentType = "series" )
type EmbedDomain ¶
type EmbedDomain struct { ID uuid.UUID `pg:"embed_domain_id,pk,type:uuid,default:uuid_generate_v4()"` Domain string `pg:"domain,notnull"` Ads *bool `pg:"ads,notnull,default:true"` CreatedAt time.Time UpdatedAt time.Time UserID uuid.UUID `pg:"user_id"` User *User `pg:"rel:has-one,fk:user_id"` // contains filtered or unexported fields }
func GetUserDomains ¶
func GetUserDomains(db *pg.DB, userID uuid.UUID) ([]EmbedDomain, error)
GetUserDomains returns all domains for a specific user
type EmbedSettings ¶
type Episode ¶
type Episode struct { EpisodeID uuid.UUID `pg:"episode_id,pk,type:uuid,default:uuid_generate_v4()"` SeriesID uuid.UUID `pg:"series_id"` Season *int16 `pg:"season"` Episode *int16 `pg:"episode"` ResourceID string `pg:"resource_id"` Title *string `pg:"title"` Path *string `pg:"path"` Metadata map[string]any `pg:"metadata,type:jsonb"` CreatedAt time.Time `pg:"created_at,default:now()"` UpdatedAt time.Time `pg:"updated_at,default:now()"` Series *Series `pg:"rel:has-one,fk:series_id"` MediaInfo *MediaInfo `pg:"rel:has-one,fk:resource_id"` // contains filtered or unexported fields }
type ExternalData ¶
type ExternalData struct { Poster string Tracks []ExternalTrack }
type ExternalTrack ¶
type Library ¶
type Library struct { UserID uuid.UUID `pg:"user_id,pk"` ResourceID string `pg:"resource_id,pk"` CreatedAt time.Time `pg:"created_at"` Torrent *TorrentResource `pg:"rel:has-one,fk:resource_id"` MediaInfo *MediaInfo `pg:"rel:has-one,fk:resource_id"` Name string // contains filtered or unexported fields }
func AddTorrentToLibrary ¶
func GetLibraryByName ¶
func GetLibraryByTorrentName ¶
type MediaInfo ¶
type MediaInfo struct { ResourceID string `pg:"resource_id,pk"` Status int16 `pg:"status,use_zero"` MediaType *int16 `pg:"media_type"` Error *string `pg:"error"` CreatedAt time.Time `pg:"created_at,default:now()"` UpdatedAt time.Time `pg:"updated_at,default:now()"` // Relations Movies []*Movie `pg:"rel:has-many,fk:resource_id"` SeriesList []*Series `pg:"rel:has-many,fk:resource_id"` Episodes []*Episode `pg:"rel:has-many,fk:resource_id"` // contains filtered or unexported fields }
type MediaInfoMediaType ¶
type MediaInfoMediaType int16
const ( MediaInfoMediaTypeMovieSingle MediaInfoMediaType = iota MediaInfoMediaTypeSeriesSplitScenes MediaInfoMediaTypeSeriesSingleSeason MediaInfoMediaTypeSeriesMultipleSeasons MediaInfoMediaTypeSeriesCompilation )
func (MediaInfoMediaType) String ¶
func (s MediaInfoMediaType) String() string
type MediaInfoStatus ¶
type MediaInfoStatus int16
const ( MediaInfoStatusProcessing MediaInfoStatus = iota MediaInfoStatusDone MediaInfoStatusNoMedia MediaInfoStatusError MediaInfoStatusForbidden )
type Movie ¶
type Movie struct { *VideoContent MovieID uuid.UUID `pg:"movie_id,pk,type:uuid,default:uuid_generate_v4()"` MovieMetadataID *uuid.UUID `pg:"movie_metadata_id"` Path *string `pg:"path"` CreatedAt time.Time `pg:"created_at,default:now()"` UpdatedAt time.Time `pg:"updated_at,default:now()"` MediaInfo *MediaInfo `pg:"rel:has-one,fk:resource_id"` MovieMetadata *MovieMetadata `pg:"rel:has-one,fk:movie_metadata_id"` LibraryItems []*Library `pg:"rel:has-many,fk:library_id,join_fk:resource_id"` // contains filtered or unexported fields }
func GetLibraryMovieList ¶
func GetMovieByID ¶
func GetMoviesByResourceID ¶
func GetMoviesByVideoID ¶
func (*Movie) GetContent ¶
func (s *Movie) GetContent() *VideoContent
func (*Movie) GetContentType ¶
func (s *Movie) GetContentType() ContentType
func (*Movie) GetIntYear ¶
func (*Movie) GetMetadata ¶
func (s *Movie) GetMetadata() *VideoMetadata
type MovieMetadata ¶
type MovieMetadata struct { *VideoMetadata MovieMetadataID uuid.UUID `pg:"movie_metadata_id,pk,type:uuid,default:uuid_generate_v4()"` CreatedAt time.Time `pg:"created_at,default:now()"` UpdatedAt time.Time `pg:"updated_at,default:now()"` // contains filtered or unexported fields }
func GetMovieMetadataByVideoID ¶
func GetMovieMetadataByVideoID( ctx context.Context, db *pg.DB, imdbID string, ) (*MovieMetadata, error)
type Series ¶
type Series struct { *VideoContent SeriesID uuid.UUID `pg:"series_id,pk,type:uuid,default:uuid_generate_v4()"` SeriesMetadataID *uuid.UUID `pg:"series_metadata_id"` CreatedAt time.Time `pg:"created_at,default:now()"` UpdatedAt time.Time `pg:"updated_at,default:now()"` Episodes []*Episode `pg:"rel:has-many,fk:series_id"` MediaInfo *MediaInfo `pg:"rel:has-one,fk:resource_id"` SeriesMetadata *SeriesMetadata `pg:"rel:has-one,fk:series_metadata_id"` LibraryItems []*Library `pg:"rel:has-many,fk:library_id,join_fk:resource_id"` // contains filtered or unexported fields }
func GetLibrarySeriesList ¶
func GetSeriesByID ¶
func GetSeriesByResourceID ¶
func GetSeriesByVideoID ¶
func GetSeriesWithEpisodes ¶
func (*Series) GetContent ¶
func (s *Series) GetContent() *VideoContent
func (*Series) GetContentType ¶
func (s *Series) GetContentType() ContentType
func (*Series) GetIntYear ¶
func (*Series) GetMetadata ¶
func (s *Series) GetMetadata() *VideoMetadata
type SeriesMetadata ¶
type SeriesMetadata struct { *VideoMetadata SeriesMetadataID uuid.UUID `pg:"series_metadata_id,pk,type:uuid,default:uuid_generate_v4()"` CreatedAt time.Time `pg:"created_at,default:now()"` UpdatedAt time.Time `pg:"updated_at,default:now()"` // contains filtered or unexported fields }
func GetSeriesMetadataByVideoID ¶
func GetSeriesMetadataByVideoID( ctx context.Context, db *pg.DB, videoID string, ) (*SeriesMetadata, error)
type SettingsTrack ¶
type StreamSettings ¶
type StreamSettings struct { BaseURL string `json:"baseUrl"` Width string `json:"width"` Height string `json:"height"` Mode string `json:"mode"` Subtitles []SettingsTrack `json:"subtitles"` Poster string `json:"poster"` Header bool `json:"header"` Title string `json:"title"` ImdbID string `json:"imdbId"` Lang string `json:"lang"` I18n struct{} `json:"i18n"` Features map[string]bool `json:"features"` El struct{} `json:"el"` Controls *bool `json:"controls"` UserLang string `json:"userLang"` }
type TorrentResource ¶
type TorrentResource struct { ResourceID string `pg:"resource_id,pk"` Name string `pg:"name"` FileCount int `pg:"file_count"` SizeBytes int64 `pg:"size_bytes"` CreatedAt time.Time `pg:"created_at"` TorrentSizeBytes int64 `pg:"torrent_size_bytes"` LibraryEntries []*Library `pg:"rel:has-many,fk:resource_id"` MediaInfo *MediaInfo `pg:"rel:has-one,fk:resource_id"` // contains filtered or unexported fields }
func GetAllResources ¶
func GetAllResources(ctx context.Context, db *pg.DB) ([]*TorrentResource, error)
func GetErrorResources ¶
func GetErrorResources(ctx context.Context, db *pg.DB) ([]*TorrentResource, error)
func GetResourceByID ¶
func GetResourceByID(ctx context.Context, db *pg.DB, id string) (*TorrentResource, error)
func GetResourcesWithoutMediaInfo ¶
func GetResourcesWithoutMediaInfo(ctx context.Context, db *pg.DB) ([]*TorrentResource, error)
type URLAlias ¶
type URLAlias struct { Code string `pg:"code,pk"` URL string `pg:"url,notnull"` Proxy bool `pg:"proxy,notnull,default:false"` CreatedAt time.Time `pg:"created_at,notnull"` // contains filtered or unexported fields }
func CreateOrGetURLAlias ¶
func GetURLAliasByCode ¶
type User ¶
type User struct { UserID uuid.UUID `pg:"user_id,pk"` Email string Password string PatreonUserID *string `pg:"patreon_user_id"` CreatedAt time.Time UpdatedAt time.Time Tier string // contains filtered or unexported fields }
func GetOrCreateUser ¶
GetOrCreateUser finds or creates a user. If patreonID is provided (non-nil), it first looks up by patreon_member_id. - If found, it updates the email if different and returns the user. If not found (or patreonID is nil), it falls back to lookup by email. - If an email user is found and patreonID is provided but missing on the record, it links it. - Otherwise, it creates a new user with provided email (and patreonID if given).
type VideoContent ¶
type VideoContentWithMetadata ¶
type VideoContentWithMetadata interface { GetID() uuid.UUID GetContentType() ContentType GetContent() *VideoContent GetMetadata() *VideoMetadata GetPath() *string GetEpisode(season int, episode int) *Episode }
type VideoMetadata ¶
type VideoStreamUserData ¶
type VideoStreamUserData struct { ResourceID string ItemID string SubtitleID string AudioID string AcceptLangTags []language.Tag FallbackLangTag language.Tag Settings *StreamSettings }
func NewVideoStreamUserData ¶
func NewVideoStreamUserData(resourceID string, itemID string, settings *StreamSettings) *VideoStreamUserData
func (*VideoStreamUserData) FetchSessionData ¶
func (s *VideoStreamUserData) FetchSessionData(c *gin.Context)
func (*VideoStreamUserData) UpdateSessionData ¶
func (s *VideoStreamUserData) UpdateSessionData(c *gin.Context) error