Skip to content

Commit

Permalink
Anilist mode by default
Browse files Browse the repository at this point in the history
  • Loading branch information
aQaTL committed Sep 8, 2018
1 parent 067d761 commit 48261a4
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
2 changes: 0 additions & 2 deletions anilist/anilist.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import (
"github.com/pkg/errors"
)

//TODO Anilist support

const ApiEndpoint = "https://graphql.anilist.co"
const ALDomain = "https://anilist.co"

Expand Down
30 changes: 17 additions & 13 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type AppConfig struct {
func main() {
checkDataDir()

appCfg := AppConfig{}
appCfg := AppConfig{Mode: AniListMode}
LoadJsonFile(AppConfigFile, &appCfg)

app := cli.NewApp()
Expand Down

0 comments on commit 48261a4

Please sign in to comment.