Skip to content

Commit

Permalink
report upload error
Browse files Browse the repository at this point in the history
  • Loading branch information
simulot committed Jun 1, 2024
1 parent 8b0b2aa commit 088a117
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions cmd/upload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ func (app *UpCmd) runNoUI(ctx context.Context) error {
counts[fileevent.Uploaded] +
counts[fileevent.AnalysisLocalDuplicate]) / ScannedAssets)
}
s = fmt.Sprintf("\rImmich read %d%%, Google Photos Analysis: %d%%, Uploaded %d%% %s", immichPct, gpPct, upPct, string(spinner[spinIdx]))
s = fmt.Sprintf("\rImmich read %d%%, Google Photos Analysis: %d%%, Upload errors: %d, Uploaded %d%% %s", immichPct, gpPct, counts[fileevent.UploadServerError], upPct, string(spinner[spinIdx]))
} else {
s = fmt.Sprintf("\rImmich read %d%%, Processed %d, Uploaded %d %s", immichPct, ProcessedAssets, counts[fileevent.Uploaded], string(spinner[spinIdx]))
s = fmt.Sprintf("\rImmich read %d%%, Processed %d, Upload errors: %d, Uploaded %d %s", immichPct, ProcessedAssets, counts[fileevent.UploadServerError], counts[fileevent.Uploaded], string(spinner[spinIdx]))
}
spinIdx++
if spinIdx == len(spinner) {
Expand Down Expand Up @@ -605,6 +605,7 @@ func (app *UpCmd) handleAsset(ctx context.Context, a *browser.LocalAssetFile) er
}

if err != nil {
app.Jnl.Record(ctx, fileevent.UploadServerError, a, a.FileName, "error", err.Error())
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion helpers/fileevent/fileevents.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ var _code = map[Code]string{
UploadServerDuplicate: "server has same asset",
UploadServerBetter: "server has a better asset",
UploadAlbumCreated: "album created/updated",
UploadServerError: "server error",
UploadServerError: "upload error",
Uploaded: "uploaded",

Error: "error",
Expand Down

0 comments on commit 088a117

Please sign in to comment.