calibre

package
v0.0.0-...-6573677 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2022 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Calibre

type Calibre struct {
	Library  string // Path to the Calibre library
	Settings string // Path to the settings directory

	// RunShim is used to mock running actual executables.  This should not be
	// used normally.
	RunShim func(cmd *exec.Cmd) ([]byte, error)
}

func (*Calibre) FindPaths

func (c *Calibre) FindPaths(ctx context.Context) error

FindPaths attempts to auto-detect the Settings path and the Library path, if either were not specified.

func (*Calibre) GetBooks

func (c *Calibre) GetBooks(ctx context.Context) ([]model.CalibreBook, error)

func (*Calibre) Run

func (c *Calibre) Run(ctx context.Context, command string, args ...string) (string, error)

Run the given command with arguments, capturing stdout.

func (*Calibre) UpdateBook

func (c *Calibre) UpdateBook(ctx context.Context, id int, meta UpdateMeta, bookPath string) error

type UpdateMeta

type UpdateMeta struct {
	Authors   []string  `calibre:"authors"`
	Comments  string    `calibre:"comments"`
	Published time.Time `calibre:"pubdate"`
	Publisher string    `calibre:"publisher"`
	Series    string    `calibre:"series"`
	Timestamp time.Time `calibre:"timestamp"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL