Skip to content

Commit ed31769

Browse files
authored
version 0.23 (#686)
* Remove commented-out code related to Google Photos analysis in upload command * Remove commented-out code related to Google Photos analysis in upload command * Merge branch 'next' into archive * Rename Adapter interface to Reader and update references in upload command * Merge branch 'next' into archive * Add AssetWriter interface and implement context-aware asset writing * Refactor LocalAssetWriter to use fs.FS directly and enhance MkdirAll functionality in fshelper * Enhance LocalAssetWriter to track created directories and avoid redundant MkdirAll calls * Add XMP reading and writing functionality with GPS and time conversion * Add album support to Asset and XMP reading/writing functionality * Refactor OpenFile function to return WFile interface for enhanced write capabilities * Add WriteGroup method to AssetWriter and enhance WriteAsset to support album associations * Add album association to assets and enhance import flags for Google Photos integration * Refactor upload command options to streamline flag management and enhance filter handling * Refactor import command to enhance folder options handling and streamline flag management * Refactor upload and archive commands to streamline options handling and add Google Photos archive * Rename Stars field to Rating in Asset struct for clarity * Refactor XMP read and write to write immich image properties using a specific namespace: xmlns:immichgo="http://ns.immich-go.com/immich-go/1.0/" * Enhance XMP file handling in folder read/write operations to support sidecar files * Edit release.md: Add new `archive` command to store photos and videos in a structured folder format * Refactor command flag handling to include parent command context for upload and archive operations * Add job management endpoints and tag handling functionality, thx to benjamonnguyen * Refactor asset retrieval and tagging: Introduce SearchMetadataQuery for filtering and enhance asset structure with rating and tag support * Add Tags support to Asset structure and introduce Tag type for asset tagging * Add FromImmich adapter with flags for asset retrieval and filtering * Refactor client initialization and add FromImmich command for archiving * Add support for tags in XMP asset handling: enhance reader and writer for tag extraction and serialization * Refactor ImmichClient methods and enhance asset handling: rename GetAssetByID to GetAssetInfo, add DownloadAsset method, and improve request handling for album retrieval * Add immichfs package for reading assets from Immich server with file system interface * Refactor FromImmich adapter: enhance asset filtering, and improve error handling * Add support for tags in XMP asset handling: update reader and writer, and add test cases for tag extraction * Enhance client error handling: ensure client opens successfully and manage API trace writer closure * Add Tagged event type to file events: update constants and string mapping * Enhance asset handling: add XMP file parsing and manage asset tags during upload * Add description field to Asset struct and update XMP handling * Add description handling to asset creation and update during upload * Refactor asset handling: update OriginalFileName usage and add FromImmich command for uploads * Comment out Epson Scanner test case in TestGetInfo for grouped handling * Update AlbumContent struct to use pointer for Assets and enhance GetAlbumInfo query handling * Implement album-specific asset retrieval in FromImmich adapter and update command flag for album selection * Comment out unused flags in FromImmich command options for asset retrieval * Add documentation for new `archive --from-immich` and `upload --from-immich` commands with usage details and flags * Update release version to 0.23.0-alpha5 in documentation * Fix grammatical error in documentation for `upload --from-immich` command * Check the tag DateTimeUTC when using exiftool and improve error handling * Refactor FromImmich to use flags.client for API calls instead of a separate client field * Change date string normalization to uppercase in DateMethod.Set * Refactor date formatting in AssetUpload to use a constant TimeFormat and remove redundant CaptureDate assignment * Update release notes for v0.23.0-alpha6 and set default capture date method to NONE * Update dependencies in go.mod and go.sum to latest versions
1 parent d374964 commit ed31769

File tree

318 files changed

+16798
-5971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

318 files changed

+16798
-5971
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ jobs:
4141
go-version-file: "go.mod"
4242
cache-dependency-path: "go.sum"
4343

44+
- name: Install ExifTool
45+
run: sudo apt-get install -y exiftool
46+
4447
- name: golangci-lint
4548
uses: golangci/golangci-lint-action@v6
4649
with:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ archive.tar
1818
*.test
1919
.env
2020
*.env
21+
test-config.yaml
22+
__debug_*

.goreleaser.yaml

Lines changed: 191 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# This is an example .goreleaser.yml file with some sensible defaults.
22
# Make sure to check the documentation at https://goreleaser.com
3+
version: 2
4+
35
before:
46
hooks:
57
# You may remove this if you don't use go modules.
@@ -23,7 +25,7 @@ builds:
2325
flags:
2426
- -trimpath
2527
ldflags:
26-
- '-s -w "-extldflags=-static" -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser'
28+
- '-s -w "-extldflags=-static" -X version.Version={{.Version}} -X version.Commit={{.Commit}} -X Version.Date={{.Date}} -X main.builtBy=goreleaser'
2729

2830
archives:
2931
- format: tar.gz
@@ -54,3 +56,191 @@ changelog:
5456
# Feel free to remove those if you don't want/use them.
5557
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
5658
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
59+
60+
# .goreleaser.yaml
61+
release:
62+
# Repo in which the release will be created.
63+
# Default: extracted from the origin remote URL or empty if its private hosted.
64+
# github:
65+
# owner: user
66+
# name: repo
67+
68+
# IDs of the archives to use.
69+
# Empty means all IDs.
70+
#
71+
# Default: [].
72+
# ids:
73+
# - foo
74+
# - bar
75+
76+
# If set to true, will not auto-publish the release.
77+
# Note: all GitHub releases start as drafts while artifacts are uploaded.
78+
# Available only for GitHub and Gitea.
79+
draft: true
80+
81+
# Whether to remove existing draft releases with the same name before creating
82+
# a new one.
83+
#
84+
# Only effective if `draft` is set to true.
85+
# Available only for GitHub.
86+
replace_existing_draft: true
87+
88+
# Whether to remove an artifact that already exists.
89+
#
90+
# Available only for GitHub.
91+
# This might be a bit expensive (rate-limiting speaking), so it is only done
92+
# when the upload of an artifact fails with a 422 (which means it already
93+
# exists in the release).
94+
# We then grab the list of artifacts from the release, and delete the file
95+
# that matches the one we're trying to upload.
96+
# GoReleaser will then retry its upload.
97+
replace_existing_artifacts: true
98+
99+
# Useful if you want to delay the creation of the tag in the remote.
100+
# You can create the tag locally, but not push it, and run GoReleaser.
101+
# It'll then set the `target_commitish` portion of the GitHub release to the
102+
# value of this field.
103+
# Only works on GitHub.
104+
#
105+
# Default: ''.
106+
# Templates: allowed.
107+
target_commitish: "{{ .Commit }}"
108+
109+
# This allows to change which tag GitHub will create.
110+
# Usually you'll use this together with `target_commitish`, or if you want to
111+
# publish a binary from a monorepo into a public repository somewhere, without
112+
# the tag prefix.
113+
#
114+
# This feature is only available in GoReleaser Pro.
115+
# Default: '{{ .PrefixedCurrentTag }}'.
116+
# Templates: allowed.
117+
# tag: "{{ .CurrentTag }}"
118+
119+
# If set, will create a release discussion in the category specified.
120+
#
121+
# Warning: do not use categories in the 'Announcement' format.
122+
# Check https://github.com/goreleaser/goreleaser/issues/2304 for more info.
123+
#
124+
# Default: ''.
125+
# discussion_category_name: General
126+
127+
# If set to auto, will mark the release as not ready for production
128+
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
129+
# If set to true, will mark the release as not ready for production.
130+
# Default: false.
131+
prerelease: auto
132+
133+
# If set to false, will NOT mark the release as "latest".
134+
# This prevents it from being shown at the top of the release list,
135+
# and from being returned when calling https://api.github.com/repos/OWNER/REPO/releases/latest.
136+
#
137+
# Available only for GitHub.
138+
#
139+
# Default: true.
140+
make_latest: true
141+
142+
# What to do with the release notes in case there the release already exists.
143+
#
144+
# Valid options are:
145+
# - `keep-existing`: keep the existing notes
146+
# - `append`: append the current release notes to the existing notes
147+
# - `prepend`: prepend the current release notes to the existing notes
148+
# - `replace`: replace existing notes
149+
#
150+
# Default: `keep-existing`.
151+
mode: append
152+
153+
# Header for the release body.
154+
#
155+
# Templates: allowed.
156+
# header: |
157+
# ## Some title ({{ .Date }})
158+
159+
# Welcome to this new release!
160+
161+
# Header for the release body.
162+
#
163+
# This feature is only available in GoReleaser Pro.
164+
# header:
165+
# # Loads from an URL.
166+
# from_url:
167+
# # Templates: allowed.
168+
# url: https://foo.bar/header.md
169+
# headers:
170+
# x-api-token: "${MYCOMPANY_TOKEN}"
171+
172+
# # Loads from a local file.
173+
# # Overrides `from_url`.
174+
# from_file:
175+
# # Templates: allowed.
176+
# path: ./header.md
177+
178+
# Footer for the release body.
179+
#
180+
# Templates: allowed.
181+
# footer: |
182+
# ## Thanks
183+
184+
# Those were the changes on {{ .Tag }}!
185+
186+
# Footer for the release body.
187+
#
188+
# This feature is only available in GoReleaser Pro.
189+
# footer:
190+
# # Loads from an URL.
191+
# from_url:
192+
# # Templates: allowed.
193+
# url: https://foo.bar/footer.md
194+
# footers:
195+
# x-api-token: "${MYCOMPANY_TOKEN}"
196+
197+
# # Loads from a local file.
198+
# # Overrides `from_url`.
199+
# from_file:
200+
# # Templates: allowed.
201+
# path: ./footer.md
202+
203+
# # You can change the name of the release.
204+
# #
205+
# # Default: '{{.Tag}}' ('{{.PrefixedTag}}' on Pro).
206+
# # Templates: allowed.
207+
# name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"
208+
209+
# You can disable this pipe in order to not create the release on any SCM.
210+
# Keep in mind that this might also break things that depend on the release
211+
# URL, for instance, homebrew taps.
212+
#
213+
# Templates: allowed.
214+
disable: true
215+
216+
# Set this to true if you want to disable just the artifact upload to the SCM.
217+
# If this is true, GoReleaser will still create the release with the
218+
# changelog, but won't upload anything to it.
219+
#
220+
# Templates: allowed.
221+
skip_upload: true
222+
223+
# You can add extra pre-existing files to the release.
224+
# The filename on the release will be the last part of the path (base).
225+
# If another file with the same name exists, the last one found will be used.
226+
#
227+
# Templates: allowed.
228+
# extra_files:
229+
# - glob: ./path/to/file.txt
230+
# - glob: ./glob/**/to/**/file/**/*
231+
# - glob: ./glob/foo/to/bar/file/foobar/override_from_previous
232+
# - glob: ./single_file.txt
233+
# name_template: file.txt # note that this only works if glob matches 1 file only
234+
235+
# Additional templated extra files to add to the release.
236+
# Those files will have their contents pass through the template engine,
237+
# and its results will be added to the release.
238+
#
239+
# This feature is only available in GoReleaser Pro.
240+
# Templates: allowed.
241+
# templated_extra_files:
242+
# - src: LICENSE.tpl
243+
# dst: LICENSE.txt
244+
245+
# # Upload metadata.json and artifacts.json to the release as well.
246+
# include_meta: true

adapters/adapters.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package adapters
2+
3+
import (
4+
"context"
5+
6+
"github.com/simulot/immich-go/internal/assets"
7+
)
8+
9+
type Reader interface {
10+
Browse(cxt context.Context) chan *assets.Group
11+
}
12+
13+
type AssetWriter interface {
14+
WriteAsset(context.Context, *assets.Asset) error
15+
// WriteGroup(ctx context.Context, group *assets.Group) error
16+
}
9.06 KB
Loading
9.06 KB
Loading
9.06 KB
Loading

0 commit comments

Comments
 (0)