settings

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2019 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DisplayHistory

func DisplayHistory(cfg *Settings)

DisplayHistory simply load the settings and display the titles, providers, download path and last dowloaded chapter, and highlight mangas that have available new chapters

func IsSettingsExisting

func IsSettingsExisting() bool

IsSettingsExisting allows to check if the settings file already exists or no

func SearchLastChapter

func SearchLastChapter(settings Settings, manga string) (lastChapter int)

SearchLastChapter send the last chapter in the history for a manga, or 1 if no history exists yet

func WriteDefaultSettings

func WriteDefaultSettings()

WriteDefaultSettings write the default settings

func WriteSettings

func WriteSettings(settings Settings)

WriteSettings write a settings file. used to change the default config or add manga to history download

Types

type Config

type Config struct {
	OutputPath string `json:"outputPath"`
	Provider   string `json:"provider"`
}

Config only store the default configuration, like output path, provider and if we have to use directories to store mangas

type History

type History struct {
	Titles []Manga `json:"titles"`
}

History is the manga download history, so it's an array of all the mangas we are downloading

type Manga

type Manga struct {
	Title    string `json:"title"`
	Chapter  int    `json:"chapter"`
	Provider string `json:"provider"`
}

Manga keep the download history for every mangas that we are suscribing

type Settings

type Settings struct {
	Config  Config  `json:"config"`
	History History `json:"history"`
}

Settings is the structure that allowed to store the default configuration and the download history for all the mangas we are downloading

func ReadSettings

func ReadSettings() (settings Settings)

ReadSettings read the settings file

func UpdateHistory

func UpdateHistory(cfg Settings, manga string, chapter int, provider string) (newSettings Settings)

UpdateHistory register the last chapter downloaded for a manga, and the last provider used

Jump to

Keyboard shortcuts

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