mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
WTF-781 Todoist project ID conversion (#789)
* WTF-781 Switch Todoist IDs from `int` to `string` On platforms that convert an `int` to `int32`, like the Raspberry Pi, an `int` is not large enough to store Todoist project IDs. Using a `string` ensures this never becomes a problem. Fixes #781 Signed-off-by: Chris Cummer <chriscummer@me.com>
This commit is contained in:
@@ -14,7 +14,7 @@ type Project struct {
|
||||
err error
|
||||
}
|
||||
|
||||
func NewProject(id int) *Project {
|
||||
func NewProject(id uint) *Project {
|
||||
// Todoist seems to experience a lot of network issues on their side
|
||||
// If we can't connect, handle it with an empty project until we can
|
||||
project, err := todoist.GetProject(id)
|
||||
|
||||
@@ -18,7 +18,7 @@ type Settings struct {
|
||||
common *cfg.Common
|
||||
|
||||
apiKey string `help:"Your Todoist API key"`
|
||||
projects []int
|
||||
projects []uint
|
||||
}
|
||||
|
||||
// NewSettingsFromYAML creates a new settings instance from a YAML config block
|
||||
@@ -27,7 +27,7 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
||||
common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig),
|
||||
|
||||
apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_TODOIST_TOKEN"))),
|
||||
projects: utils.ToInts(ymlConfig.UList("projects")),
|
||||
projects: utils.IntsToUints(utils.ToInts(ymlConfig.UList("projects"))),
|
||||
}
|
||||
|
||||
return &settings
|
||||
|
||||
Reference in New Issue
Block a user