Documentation
¶
Index ¶
- type Kobo
- func (k *Kobo) Close()
- func (k *Kobo) GetDeviceOptions() (ext []string, model string, thumbSz image.Point)
- func (k *Kobo) SaveCoverImage(contentID string, size image.Point, imgB64 string)
- func (k *Kobo) SaveDeviceInfo() error
- func (k *Kobo) UpdateIfExists(cID string, len int) error
- func (k *Kobo) UpdateNickelDB() error
- func (k *Kobo) WriteMDfile() error
- func (k *Kobo) WriteUpdateMDfile() error
- type KoboMetadata
- type KuOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Kobo ¶
type Kobo struct { Device koboDevice KuConfig *KuOptions DBRootDir string BKRootDir string ContentIDprefix cidPrefix MetadataMap map[string]KoboMetadata UpdatedMetadata []string 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 (*Kobo) GetDeviceOptions ¶
GetDeviceOptions gets some device options that UNCaGED requires
func (*Kobo) SaveCoverImage ¶
SaveCoverImage generates cover image and thumbnails, and save to appropriate locations
func (*Kobo) SaveDeviceInfo ¶
SaveDeviceInfo save device info to file
func (*Kobo) UpdateIfExists ¶
UpdateIfExists updates onboard metadata if it exists in the Nickel database
func (*Kobo) UpdateNickelDB ¶
UpdateNickelDB updates the Nickel database with updated metadata obtained from a previous run
func (*Kobo) WriteUpdateMDfile ¶
WriteUpdateMDfile writes updated metadata to file
type KoboMetadata ¶
type KoboMetadata struct { Authors []string `json:"authors" mapstructure:"authors"` Languages []string `json:"languages" mapstructure:"languages"` UserMetadata map[string]interface{} `json:"user_metadata" mapstructure:"user_metadata"` UserCategories map[string]interface{} `json:"user_categories" mapstructure:"user_categories"` Comments *string `json:"comments" mapstructure:"comments"` Tags []string `json:"tags" mapstructure:"tags"` Pubdate *string `json:"pubdate" mapstructure:"pubdate"` SeriesIndex *float64 `json:"series_index" mapstructure:"series_index"` Thumbnail []interface{} `json:"thumbnail" mapstructure:"thumbnail"` PublicationType *string `json:"publication_type" mapstructure:"publication_type"` Mime *string `json:"mime" mapstructure:"mime"` AuthorSort string `json:"author_sort" mapstructure:"author_sort"` Series *string `json:"series" mapstructure:"series"` Rights *string `json:"rights" mapstructure:"rights"` DbID interface{} `json:"db_id" mapstructure:"db_id"` Cover *string `json:"cover" mapstructure:"cover"` ApplicationID int `json:"application_id" mapstructure:"application_id"` BookProducer *string `json:"book_producer" mapstructure:"book_producer"` Size int `json:"size" mapstructure:"size"` AuthorSortMap map[string]string `json:"author_sort_map" mapstructure:"author_sort_map"` Rating *float64 `json:"rating" mapstructure:"rating"` Lpath string `json:"lpath" mapstructure:"lpath"` Publisher *string `json:"publisher" mapstructure:"publisher"` Timestamp *string `json:"timestamp" mapstructure:"timestamp"` LastModified *string `json:"last_modified" mapstructure:"last_modified"` UUID string `json:"uuid" mapstructure:"uuid"` TitleSort string `json:"title_sort" mapstructure:"title_sort"` AuthorLinkMap map[string]string `json:"author_link_map" mapstructure:"author_link_map"` Title string `json:"title" mapstructure:"title"` Identifiers map[string]string `json:"identifiers" mapstructure:"identifiers"` }
KoboMetadata contains the metadata for ebooks on kobo devices. It replicates the metadata available in the Kobo USBMS driver. Note, pointers are used where necessary to account for null JSON values
func CreateKoboMetadata ¶
func CreateKoboMetadata() KoboMetadata
CreateKoboMetadata creates the required nested maps