Skip to content

Commit

Permalink
fix: Fixing empty tag
Browse files Browse the repository at this point in the history
Signed-off-by: Vincent Boutour <[email protected]>
  • Loading branch information
ViBiOh committed Jan 18, 2023
1 parent d06125c commit 37fd03a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ This is for local purpose with simple and hassle-free sharing in a private netwo
go install github.com/ViBiOh/fibr/cmd/fibr@latest
fibr \
-noAuth \
-storageDirectory "$(pwd)" \
-storageFileSystemDirectory "$(pwd)" \
-thumbnailURL "" \
-exifURL ""
```
Expand Down
8 changes: 7 additions & 1 deletion pkg/crud/rename.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,13 @@ func (a App) Rename(w http.ResponseWriter, r *http.Request, request provider.Req
}
}

if _, err = a.metadataApp.Update(ctx, newItem, provider.ReplaceTags(strings.Split(r.Form.Get("tags"), " "))); err != nil {
var tags []string

if rawTags := r.Form.Get("tags"); len(rawTags) > 0 {
tags = strings.Split(rawTags, " ")
}

if _, err = a.metadataApp.Update(ctx, newItem, provider.ReplaceTags(tags)); err != nil {
a.error(w, r, request, model.WrapInternal(err))
return
}
Expand Down

0 comments on commit 37fd03a

Please sign in to comment.