added revalidate cache feature
This commit is contained in:
@@ -17,6 +17,7 @@ type args struct {
|
||||
DeviceID string `arg:"--device-id" default:"steam-immich" help:"Device ID of the uploads"`
|
||||
Album string `arg:"--album" help:"UUID of a album to upload to"`
|
||||
CacheFile string `arg:"--cache" default:"$XDG_CACHE_HOME/steam-immich.json" help:"Location of the cache file"`
|
||||
Revalidate bool `args:"--revalidate" default:"false" help:"Only revalidate and fix the cache"`
|
||||
}
|
||||
|
||||
func Run() {
|
||||
@@ -38,14 +39,20 @@ func Run() {
|
||||
// Disable timestamp in log
|
||||
log.SetFlags(0)
|
||||
|
||||
steamimmich.Run(steamimmich.Config{
|
||||
config := steamimmich.Config{
|
||||
APIKey: args.APIKey,
|
||||
BaseURL: args.BaseURL,
|
||||
UserdataDir: steamUserdataDir,
|
||||
DeiveID: args.DeviceID,
|
||||
Album: args.Album,
|
||||
CacheFile: os.ExpandEnv(args.CacheFile),
|
||||
})
|
||||
}
|
||||
|
||||
if args.Revalidate {
|
||||
steamimmich.Revalidate(config)
|
||||
} else {
|
||||
steamimmich.Run(config)
|
||||
}
|
||||
}
|
||||
|
||||
func findUserdataDir() string {
|
||||
|
||||
Reference in New Issue
Block a user