Documentation
¶
Index ¶
- type Manager
- func (m *Manager) DeleteMapping(ctx context.Context, anilistID int) error
- func (m *Manager) GetMapping(ctx context.Context, anilistID int) (*ProviderMapping, error)
- func (m *Manager) GetOrCreateMapping(ctx context.Context, anilistID int, title string, ...) (*ProviderMapping, []providers.Media, error)
- func (m *Manager) RemapMedia(ctx context.Context, anilistID int, title string, ...) ([]providers.Media, error)
- func (m *Manager) SaveMapping(ctx context.Context, mapping *ProviderMapping) error
- func (m *Manager) SearchProviders(ctx context.Context, title string, mediaType providers.MediaType) ([]SearchResult, error)
- func (m *Manager) SelectMapping(ctx context.Context, anilistID int, providerName string, ...) error
- func (m *Manager) SetMinMatchScore(score float64)
- type ProviderMapping
- type SearchResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles AniList to provider mappings
func NewManager ¶
NewManager creates a new mapping manager
func NewManagerWithDebug ¶
func NewManagerWithDebug(db *gorm.DB, preferredProvider string, debug bool, logger *slog.Logger) *Manager
NewManagerWithDebug creates a new mapping manager with debug flag
func (*Manager) DeleteMapping ¶
DeleteMapping removes a mapping from the database
func (*Manager) GetMapping ¶
GetMapping retrieves an existing mapping for an AniList ID
func (*Manager) GetOrCreateMapping ¶
func (m *Manager) GetOrCreateMapping(ctx context.Context, anilistID int, title string, mediaType providers.MediaType) (*ProviderMapping, []providers.Media, error)
GetOrCreateMapping retrieves an existing mapping or searches the provider Returns the mapping if it exists, or search results for user selection
func (*Manager) RemapMedia ¶
func (m *Manager) RemapMedia(ctx context.Context, anilistID int, title string, mediaType providers.MediaType) ([]providers.Media, error)
RemapMedia searches for a new provider mapping and updates the database Used when user wants to manually change the mapping
func (*Manager) SaveMapping ¶
func (m *Manager) SaveMapping(ctx context.Context, mapping *ProviderMapping) error
SaveMapping persists a mapping to the database
func (*Manager) SearchProviders ¶
func (m *Manager) SearchProviders(ctx context.Context, title string, mediaType providers.MediaType) ([]SearchResult, error)
SearchProviders searches for anime across providers using smart fallback strategy Returns all matches above the minimum similarity threshold, sorted by score
func (*Manager) SelectMapping ¶
func (m *Manager) SelectMapping(ctx context.Context, anilistID int, providerName string, selected providers.Media) error
SelectMapping saves a user-selected mapping from search results
func (*Manager) SetMinMatchScore ¶
SetMinMatchScore sets the minimum similarity score for fuzzy matching
type ProviderMapping ¶
type ProviderMapping struct {
AniListID int
ProviderName string
ProviderMediaID string
Media *providers.Media // The actual media details from provider
IsNew bool // True if this is a new mapping
}
ProviderMapping represents a mapping result
type SearchResult ¶
type SearchResult struct {
ProviderName string
Match utils.MatchResult
}
SearchResult represents a provider search result with similarity score