@@ -23,20 +23,21 @@ type Client struct {
23
23
APIKey string // API Key
24
24
AdminAPIKey string // API Key for admin
25
25
26
- APITrace bool // Enable API call traces
27
- SkipSSL bool // Skip SSL Verification
28
- ClientTimeout time.Duration // Set the client request timeout
29
- DeviceUUID string // Set a device UUID
30
- DryRun bool // Protect the server from changes
31
- TimeZone string // Override default TZ
32
- TZ * time.Location // Time zone to use
33
- APITraceWriter io.WriteCloser // API tracer
34
- APITraceWriterName string // API trace log name
35
- Immich immich.ImmichInterface // Immich client
36
- AdminImmich immich.ImmichInterface // Immich client for admin
37
- ClientLog * slog.Logger // Logger
38
- OnServerErrors cliflags.OnServerErrorsFlag // Behavior on server errors
39
- User immich.User // User info corresponding to the API key
26
+ APITrace bool // Enable API call traces
27
+ SkipSSL bool // Skip SSL Verification
28
+ ClientTimeout time.Duration // Set the client request timeout
29
+ DeviceUUID string // Set a device UUID
30
+ DryRun bool // Protect the server from changes
31
+ TimeZone string // Override default TZ
32
+ TZ * time.Location // Time zone to use
33
+ APITraceWriter io.WriteCloser // API tracer
34
+ APITraceWriterName string // API trace log name
35
+ Immich immich.ImmichInterface // Immich client
36
+ AdminImmich immich.ImmichInterface // Immich client for admin
37
+ ClientLog * slog.Logger // Logger
38
+ OnServerErrors cliflags.OnServerErrorsFlag // Behavior on server errors
39
+ User immich.User // User info corresponding to the API key
40
+ PauseImmichBackgroundJobs bool // Pause Immich background jobs
40
41
}
41
42
42
43
// add server flags to the command cmd
@@ -46,9 +47,10 @@ func AddClientFlags(ctx context.Context, cmd *cobra.Command, app *Application, d
46
47
47
48
cmd .PersistentFlags ().StringVarP (& client .Server , "server" , "s" , client .Server , "Immich server address (example http://your-ip:2283 or https://your-domain)" )
48
49
cmd .PersistentFlags ().StringVarP (& client .APIKey , "api-key" , "k" , "" , "API Key" )
49
- cmd .PersistentFlags ().StringVarP (& client .AdminAPIKey , "admin-api-key" , "a" , "" , "Admin's API Key for managing server's jobs" )
50
-
50
+ cmd .PersistentFlags ().StringVar (& client .AdminAPIKey , "admin-api-key" , "" , "Admin's API Key for managing server's jobs" )
51
51
cmd .PersistentFlags ().BoolVar (& client .APITrace , "api-trace" , false , "Enable trace of api calls" )
52
+
53
+ cmd .PersistentFlags ().BoolVar (& client .PauseImmichBackgroundJobs , "pause-immich-jobs" , true , "Pause Immich background jobs during upload operations" )
52
54
cmd .PersistentFlags ().BoolVar (& client .SkipSSL , "skip-verify-ssl" , false , "Skip SSL verification" )
53
55
cmd .PersistentFlags ().DurationVar (& client .ClientTimeout , "client-timeout" , 20 * time .Minute , "Set server calls timeout" )
54
56
cmd .PersistentFlags ().StringVar (& client .DeviceUUID , "device-uuid" , client .DeviceUUID , "Set a device UUID" )
@@ -114,6 +116,7 @@ func OpenClient(ctx context.Context, cmd *cobra.Command, app *Application) error
114
116
return err
115
117
}
116
118
client .Immich .EnableAppTrace (client .APITraceWriter )
119
+ client .AdminImmich .EnableAppTrace (client .APITraceWriter )
117
120
}
118
121
app .log .Message ("Check the API-TRACE file: %s" , client .APITraceWriterName )
119
122
}
@@ -197,6 +200,7 @@ func (client *Client) Open(ctx context.Context) error {
197
200
return err
198
201
}
199
202
client .Immich .EnableAppTrace (client .APITraceWriter )
203
+ client .AdminImmich .EnableAppTrace (client .APITraceWriter )
200
204
}
201
205
}
202
206
0 commit comments