Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterRoutes ¶
func ShouldUpdateChapters ¶
func ShouldUpdateChapters(newChapters []mediafile.ParsedChapter, newSource string, existingSource *string, forceRefresh bool) bool
ShouldUpdateChapters determines if chapters should be updated based on priority rules. Returns true if the new chapters should replace existing ones.
Types ¶
type ChapterInput ¶
type ChapterInput struct {
Title string `json:"title"`
StartPage *int `json:"start_page"`
StartTimestampMs *int64 `json:"start_timestamp_ms"`
Href *string `json:"href"`
Children []ChapterInput `json:"children"`
}
ChapterInput represents a chapter in API requests.
type ReplaceChaptersPayload ¶
type ReplaceChaptersPayload struct {
Chapters []ChapterInput `json:"chapters"`
}
ReplaceChaptersPayload is the request body for replacing chapters.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func (*Service) DeleteChaptersForFile ¶
DeleteChaptersForFile deletes all chapters for a file.
func (*Service) ListChapters ¶
ListChapters retrieves all chapters for a file, building nested structure.
func (*Service) ReplaceChapters ¶
func (svc *Service) ReplaceChapters(ctx context.Context, fileID int, chapters []mediafile.ParsedChapter) error
ReplaceChapters deletes all existing chapters for a file and inserts new ones.
Click to show internal directories.
Click to hide internal directories.