Documentation
¶
Overview ¶
Package reading centralizes ebook format detection, safe virtual naming, and media-class predicates shared by frontends that expose books for reading (Vela /read and Jellyfin/Emby /Items/{id}/Download & /File).
Index ¶
- Variables
- func CanonicalFormat(raw string) (format, mimeType string, ok bool)
- func ContextReaderAt(ctx context.Context, r io.ReaderAt) io.ReaderAt
- func DetectFormat(media *frontend.KindMedia, title frontend.Title) (format, mimeType string, ok bool)
- func Filename(mediaName, fallbackTitle, format string) string
- func IsBookTitle(t frontend.Title) bool
- func TitleFormat(t frontend.Title) (format, mimeType string)
- func VirtualPath(t frontend.Title) (virtualPath, container, mimeType string)
Constants ¶
This section is empty.
Variables ¶
var AcceptPatterns = []string{"range", "download", "container", "release", "file"}
AcceptPatterns lists the kindstream retrieval patterns readable book endpoints can serve as byte-addressable streams.
var Formats = []string{"epub", "pdf", "cbz"}
Formats lists the canonical reading formats Ether serves to reader clients.
Functions ¶
func CanonicalFormat ¶
CanonicalFormat normalizes a format name, file extension, or MIME type into a supported reading format ("epub", "pdf", or "cbz") and canonical MIME type.
func ContextReaderAt ¶
ContextReaderAt binds a request context to a ReaderAt that supports core.ContextReaderAt so client disconnects cancel blocked upstream reads.
func DetectFormat ¶
func DetectFormat(media *frontend.KindMedia, title frontend.Title) (format, mimeType string, ok bool)
DetectFormat identifies the canonical reading format and MIME type from an opened KindMedia stream, falling back to title metadata and magic bytes.
func IsBookTitle ¶
IsBookTitle reports whether t represents a book/ebook item that must open via reading/download paths rather than A/V playback.
func TitleFormat ¶
TitleFormat returns the projected reading format and MIME type for a book title from its metadata, defaulting to EPUB when unspecified.
func VirtualPath ¶
VirtualPath builds a deterministic, O(1) virtual book path, container name, and MIME type for a book title without scanning any library.
Types ¶
This section is empty.