device

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2020 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Kobo

type Kobo struct {
	Device kobo.Device

	KuConfig        *KuOptions
	DBRootDir       string
	BKRootDir       string
	ContentIDprefix cidPrefix

	MetadataMap     map[string]uc.CalibreBookMeta
	UpdatedMetadata []string
	BooksInDB       map[string]struct{}
	Passwords       *uncagedPassword
	DriveInfo       uc.DeviceInfo

	Wg *sync.WaitGroup
	// contains filtered or unexported fields
}

Kobo contains the variables and methods required to use the UNCaGED library

func New

func New(dbRootDir, sdRootDir string, updatingMD bool, opts *KuOptions, vers string) (*Kobo, error)

New creates a Kobo object, ready for use

func (*Kobo) Close

func (k *Kobo) Close()

Close the kobo object when we're finished with it

func (*Kobo) GetDeviceOptions

func (k *Kobo) GetDeviceOptions() (ext []string, model string, thumbSz image.Point)

GetDeviceOptions gets some device options that UNCaGED requires

func (*Kobo) SaveCoverImage

func (k *Kobo) SaveCoverImage(contentID string, size image.Point, imgB64 string)

SaveCoverImage generates cover image and thumbnails, and save to appropriate locations

func (*Kobo) SaveDeviceInfo

func (k *Kobo) SaveDeviceInfo() error

SaveDeviceInfo save device info to file

func (*Kobo) UpdateIfExists

func (k *Kobo) UpdateIfExists(cID string, len int) error

UpdateIfExists updates onboard metadata if it exists in the Nickel database

func (*Kobo) UpdateNickelDB

func (k *Kobo) UpdateNickelDB() error

UpdateNickelDB updates the Nickel database with updated metadata obtained from a previous run, or this run if updating via triggers

func (*Kobo) WriteMDfile

func (k *Kobo) WriteMDfile() error

WriteMDfile writes metadata to file

func (*Kobo) WriteUpdateMDfile

func (k *Kobo) WriteUpdateMDfile() error

WriteUpdateMDfile writes updated metadata to file

type KuOptions

type KuOptions struct {
	PreferSDCard         bool
	PreferKepub          bool
	PasswordList         []string
	EnableDebug          bool
	AddMetadataByTrigger bool
	Thumbnail            thumbnailOption
}

KuOptions contains some options that are required

type MetaIterator added in v0.4.0

type MetaIterator struct {
	// contains filtered or unexported fields
}

MetaIterator Kobo UNCaGED to lazy load book metadata

func NewMetaIter added in v0.4.0

func NewMetaIter(k *Kobo) *MetaIterator

NewMetaIter creates a new MetaIterator for use

func (*MetaIterator) Add added in v0.4.0

func (m *MetaIterator) Add(cid string)

Add a client ID to the iterator

func (*MetaIterator) Count added in v0.4.0

func (m *MetaIterator) Count() int

Count gets the number items in the iterator

func (*MetaIterator) Get added in v0.4.0

func (m *MetaIterator) Get() (uc.CalibreBookMeta, error)

Get the metadata of the current iteration

func (*MetaIterator) Next added in v0.4.0

func (m *MetaIterator) Next() bool

Next advances the iterator

Jump to

Keyboard shortcuts

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