added deviceID as an arg

This commit is contained in:
Niklas Kapelle 2025-10-29 12:51:51 +01:00
parent dd01f3b3b6
commit d8a97c1257
Signed by: niklas
GPG Key ID: 4EB651B36D841D16
2 changed files with 4 additions and 1 deletions

View File

@ -11,6 +11,7 @@ type args struct {
BaseURL string `arg:"--base-url,required,env:BASE_URL" placeholder:"https://demo.immich.app"`
APIKey string `arg:"--api-key,required,env:API_KEY" placeholder:"API_KEY"`
UserdataDir string `arg:"--steam-userdata-dir,env:USERDATA_DIR" default:"$HOME/.var/app/com.valvesoftware.Steam/.local/share/Steam/userdata"`
DeviceID string `arg:"--device-id,env:DEVICE_ID" default:"steam-immich"`
}
func main() {
@ -21,5 +22,6 @@ func main() {
APIKey: args.APIKey,
BaseURL: args.BaseURL,
UserdataDir: os.ExpandEnv(args.UserdataDir),
DeiveID: args.DeviceID,
})
}

View File

@ -9,6 +9,7 @@ type Config struct {
BaseURL string
APIKey string
UserdataDir string
DeiveID string
}
func Run(config Config) {
@ -35,7 +36,7 @@ func Run(config Config) {
for _, f := range files {
fmt.Printf(" %s\n", f)
res, err := uploadToImmich(f, appid, config.BaseURL, config.APIKey, "steam-screenshot-test")
res, err := uploadToImmich(f, appid, config.BaseURL, config.APIKey, config.DeiveID)
if err != nil {
fmt.Printf("Failed to upload to immich: %s", err)