added revalidate cache feature

This commit is contained in:
2025-11-20 15:41:00 +01:00
parent ff2cb2335c
commit 34f55eccf0
4 changed files with 171 additions and 2 deletions

View File

@@ -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 {