app

package
v0.0.0-...-b787aad Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

View Source
const (
	None = iota
	PixivArtworkTypeIllustAndUgoira
	PixivArtworkTypeManga
	PixivArtworkTypeAll

	PixivRatingModeR18
	PixivRatingModeSafe
	PixivRatingModeAll

	PixivSearchModeTag
	PixivSearchModeTagFull
	PixivSearchModeTC

	PixivSortOrderDate
	PixivSortOrderDateDesc
	PixivSortOrderPopular
	PixivSortOrderPopularDesc
	PixivSortOrderPopularMale
	PixivSortOrderPopularMaleDesc
	PixivSortOrderPopularFemale
	PixivSortOrderPopularFemaleDesc

	PixivUgoiraOutputFormatGif
	PixivUgoiraOutputFormatApng
	PixivUgoiraOutputFormatWebp
	PixivUgoiraOutputFormatWebm
	PixivUgoiraOutputFormatMp4

	PixivAiSearchAllow
	PixivAiSearchFilter

	UnknownValue = "Unknown"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type App

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

App struct

func NewApp

func NewApp() *App

func (*App) CancelGDriveOauth

func (a *App) CancelGDriveOauth()

func (*App) CancelQueue

func (a *App) CancelQueue(id int)

func (*App) ChangeMasterPassword

func (a *App) ChangeMasterPassword(oldPassword, newPassword string) error

func (*App) CheckForUpdates

func (a *App) CheckForUpdates() (bool, error)

func (*App) CheckMasterPassword

func (a *App) CheckMasterPassword(password string) bool

func (*App) DeleteAllGdriveCache

func (a *App) DeleteAllGdriveCache() error

func (*App) DeleteAllKemonoCreatorCache

func (a *App) DeleteAllKemonoCreatorCache() error

func (*App) DeleteAllPostCache

func (a *App) DeleteAllPostCache() error

func (*App) DeleteAllUgoiraCache

func (a *App) DeleteAllUgoiraCache() error

func (*App) DeleteCacheKey

func (a *App) DeleteCacheKey(bucket, cacheKey string) error

func (*App) DeleteProfilePic

func (a *App) DeleteProfilePic() error

func (*App) DeleteQueue

func (a *App) DeleteQueue(id int)

func (*App) GetAllGdriveCache

func (a *App) GetAllGdriveCache() []*FrontendCacheKeyValue

func (*App) GetAllKemonoCreatorCache

func (a *App) GetAllKemonoCreatorCache() []*FrontendCacheKeyValue

func (*App) GetAllUgoiraCache

func (a *App) GetAllUgoiraCache() []*FrontendCacheKeyValue

func (*App) GetDarkMode

func (a *App) GetDarkMode() bool

func (*App) GetDownloadDir

func (a *App) GetDownloadDir() (string, error)

func (*App) GetDownloadQueues

func (a *App) GetDownloadQueues() []FrontendDownloadQueue

func (*App) GetFfmpegPath

func (a *App) GetFfmpegPath() string

func (*App) GetFrontendDownloadDetails

func (a *App) GetFrontendDownloadDetails(id int) []*FrontendDownloadDetails

func (*App) GetGDriveAPIKey

func (a *App) GetGDriveAPIKey() string

func (*App) GetGDriveClientAndOauthToken

func (a *App) GetGDriveClientAndOauthToken() GetGDriveOauthResponse

func (*App) GetGDriveServiceAccount

func (a *App) GetGDriveServiceAccount() string

func (*App) GetGdriveClient

func (a *App) GetGdriveClient() *gdrive.GDrive

func (*App) GetLanguage

func (a *App) GetLanguage() string

func (*App) GetPixivRefreshToken

func (a *App) GetPixivRefreshToken() string

func (*App) GetPostCache

func (a *App) GetPostCache(filter Filter) []*database.PostCache

func (*App) GetPreferences

func (a *App) GetPreferences() *Preferences

func (*App) GetProfilePic

func (a *App) GetProfilePic() (ProfilePic, error)

func (*App) GetProgramInfo

func (a *App) GetProgramInfo() ProgramInfo

func (*App) GetSessionValue

func (a *App) GetSessionValue(website string) (string, error)

func (*App) GetUserAgent

func (a *App) GetUserAgent() UserAgentResponse

func (*App) GetUsername

func (a *App) GetUsername() string

func (*App) HasProfilePic

func (a *App) HasProfilePic() bool

func (*App) PromptMasterPassword

func (a *App) PromptMasterPassword() bool

func (*App) RemoveMasterPassword

func (a *App) RemoveMasterPassword() error

func (*App) ResetSession

func (a *App) ResetSession(website string) error

func (*App) SelectDlDirPath

func (a *App) SelectDlDirPath() error

func (*App) SelectFfmpegPath

func (a *App) SelectFfmpegPath() error

func (*App) SelectGDriveServiceAccount

func (a *App) SelectGDriveServiceAccount() error

func (*App) SelectProfilePic

func (a *App) SelectProfilePic() (ProfilePic, error)

func (*App) SetDarkMode

func (a *App) SetDarkMode(darkMode bool)

func (*App) SetDlDirPath

func (a *App) SetDlDirPath(dirPath string) error

func (*App) SetFantiaPreferences

func (a *App) SetFantiaPreferences(p *FantiaPreferences) error

func (*App) SetFfmpegPath

func (a *App) SetFfmpegPath(ffmpegPath string) error

func (*App) SetGDriveAPIKey

func (a *App) SetGDriveAPIKey(apiKey string) error

func (*App) SetGeneralPreferences

func (a *App) SetGeneralPreferences(p *GeneralPreferences) error

func (*App) SetLanguage

func (a *App) SetLanguage(lang string) string

func (*App) SetMasterPassword

func (a *App) SetMasterPassword(password string) error

func (*App) SetPixivOAuthRefreshToken

func (a *App) SetPixivOAuthRefreshToken(refreshToken string) error

func (*App) SetPixivPreferences

func (a *App) SetPixivPreferences(p *PixivPreferences) error

func (*App) SetSessionValue

func (a *App) SetSessionValue(website, session string) error

func (*App) SetUserAgent

func (a *App) SetUserAgent(userAgent string) error

func (*App) SetUsername

func (a *App) SetUsername(username string)

func (*App) Shutdown

func (a *App) Shutdown(ctx context.Context)

func (*App) StartGDriveOauth

func (a *App) StartGDriveOauth() error

func (*App) StartPixivOAuth

func (a *App) StartPixivOAuth() string

func (*App) Startup

func (a *App) Startup(ctx context.Context)

startup is called when the app starts. The context is saved so we can call the runtime methods

func (*App) SubmitFantiaToQueue

func (a *App) SubmitFantiaToQueue(inputs []string, prefs *Preferences) error

func (*App) SubmitKemonoToQueue

func (a *App) SubmitKemonoToQueue(inputs []string, prefs *Preferences) error

func (*App) SubmitPixivFanboxToQueue

func (a *App) SubmitPixivFanboxToQueue(inputs []string, prefs *Preferences) error

func (*App) SubmitPixivToQueue

func (a *App) SubmitPixivToQueue(inputs []string, prefs *Preferences) error

func (*App) Translate

func (a *App) Translate(textKey, fallback, lang string) string

func (*App) UnsetGDriveJson

func (a *App) UnsetGDriveJson() error

func (*App) UploadCookieFile

func (a *App) UploadCookieFile(website string) error

func (*App) UploadProfilePic

func (a *App) UploadProfilePic(picPath string) error

func (*App) ValidateFantiaUrls

func (a *App) ValidateFantiaUrls(inputs []string) bool

returns true if it's valid, false otherwise.

func (*App) ValidateGDriveOauth

func (a *App) ValidateGDriveOauth() error

func (*App) ValidateKemonoInputs

func (a *App) ValidateKemonoInputs(inputs []string) bool

returns true if it's valid, false otherwise.

func (*App) ValidatePixivFanboxUrls

func (a *App) ValidatePixivFanboxUrls(inputs []string) bool

returns true if it's valid, false otherwise.

func (*App) ValidatePixivInputs

func (a *App) ValidatePixivInputs(inputs []string) bool

returns true if it's valid, false otherwise.

func (*App) VerifyPixivOAuthCode

func (a *App) VerifyPixivOAuthCode(code string) error

type DownloadQueue

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

func (*DownloadQueue) CancelQueue

func (q *DownloadQueue) CancelQueue()

func (*DownloadQueue) GetErrSlice

func (q *DownloadQueue) GetErrSlice() []error

func (*DownloadQueue) GetStatus

func (q *DownloadQueue) GetStatus() (active bool, finished bool)

func (*DownloadQueue) SetFinished

func (q *DownloadQueue) SetFinished(finished bool)

func (*DownloadQueue) Start

func (q *DownloadQueue) Start()

func (*DownloadQueue) UpdateErrSlice

func (q *DownloadQueue) UpdateErrSlice(errSlice []error)

type FantiaPreferences

type FantiaPreferences struct {
	OrganisePostImages bool `json:"OrganisePostImages"`
}

type Filter

type Filter struct {
	Fantia      bool `json:"Fantia"`
	Pixiv       bool `json:"Pixiv"`
	PixivFanbox bool `json:"PixivFanbox"`
	Kemono      bool `json:"Kemono"`
}

type FrontendCacheKeyValue

type FrontendCacheKeyValue struct {
	Key      string    `json:"Key"`
	Value    string    `json:"Value"`
	DateTime time.Time `json:"DateTime"`
	Bucket   string    `json:"Bucket"`
}

type FrontendDownloadDetails

type FrontendDownloadDetails struct {
	Msg           string  `json:"Msg"`
	SuccessMsg    string  `json:"SuccessMsg"`
	ErrMsg        string  `json:"ErrMsg"`
	Finished      bool    `json:"Finished"`
	HasError      bool    `json:"HasError"`
	FileSize      string  `json:"FileSize"`
	Filename      string  `json:"Filename"`
	DownloadSpeed float64 `json:"DownloadSpeed"`
	DownloadETA   float64 `json:"DownloadETA"`
	Percentage    int     `json:"Percentage"`
}

type FrontendDownloadQueue

type FrontendDownloadQueue struct {
	Id                int                  `json:"Id"`
	Website           string               `json:"Website"`
	Msg               string               `json:"Msg"`
	SuccessMsg        string               `json:"SuccessMsg"`
	ErrMsg            string               `json:"ErrMsg"`
	ErrSlice          []string             `json:"ErrSlice"`
	HasError          bool                 `json:"HasError"`
	Inputs            []Input              `json:"Inputs"`
	ProgressBar       ProgressBar          `json:"ProgressBar"`
	NestedProgressBar []*NestedProgressBar `json:"NestedProgressBar"`
	Finished          bool                 `json:"Finished"`
}

type GeneralPreferences

type GeneralPreferences struct {
	DlPostThumbnail   bool `json:"DlPostThumbnail"`
	DlPostImages      bool `json:"DlPostImages"`
	DlPostAttachments bool `json:"DlPostAttachments"`
	OverwriteFiles    bool `json:"OverwriteFiles"`

	DlGDrive         bool `json:"DlGDrive"`
	DetectOtherLinks bool `json:"DetectOtherLinks"`
	UseCacheDb       bool `json:"UseCacheDb"`
}

type GetGDriveOauthResponse

type GetGDriveOauthResponse struct {
	ClientJson string
	TokenJson  string
}

type Input

type Input struct {
	Input string `json:"Input"`
	Url   string `json:"Url"`
}

type Messages

type Messages struct {
	Msg        string
	SuccessMsg string
	ErrMsg     string
}

type NestedProgressBar

type NestedProgressBar struct {
	Msg        string `json:"Msg"`
	SuccessMsg string `json:"SuccessMsg"`
	ErrMsg     string `json:"ErrMsg"`

	IsSpinner bool `json:"IsSpinner"`

	Count      int       `json:"Count"`
	HasError   bool      `json:"HasError"`
	Percentage int       `json:"Percentage"`
	DateTime   time.Time `json:"DateTime"`
}

type PixivPreferences

type PixivPreferences struct {
	ArtworkType        int  `json:"ArtworkType"`
	DeleteUgoiraZip    bool `json:"DeleteUgoiraZip"`
	RatingMode         int  `json:"RatingMode"`
	SearchMode         int  `json:"SearchMode"`
	AiSearchMode       int  `json:"AiSearchMode"`
	SortOrder          int  `json:"SortOrder"`
	UgoiraOutputFormat int  `json:"UgoiraOutputFormat"`
	UgoiraQuality      int  `json:"UgoiraQuality"`
}

type Preferences

type Preferences struct {
	DlPostThumbnail   bool `json:"DlPostThumbnail"`
	DlPostImages      bool `json:"DlPostImages"`
	DlPostAttachments bool `json:"DlPostAttachments"`
	OverwriteFiles    bool `json:"OverwriteFiles"`

	DlGDrive         bool `json:"DlGDrive"`
	DetectOtherLinks bool `json:"DetectOtherLinks"`
	UseCacheDb       bool `json:"UseCacheDb"`

	// Fantia
	OrganisePostImages bool `json:"OrganisePostImages"`

	// Pixiv
	ArtworkType        int  `json:"ArtworkType"`
	DeleteUgoiraZip    bool `json:"DeleteUgoiraZip"`
	RatingMode         int  `json:"RatingMode"`
	SearchMode         int  `json:"SearchMode"`
	AiSearchMode       int  `json:"AiSearchMode"`
	SortOrder          int  `json:"SortOrder"`
	UgoiraOutputFormat int  `json:"UgoiraOutputFormat"`
	UgoiraQuality      int  `json:"UgoiraQuality"`
}

type ProfilePic

type ProfilePic struct {
	Path     string `json:"Path"`
	Type     string `json:"Type"`
	Filename string `json:"Filename"`
	Data     string `json:"Data"`
}

func NewProfilePic

func NewProfilePic(path string) (ProfilePic, error)

type ProgramInfo

type ProgramInfo struct {
	ProgramVer string `json:"ProgramVer"`
	BackendVer string `json:"BackendVer"`
}

type ProgressBar

type ProgressBar struct {

	// For the frontend
	IsSpinner  bool      `json:"IsSpinner"`
	Count      int       `json:"Count"`
	MaxCount   int       `json:"MaxCount"`
	Active     bool      `json:"Active"`
	Finished   bool      `json:"Finished"`
	HasError   bool      `json:"HasError"`
	Percentage int       `json:"Percentage"`
	FolderPath string    `json:"FolderPath"`
	DateTime   time.Time `json:"DateTime"`

	// download progress bars for more detailed information
	DownloadProgressBars []*progress.DownloadProgressBar
	// contains filtered or unexported fields
}

func NewProgressBar

func NewProgressBar(ctx context.Context) *ProgressBar

func (*ProgressBar) Add

func (p *ProgressBar) Add(i int)

func (*ProgressBar) GetBaseMsg

func (p *ProgressBar) GetBaseMsg() string

func (*ProgressBar) GetErrorMsg

func (p *ProgressBar) GetErrorMsg() string

func (*ProgressBar) GetIsProgBar

func (p *ProgressBar) GetIsProgBar() bool

func (*ProgressBar) GetIsSpinner

func (p *ProgressBar) GetIsSpinner() bool

func (*ProgressBar) GetSuccessMsg

func (p *ProgressBar) GetSuccessMsg() string

func (*ProgressBar) Increment

func (p *ProgressBar) Increment()

func (*ProgressBar) MakeLatestSnapshotMain

func (p *ProgressBar) MakeLatestSnapshotMain()

func (*ProgressBar) SetToProgressBar

func (p *ProgressBar) SetToProgressBar()

func (*ProgressBar) SetToSpinner

func (p *ProgressBar) SetToSpinner()

func (*ProgressBar) SnapshotTask

func (p *ProgressBar) SnapshotTask()

func (*ProgressBar) Start

func (p *ProgressBar) Start()

func (*ProgressBar) Stop

func (p *ProgressBar) Stop(hasErr bool)

func (*ProgressBar) StopInterrupt

func (p *ProgressBar) StopInterrupt(errMsg string)

func (*ProgressBar) UpdateBaseMsg

func (p *ProgressBar) UpdateBaseMsg(msg string)

func (*ProgressBar) UpdateErrorMsg

func (p *ProgressBar) UpdateErrorMsg(errMsg string)

func (*ProgressBar) UpdateFolderPath

func (p *ProgressBar) UpdateFolderPath(folderPath string)

func (*ProgressBar) UpdateMax

func (p *ProgressBar) UpdateMax(max int)

func (*ProgressBar) UpdateSuccessMsg

func (p *ProgressBar) UpdateSuccessMsg(successMsg string)

type UserAgentResponse

type UserAgentResponse struct {
	UserAgent string
	IsDefault bool
}

Jump to

Keyboard shortcuts

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