Skip to content

Commit

Permalink
fix: #140 Device UUID is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
simulot committed Jan 30, 2024
1 parent 0d8a166 commit c6cf7da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release notes

## Release next

### fix: #140 Device UUID is not set
The option `-device-uuid VALUE` was not functional.

## Release 0.10.0

### fix: #135 feat: use the searchAssets API to workaround server's timeout
Expand Down
9 changes: 4 additions & 5 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,16 +80,12 @@ type Application struct {
func Run(ctx context.Context, log *logger.Log) (*logger.Log, error) {

var err error
deviceID, err := os.Hostname()
if err != nil {
return log, err
}

app := Application{}
flag.StringVar(&app.Server, "server", "", "Immich server address (http://<your-ip>:2283 or https://<your-domain>)")
flag.StringVar(&app.API, "api", "", "Immich api endpoint (http://container_ip:3301)")
flag.StringVar(&app.Key, "key", "", "API Key")
flag.StringVar(&app.DeviceUUID, "device-uuid", deviceID, "Set a device UUID")
flag.StringVar(&app.DeviceUUID, "device-uuid", "", "Set a device UUID")
flag.BoolFunc("no-colors-log", "Disable colors on logs", myflag.BoolFlagFn(&app.NoLogColors, runtime.GOOS == "windows"))
flag.StringVar(&app.LogLevel, "log-level", "ok", "Log level (Error|Warning|OK|Info), default OK")
flag.StringVar(&app.LogFile, "log-file", "", "Write log messages into the file")
Expand Down Expand Up @@ -154,6 +150,9 @@ func Run(ctx context.Context, log *logger.Log) (*logger.Log, error) {
if app.ApiTrace {
app.Immich.EnableAppTrace(true)
}
if app.DeviceUUID != "" {
app.Immich.SetDeviceUUID(app.DeviceUUID)
}

err = app.Immich.PingServer(ctx)
if err != nil {
Expand Down

0 comments on commit c6cf7da

Please sign in to comment.