Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetectServerType ¶
DetectServerType probes a server URL to determine if it's Plex or Jellyfin. Returns the detected SourceType or an error if detection fails.
Types ¶
type AuthFlow ¶
type AuthFlow interface {
// Run executes the authentication flow and returns credentials.
// The serverURL parameter is the base URL of the media server.
// Implementations handle their own user interaction (prompting for credentials, etc.)
Run(ctx context.Context, serverURL string) (*AuthResult, error)
}
AuthFlow defines a generic authentication flow for any media server. Different backends implement this differently: - Plex: PIN-based OAuth flow (display PIN -> user visits plex.tv/link -> poll for token) - Jellyfin: Username/password authentication
func NewAuthFlow ¶
NewAuthFlow creates the appropriate AuthFlow based on server type. - Plex: PIN-based OAuth flow (display PIN -> user visits plex.tv/link -> poll for token) - Jellyfin: Username/password authentication
type AuthResult ¶
type AuthResult struct {
Token string // Access token for API calls
UserID string // User identifier (required for Jellyfin)
Username string // Display username
}
AuthResult contains the result of a successful authentication
type MediaSource ¶
type MediaSource interface {
domain.LibraryClient // Browsing: GetLibraries, GetMovies, GetShows, GetSeasons, GetEpisodes
domain.PlaybackClient // Playback: ResolvePlayableURL, MarkPlayed/Unplayed
domain.SearchClient // Search: Search(query) across all libraries
domain.PlaylistClient // Playlists: GetPlaylists, CreatePlaylist, AddToPlaylist, etc.
// GetMediaItem fetches full metadata for a single item.
// Kept on MediaSource (not in a domain interface) as it's only used
// by specific features that need detailed item metadata.
GetMediaItem(ctx context.Context, itemID string) (*domain.MediaItem, error)
}
MediaSource combines all client interfaces that a media server backend must implement. This is the unified interface for browsing, playback, search, and playlist operations.