Documentation
¶
Index ¶
- Variables
- type App
- func (a *App) ExportCbzOnly(inputDir string, exportDir string, c *comicinfo.ComicInfo) (errMsg string)
- func (a *App) ExportCbzWithDefaultWrap(inputDir string, exportDir string, c *comicinfo.ComicInfo) (errMsg string)
- func (a *App) ExportCbzWithWrap(inputDir string, exportDir string, wrapFolder string, c *comicinfo.ComicInfo) (errMsg string)
- func (a *App) ExportXml(originalDir string, c *comicinfo.ComicInfo) (errorMsg string)
- func (a *App) GetAllGenreInput() HistoryResp
- func (a *App) GetAllPublisherInput() HistoryResp
- func (a *App) GetAllTagInput() HistoryResp
- func (a *App) GetComicFolder() string
- func (a *App) GetComicInfo(folder string) ComicInfoResponse
- func (a *App) GetDefaultOutputDirectory(inputDir string) string
- func (a *App) GetDirectory(dir string) DirectoryResp
- func (a *App) OpenFolder(path string)
- func (a *App) QuickExportKomga(inputDir string) string
- func (a *App) RunSoftDelete() (errMsg string)
- func (a *App) Startup(ctx context.Context)
- type ComicInfoResponse
- type DirectoryResp
- type HistoryResp
Constants ¶
This section is empty.
Variables ¶
var AllAgeRatingValue = []struct { Value comicinfo.AgeRating TSName string }{ {comicinfo.AgeRating_Unknown, "Unknown"}, {comicinfo.AgeRating_AdultsOnly18, "AdultsOnly18"}, {comicinfo.AgeRating_EarlyChildhood, "EarlyChildhood"}, {comicinfo.AgeRating_Everyone, "Everyone"}, {comicinfo.AgeRating_Everyone10Plus, "Everyone10Plus"}, {comicinfo.AgeRating_G, "G"}, {comicinfo.AgeRating_KidsToAdults, "KidsToAdults"}, {comicinfo.AgeRating_M, "M"}, {comicinfo.AgeRating_MA15Plus, "MA15Plus"}, {comicinfo.AgeRating_Mature17Plus, "Mature17Plus"}, {comicinfo.AgeRating_PG, "PG"}, {comicinfo.AgeRating_R18Plus, "R18Plus"}, {comicinfo.AgeRating_RatingPending, "RatingPending"}, {comicinfo.AgeRating_Teen, "Teen"}, {comicinfo.AgeRating_X18Plus, "X18Plus"}, }
The value of `AgeRating` const to use in wails binding.
var AllMangaValue = []struct { Value comicinfo.Manga TSName string }{ {comicinfo.Manga_Unknown, "Unknown"}, {comicinfo.Manga_No, "No"}, {comicinfo.Manga_Yes, "Yes"}, {comicinfo.Manga_YesAndRightToLeft, "YesAndRightToLeft"}, }
The value of `Manga` const to use in wails binding.
Functions ¶
This section is empty.
Types ¶
type App ¶
App struct
func NewApp ¶
func NewApp(cfg *config.ProgramConfig, db *lazydb.LazyDB) *App
Create a new app with specified config. This function is designed to run in production.
func NewAppWithDefaultConfig ¶ added in v0.9.0
Create a new app with default configuration. Suggested to use in testing only.
func (*App) ExportCbzOnly ¶
func (a *App) ExportCbzOnly(inputDir string, exportDir string, c *comicinfo.ComicInfo) (errMsg string)
Export the .cbz (contains images & comicInfo) file ONLY to destination.
If the process success, then function will output empty string. Otherwise, function will return the reason for error.
Both input directory and output directory MUST be absolute paths.
func (*App) ExportCbzWithDefaultWrap ¶
func (a *App) ExportCbzWithDefaultWrap(inputDir string, exportDir string, c *comicinfo.ComicInfo) (errMsg string)
Export the .cbz (contains images & comicInfo) file to destination, wrapped with folder name that same as .cbz base filename.
If the process success, then function will output empty string. Otherwise, function will return the reason for error.
Both input directory and output directory MUST be absolute paths.
func (*App) ExportCbzWithWrap ¶
func (a *App) ExportCbzWithWrap(inputDir string, exportDir string, wrapFolder string, c *comicinfo.ComicInfo) (errMsg string)
Export the .cbz (contains images & comicInfo) file to destination, wrapped with folder name specified by user.
If the process success, then function will output empty string. Otherwise, function will return the reason for error.
Both input directory and output directory MUST be absolute paths.
func (*App) ExportXml ¶
API for export comicinfo to original directory.
If the process success, then function will output empty string. Otherwise, function will return the reason for error.
func (*App) GetAllGenreInput ¶
func (a *App) GetAllGenreInput() HistoryResp
Get all user inputted genre from database.
func (*App) GetAllPublisherInput ¶
func (a *App) GetAllPublisherInput() HistoryResp
Get all user inputted publisher from database.
func (*App) GetAllTagInput ¶
func (a *App) GetAllTagInput() HistoryResp
Get all user inputted tag from database.
func (*App) GetComicFolder ¶
Attempt to load default comic folder. If config is not set, then return a empty string instead.
func (*App) GetComicInfo ¶
func (a *App) GetComicInfo(folder string) ComicInfoResponse
Get the comic info by scan the given folder. This function will not create/modify the comicinfo xml.
This function will return a comicInfo struct, with error message in string.
func (*App) GetDefaultOutputDirectory ¶
Attempt to load default output directory. If no default directory is set, then return input directory instead.
func (*App) GetDirectory ¶
func (a *App) GetDirectory(dir string) DirectoryResp
Open directory dialog for wails, allow user to select one directory.
If given directory is empty, then default directory will be handled by wails. Otherwise, it will open given directory.
If any error occur, the error message will be also returned in 2nd argument. Empty string indicate no error occur.
func (*App) OpenFolder ¶
Open folder in window explorer.
If current os is not window, then this function will show error dialog instead of open folder.
func (*App) QuickExportKomga ¶
Perform Quick Export Action, where ComicInfo.xml file can not be modified before archived. The input directory MUST be absolute path.
If error is occur, then return a string containing the error message. Otherwise, return empty string.
This function will perform these task:
- Scan the directory and create a ComicInfo.xml file
- Archive the directory and xml file as .cbz file
- Wrap the .cbz file with a folder to copy to komga
This function is specific designed for komga folder structure.
func (*App) RunSoftDelete ¶
Run soft delet process, which will move the last exported comic folder to trash bin in config file.
This function only effect when one export function is run successfully. If trash bin is not defined, then error will be returned.
type ComicInfoResponse ¶
type DirectoryResp ¶
Response for get directory method. Designed due to wails API only allow single return.
type HistoryResp ¶
Struct that designed for send last input record from history module to frontend.