Documentation
¶
Index ¶
- func CountUserDomains(ctx context.Context, db *pg.DB, userID uuid.UUID) (int, error)
- func CountUserStremioAddonUrls(ctx context.Context, db *pg.DB, userID uuid.UUID) (int, error)
- func CreateDomain(ctx context.Context, db *pg.DB, userID uuid.UUID, domain string) error
- func CreateOrUpdateStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID, ...) error
- func CreateStreamingBackend(ctx context.Context, db *pg.DB, backend *StreamingBackend) error
- func CreateStremioAddonUrl(ctx context.Context, db *pg.DB, userID uuid.UUID, url string) error
- func CreateStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID, ...) error
- func DeleteOldCacheEntries(ctx context.Context, db *pg.DB, expiration time.Duration) (int, error)
- func DeleteStreamingBackend(ctx context.Context, db *pg.DB, id uuid.UUID) error
- func DeleteUserDomain(ctx context.Context, db *pg.DB, domainID uuid.UUID, userID uuid.UUID) error
- func DeleteUserStremioAddonUrl(ctx context.Context, db *pg.DB, stremioAddonUrlID uuid.UUID, userID uuid.UUID) error
- func DomainExists(ctx context.Context, 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 MarkAsCached(ctx context.Context, db *pg.DB, backendType StreamingBackendType, ...) 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 StreamingBackendExists(ctx context.Context, db *pg.DB, userID uuid.UUID, ...) (bool, error)
- func StremioAddonUrlExists(ctx context.Context, db *pg.DB, userID uuid.UUID, url string) (bool, error)
- func UpdateLibraryName(ctx context.Context, db *pg.DB, l *Library) error
- func UpdateMediaInfo(ctx context.Context, db *pg.DB, info *MediaInfo) error
- func UpdateStreamingBackend(ctx context.Context, db *pg.DB, backend *StreamingBackend) error
- func UpdateStremioAddonUrl(ctx context.Context, db *pg.DB, addon *StremioAddonUrl) error
- func UpdateStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID, ...) error
- func UpdateUserTier(ctx context.Context, 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
- func GetAccessTokenByName(ctx context.Context, db *pg.DB, userID uuid.UUID, name string) (*AccessToken, error)
- func GetUserByAccessTokenWithUser(ctx context.Context, db *pg.DB, token uuid.UUID) (*AccessToken, error)
- func MakeAccessToken(ctx context.Context, db *pg.DB, userID uuid.UUID, name string, scope []string) (*AccessToken, error)
- type CacheIndex
- type CacheIndexResult
- 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 ResolutionSetting
- 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 StreamingBackend
- type StreamingBackendConfig
- type StreamingBackendStatus
- type StreamingBackendType
- type StremioAddonUrl
- func GetAllUserStremioAddonUrls(ctx context.Context, db *pg.DB, userID uuid.UUID) ([]StremioAddonUrl, error)
- func GetStremioAddonUrlByID(ctx context.Context, db *pg.DB, addonID uuid.UUID) (*StremioAddonUrl, error)
- func GetUserStremioAddonUrls(ctx context.Context, db *pg.DB, userID uuid.UUID) ([]StremioAddonUrl, error)
- type StremioSettings
- type StremioSettingsData
- 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 CountUserStremioAddonUrls ¶
CountUserStremioAddonUrls returns the number of stremio addon URLs for a specific user
func CreateDomain ¶
CreateDomain creates a new embed domain for a user
func CreateOrUpdateStremioSettings ¶
func CreateOrUpdateStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID, settings *StremioSettingsData) error
CreateOrUpdateStremioSettings creates or updates Stremio settings for a user
func CreateStreamingBackend ¶
CreateStreamingBackend creates a new streaming backend
func CreateStremioAddonUrl ¶
CreateStremioAddonUrl creates a new stremio addon URL for a user
func CreateStremioSettings ¶
func CreateStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID, settings *StremioSettingsData) error
CreateStremioSettings creates new Stremio settings for a user
func DeleteOldCacheEntries ¶
DeleteOldCacheEntries removes cache entries older than the specified expiration
func DeleteStreamingBackend ¶
DeleteStreamingBackend deletes a streaming backend by ID
func DeleteUserDomain ¶
DeleteUserDomain deletes a domain owned by a specific user
func DeleteUserStremioAddonUrl ¶
func DeleteUserStremioAddonUrl(ctx context.Context, db *pg.DB, stremioAddonUrlID uuid.UUID, userID uuid.UUID) error
DeleteUserStremioAddonUrl deletes a stremio addon URL owned by a specific user
func DomainExists ¶
DomainExists checks if a domain already exists in the system
func IsInLibrary ¶
func LinkMovieToMetadata ¶
func LinkSeriesToMetadata ¶
func MarkAsCached ¶
func MarkAsCached(ctx context.Context, db *pg.DB, backendType StreamingBackendType, resourceID, path string) error
MarkAsCached updates the last_seen_at for a cache entry, or creates it if it doesn't exist
func RemoveFromLibrary ¶
func StreamingBackendExists ¶
func StreamingBackendExists(ctx context.Context, db *pg.DB, userID uuid.UUID, backendType StreamingBackendType) (bool, error)
StreamingBackendExists checks if a streaming backend of given type exists for a user
func StremioAddonUrlExists ¶
func StremioAddonUrlExists(ctx context.Context, db *pg.DB, userID uuid.UUID, url string) (bool, error)
StremioAddonUrlExists checks if a stremio addon URL already exists in the system
func UpdateStreamingBackend ¶
UpdateStreamingBackend updates an existing streaming backend
func UpdateStremioAddonUrl ¶
UpdateStremioAddonUrl updates a stremio addon URL
func UpdateStremioSettings ¶
func UpdateStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID, settings *StremioSettingsData) error
UpdateStremioSettings updates Stremio settings for a user
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 ¶
type CacheIndex ¶
type CacheIndex struct {
ID uuid.UUID `pg:"cache_index_id,pk,type:uuid,default:uuid_generate_v4()"`
BackendType StreamingBackendType `pg:"backend_type,notnull"`
ResourceID string `pg:"resource_id,notnull"`
Path string `pg:"path,notnull"`
LastSeenAt time.Time `pg:"last_seen_at,default:now()"`
CreatedAt time.Time `pg:"created_at,default:now()"`
UpdatedAt time.Time `pg:"updated_at,default:now()"`
// contains filtered or unexported fields
}
type CacheIndexResult ¶
type CacheIndexResult struct {
BackendType StreamingBackendType
LastSeenAt time.Time
}
CacheIndexResult represents a cache entry with backend type and last seen time
func IsCached ¶
func IsCached(ctx context.Context, db *pg.DB, resourceID, path string, expiration time.Duration) ([]CacheIndexResult, error)
IsCached returns a list of backend types and their last seen times for a given resource and path Only returns entries that were seen within the expiration window
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 ¶
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
}
type ResolutionSetting ¶
type ResolutionSetting struct {
Resolution string `json:"resolution"`
Enabled bool `json:"enabled"`
}
ResolutionSetting represents a single quality preference
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
}
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 StreamingBackend ¶
type StreamingBackend struct {
ID uuid.UUID `pg:"streaming_backend_id,pk,type:uuid,default:uuid_generate_v4()"`
UserID uuid.UUID `pg:"user_id,notnull"`
Type StreamingBackendType `pg:"type,notnull"`
AccessToken string `pg:"access_token"`
Config StreamingBackendConfig `pg:"config,type:jsonb,notnull,default:'{}'"`
Priority int16 `pg:"priority,notnull"`
Enabled bool `pg:"enabled,notnull,default:true,use_zero"`
LastStatus *StreamingBackendStatus `pg:"last_status"`
LastCheckedAt *time.Time `pg:"last_checked_at"`
CreatedAt time.Time `pg:"created_at,default:now()"`
UpdatedAt time.Time `pg:"updated_at,default:now()"`
User *User `pg:"rel:has-one,fk:user_id"`
// contains filtered or unexported fields
}
func GetStreamingBackendByID ¶
func GetStreamingBackendByID(ctx context.Context, db *pg.DB, id uuid.UUID) (*StreamingBackend, error)
GetStreamingBackendByID returns a streaming backend by ID
func GetUserStreamingBackends ¶
func GetUserStreamingBackends(ctx context.Context, db *pg.DB, userID uuid.UUID) ([]*StreamingBackend, error)
GetUserStreamingBackends returns all streaming backends for a user ordered by priority (highest first)
type StreamingBackendConfig ¶
type StreamingBackendConfig map[string]interface{}
StreamingBackendConfig represents the JSONB config field
type StreamingBackendStatus ¶
type StreamingBackendStatus string
StreamingBackendStatus represents the last status of a streaming backend
const ( StreamingBackendStatusOK StreamingBackendStatus = "ok" StreamingBackendStatusInvalidCredentials StreamingBackendStatus = "invalid_credentials" StreamingBackendStatusRateLimited StreamingBackendStatus = "rate_limited" StreamingBackendStatusError StreamingBackendStatus = "error" )
type StreamingBackendType ¶
type StreamingBackendType string
StreamingBackendType represents the type of streaming backend
const ( StreamingBackendTypeWebtor StreamingBackendType = "webtor" StreamingBackendTypeRealDebrid StreamingBackendType = "real_debrid" StreamingBackendTypeTorbox StreamingBackendType = "torbox" )
type StremioAddonUrl ¶
type StremioAddonUrl struct {
ID uuid.UUID `pg:"stremio_addon_url_id,pk,type:uuid,default:uuid_generate_v4()"`
Url string `pg:"url,notnull"`
Priority int16 `pg:"priority,notnull,default:1"`
Enabled bool `pg:"enabled,notnull,default:true,use_zero"`
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 GetAllUserStremioAddonUrls ¶
func GetAllUserStremioAddonUrls(ctx context.Context, db *pg.DB, userID uuid.UUID) ([]StremioAddonUrl, error)
GetAllUserStremioAddonUrls returns all stremio addon URLs for a specific user (enabled and disabled), ordered by priority
func GetStremioAddonUrlByID ¶
func GetStremioAddonUrlByID(ctx context.Context, db *pg.DB, addonID uuid.UUID) (*StremioAddonUrl, error)
GetStremioAddonUrlByID retrieves a stremio addon URL by ID
func GetUserStremioAddonUrls ¶
func GetUserStremioAddonUrls(ctx context.Context, db *pg.DB, userID uuid.UUID) ([]StremioAddonUrl, error)
GetUserStremioAddonUrls returns enabled stremio addon URLs for a specific user, ordered by priority
type StremioSettings ¶
type StremioSettings struct {
ID uuid.UUID `pg:"stremio_settings_id,pk,type:uuid,default:uuid_generate_v4()"`
Settings *StremioSettingsData `pg:"settings,type:jsonb,notnull"`
CreatedAt time.Time
UpdatedAt time.Time
UserID uuid.UUID `pg:"user_id,unique"`
User *User `pg:"rel:has-one,fk:user_id"`
// contains filtered or unexported fields
}
func GetUserStremioSettings ¶
func GetUserStremioSettings(ctx context.Context, db *pg.DB, userID uuid.UUID) (*StremioSettings, error)
GetUserStremioSettings returns Stremio settings for a specific user
type StremioSettingsData ¶
type StremioSettingsData struct {
PreferredResolutions []ResolutionSetting `json:"preferred_resolutions"`
}
StremioSettingsData represents the structure of the JSONB settings field
func GetDefaultStremioSettings ¶
func GetDefaultStremioSettings() *StremioSettingsData
GetDefaultStremioSettings returns the default Stremio settings
func GetUserStremioSettingsData ¶
func GetUserStremioSettingsData(ctx context.Context, db *pg.DB, userID uuid.UUID) (*StremioSettingsData, error)
GetUserStremioSettings returns Stremio settings for a specific user
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 GetErrorResources ¶
func GetResourceByID ¶
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 ¶
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 ¶
func GetOrCreateUser(ctx context.Context, db *pg.DB, email string, patreonUserID *string) (*User, bool, error)
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
Source Files
¶
- access_token.go
- cache_index.go
- embed_domain.go
- embed_settings.go
- episode.go
- library.go
- media_info.go
- movie.go
- movie_metadata.go
- series.go
- series_metadata.go
- stream_settings.go
- streaming_backend.go
- stremio_addon_url.go
- stremio_settings.go
- torrent_resource.go
- url_alias.go
- user.go
- video_content.go
- video_metadata.go
- video_stream.go