diff --git a/anilist/anilist.go b/anilist/anilist.go index 84023f3..92cf872 100644 --- a/anilist/anilist.go +++ b/anilist/anilist.go @@ -12,8 +12,6 @@ import ( "github.com/pkg/errors" ) -//TODO Anilist support - const ApiEndpoint = "https://graphql.anilist.co" const ALDomain = "https://anilist.co" diff --git a/config.go b/config.go index 5bd4386..6521a90 100644 --- a/config.go +++ b/config.go @@ -34,6 +34,22 @@ type Config struct { ALStatus anilist.MediaListStatus } +func NewConfig() *Config { + return &Config{ + Websites: make(map[int]string), + + MaxVisibleEntries: 20, + StatusAutoUpdateMode: Off, + Sorting: ByLastUpdated, + + TorrentClientPath: "qbittorrent", + + Status: mal.All, + + ALStatus: anilist.Current, + } +} + type StatusAutoUpdateMode byte const ( @@ -72,19 +88,7 @@ func ParseSorting(sort string) (Sorting, error) { } func LoadConfig() (c *Config) { - c = &Config{ - Websites: make(map[int]string), - - MaxVisibleEntries: 20, - StatusAutoUpdateMode: Off, - Sorting: ByLastUpdated, - - TorrentClientPath: "qbittorrent", - - Status: mal.All, - - ALStatus: anilist.Current, - } + c = NewConfig() f, err := os.Open(MalConfigFile) defer f.Close() diff --git a/main.go b/main.go index 423a5c4..db0b2ce 100644 --- a/main.go +++ b/main.go @@ -37,7 +37,7 @@ type AppConfig struct { func main() { checkDataDir() - appCfg := AppConfig{} + appCfg := AppConfig{Mode: AniListMode} LoadJsonFile(AppConfigFile, &appCfg) app := cli.NewApp()