Skip to content

Commit

Permalink
Merge branch 'main' into #135-feat--use-the-searchAssets-API-to-worka…
Browse files Browse the repository at this point in the history
…roud-server's-timeout
  • Loading branch information
simulot committed Jan 28, 2024
2 parents a51e022 + 13e6ba4 commit 0d8a166
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
17 changes: 17 additions & 0 deletions browser/files/localassets.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"io/fs"
"path"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -180,6 +181,7 @@ func (la *LocalAssetBrowser) checkSidecar(fsys fs.FS, f *browser.LocalAssetFile,
}

func baseNames(n string) []string {
n = escapeName(n)
names := []string{n}
ext := path.Ext(n)
for {
Expand All @@ -196,6 +198,21 @@ func baseNames(n string) []string {
ext = path.Ext(n)
}
}
func escapeName(n string) string {
b := strings.Builder{}
for _, c := range n {
switch c {
case '*', '?', '[', ']', '^':
b.WriteRune('\\')
case '\\':
if runtime.GOOS != "windows" {
b.WriteRune('\\')
}
}
b.WriteRune(c)
}
return b.String()
}

func (la *LocalAssetBrowser) addAlbum(dir string) {
base := path.Base(dir)
Expand Down
12 changes: 10 additions & 2 deletions docs/releases.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Release notes

## Release
## Release 0.10.0

### fix: #135 feat: use the searchAssets API to workaround server's timeout

immich-go calls the endpoint `searchAssets` that provides a pagination system.
This will avoid any timeout at the start of immich-go.
This will avoid timeouts at the start of immich-go whit a busy server.


## Release 0.9.12

### fix: #131 panic syntax error in pattern

Some file names trigger a panic when checking the existence of XMP file



## Release 0.9.11
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ immich-go -server URL -key KEY -general_options COMMAND -command_options... {fil

`-server URL` URL of the Immich service, example http://<your-ip>:2283 or https://your-domain<br>
`-api URL` URL of the Immich api endpoint (http://container_ip:3301)<br>
`-device-uuid VALUE` Force the device identification (default $HOSTNAME).<br>
`-skip-verify-ssl <bool>` Skip SSL verification for use with self-signed certificates (default: false)

`-key KEY` A key generated by the user. Uploaded photos will belong to the key's owner.<br>
Expand All @@ -62,7 +63,6 @@ Use this command for uploading photos and videos from a local directory, a zippe

### Switches and options:
`-album "ALBUM NAME"` Import assets into the Immich album `ALBUM NAME`.<br>
`-device-uuid VALUE` Force the device identification (default $HOSTNAME).<br>
`-dry-run` Preview all actions as they would be done.<br>
`-create-album-folder <bool>` Generate immich albums after folder names (default FALSE).<br>
`-force-sidecar <bool>` Force sending a .xmp sidecar file beside images. With Google photos date and GPS coordinates are taken from metadata.json files. (default: FALSE).<br>
Expand Down

0 comments on commit 0d8a166

Please sign in to comment.