Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next version #540

Open
wants to merge 264 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
264 commits
Select commit Hold shift + click to select a range
1834167
Refactor asset browsing to support grouped assets
simulot Sep 28, 2024
edb09f8
Refactor `LocalAssetFile` struct: remove metadata from asset
simulot Sep 28, 2024
4610b05
Refactor metadata reading functions to return metadata and error
simulot Sep 28, 2024
31941bb
Add Metadata field to AssetGroup struct in adapters/group.go
simulot Sep 28, 2024
3df29e2
Refactor AssetGroup struct in adapters/group.go to support grouped as…
simulot Sep 29, 2024
7b12bb7
Refactor asset browsing to support grouped assets
simulot Sep 29, 2024
a57f85c
Refactor `LocalAssetFile` struct: remove metadata from asset
simulot Sep 29, 2024
ac4af01
Refactor Adapter interface to support browsing grouped assets
simulot Sep 29, 2024
4a47677
Refactor `AssetUpload` function in immich/asset.go don't force XMP
simulot Sep 29, 2024
ba4acca
Refactor `UpdateAsset` pass a structure with paramters
simulot Sep 29, 2024
194e8f8
Refactor `UpdateAsset` to accept a structure with parameters
simulot Sep 29, 2024
9e05df2
Refactor asset group handling in upload command: manage the live photo
simulot Sep 29, 2024
a6bbf5b
Refactor file browsing in upload command to use asset groups
simulot Sep 29, 2024
2169d98
Refactor date handling flags in AddDateHandlingFlags function default…
simulot Sep 30, 2024
a5937da
Refactor logging in Recorder.Report()
simulot Sep 30, 2024
fbaf9dd
Refactor Open()
simulot Sep 30, 2024
e226463
Refactor Open() in cmdFolder.go to use cmdFolder as a parameter
simulot Sep 30, 2024
dd6e252
Refactor Open() in cmdFolder.go to use cmdFolder as a parameter
simulot Sep 30, 2024
1e95c56
Refactor Open() in cmdFolder.go to use cmdFolder as a parameter
simulot Sep 30, 2024
027b8ec
Refactor Open() in cmdFolder.go to use cmdFolder as a parameter and b…
simulot Sep 30, 2024
8200738
Refactor Open() in cmdFolder.go to use cmdFolder as a parameter and b…
simulot Sep 30, 2024
67d9312
Refactor Open() in cmdFolder.go to use cmdFolder as a parameter and b…
simulot Oct 6, 2024
b573dd7
wip
simulot Oct 6, 2024
968be4f
fix log in UI wip
simulot Oct 6, 2024
3c5110a
Refactor upload command to use separate sub-commands for different so…
simulot Oct 6, 2024
04ca927
typo in upload command
simulot Oct 6, 2024
dddff54
Refactor NewImmichClient() in client.go to include option for dry run
simulot Oct 6, 2024
997d72f
Refactor upload command to use more descriptive wording for Google Ph…
simulot Oct 6, 2024
717dd3a
Refactor client.go to write dry-run indication on the log
simulot Oct 6, 2024
6f77c4f
Refactor log.go to mask the API key flag
simulot Oct 6, 2024
29fca64
Refactor testgp_test.go to fix the order of live photos in the livePh…
simulot Oct 6, 2024
f1d27d0
Refactor testgp_test.go to fix the order of live photos in the livePh…
simulot Oct 6, 2024
7ce5dd5
remove useless source files
simulot Oct 6, 2024
7d7e0b5
Refactor main.go to handle nil log writer when logging errors
simulot Oct 6, 2024
d693f41
Refactor upload command to remove exif flags for the google-photos
simulot Oct 6, 2024
dde3c60
Refactor .goreleaser.yaml
simulot Oct 6, 2024
62ceb3f
Refactor .goreleaser.yaml and go.mod files
simulot Oct 7, 2024
abb751a
Refactor options.go to remove UseJSONMetadata flag
simulot Oct 7, 2024
5f9577a
Refactor upload command flag name for importing from a specific Googl…
simulot Oct 7, 2024
3f1544e
Add documentation for Immich-go environment variables
simulot Oct 7, 2024
4c7ee08
Refactor readFolder.go to improve live photo linking logic
simulot Oct 12, 2024
b035542
Refactor testgp_livephoto_test.go to improve live photo linking logic
simulot Oct 12, 2024
0bf90c2
fix issue #500 (#502)
simulot Oct 13, 2024
0a8f1e0
Discard macOS resource files
simulot Oct 13, 2024
7ae40e6
Discard macOS resource files (#504)
simulot Oct 13, 2024
d9b293a
Refactor readFolder.go to skip banned folders during file traversal
simulot Oct 13, 2024
10c475d
Merge branch 'optimization--don't-parse-banned-folders' into new-cli
simulot Oct 13, 2024
73ae0a1
Merge branch 'new-cli' into next
simulot Oct 13, 2024
a60c911
edit release.md
simulot Oct 13, 2024
bd2f9e4
Add test-config.yaml to .gitignore
simulot Oct 14, 2024
10231b1
stacking wIP
simulot Oct 15, 2024
a7088e6
add grouper for raw / jpg
simulot Oct 19, 2024
ab8b793
Add Information extraction for pixel photo names
simulot Oct 19, 2024
d02ee94
Add name Info for Nexus and Samsoung
simulot Oct 19, 2024
eee993f
add InfoCollector.GetInfo and tests
simulot Oct 19, 2024
af84c1a
Add NewInfoCollector
simulot Oct 19, 2024
76d86b2
Add Huawei burst file recogntion
simulot Oct 20, 2024
e7bbf3a
WIP: grouping based on file names information
simulot Oct 26, 2024
598ef56
WIP grouping on time series
simulot Oct 26, 2024
3beb8b2
wip simplify the Grouper usage
simulot Oct 26, 2024
806425d
wip: concurent directory parser
simulot Oct 27, 2024
c10ef45
WIP refactor google photo import
simulot Oct 27, 2024
14b5ba4
WIP
simulot Oct 27, 2024
cbae2fd
Incompatible with Immich v1.118 (#510)
simulot Oct 15, 2024
85c6480
wip
simulot Oct 27, 2024
cad549c
WIP: pooling together parts
simulot Oct 28, 2024
26c10d5
Refactor time zone handling in upload commands
simulot Oct 28, 2024
4d352d9
Add RawJPGFlag type and methods for managing raw and JPEG files
simulot Oct 28, 2024
2946b21
Refactor options in Google Photos option to mange RAW-JPG, HEIC-JPG a…
simulot Oct 28, 2024
26510cd
Refactor options in Google Photos command to manage RAW-JPG, HEIC-JPG…
simulot Oct 28, 2024
3e75a2a
Renaming LocalAssetFile to Asset
simulot Oct 28, 2024
2278270
Refactor asset struct and related code
simulot Oct 29, 2024
fecce8d
Merge branch 'next' into re-implement-stack-options
simulot Oct 29, 2024
510b062
fix: Creating stacks by updating the stacked assets is no longer supp…
simulot Oct 30, 2024
77352ae
Refactor options in folder and Google Photos commands to manage HEIC-…
simulot Oct 30, 2024
0f3d68b
add filter removal reason to the log
simulot Oct 30, 2024
efd69cb
Refactor burst group logic to fix grouping issue
simulot Oct 31, 2024
1d49739
Refactor burst group logic to fix grouping issue, increase interval b…
simulot Oct 31, 2024
1669596
Edit release.md file for stack options
simulot Oct 31, 2024
74ee91f
wip
simulot Nov 1, 2024
d97d6a7
Fix typos in release documentation for stacking options
simulot Nov 1, 2024
9fb526d
Improve burst group logic for asset grouping
simulot Nov 1, 2024
7d5a74e
Improve burst grouping logic and adjust frame interval to 500ms
simulot Nov 1, 2024
5e03ecc
Add TODO for improving time offset handling in EXIF metadata
simulot Nov 1, 2024
9d2c13a
Merge branch 'check-test-results' into next
simulot Nov 1, 2024
c44642b
Burst images not being stacked
simulot Nov 1, 2024
3e9123c
Burst images not being stacked
simulot Nov 1, 2024
55d8187
WIP
simulot Nov 1, 2024
70d9691
Refactor version handling and remove deprecated version package (#524)
simulot Nov 1, 2024
9608013
Implement grouping for Epson FastFoto assets
simulot Nov 1, 2024
37786d8
Add support for managing Epson FastFoto files
simulot Nov 1, 2024
24a3e2e
Add documentation for managing Epson FastFoto files in release notes
simulot Nov 1, 2024
40088ca
Merge branch 'next' of github.com:simulot/immich-go into next
simulot Nov 1, 2024
bb3494b
Set default capture date to file date for local and Google Photos assets
simulot Nov 1, 2024
3e38506
Refactor capture date assignment to use file date only if capture dat…
simulot Nov 1, 2024
b1064d9
Implement new writable file system helper
simulot Nov 2, 2024
45c5dcd
Add archive command and work on implementing local asset writing func…
simulot Nov 2, 2024
f3f2955
Remove commented-out code for stacking and album management in upload…
simulot Nov 2, 2024
33664ae
Remove commented-out code related to stacking and debug counters in u…
simulot Nov 2, 2024
44bdf41
Remove commented-out code for local asset deletion and stacking in up…
simulot Nov 2, 2024
370c635
Remove commented-out code related to Google Photos analysis in upload…
simulot Nov 2, 2024
fb54ca5
Remove commented-out code related to Google Photos analysis in upload…
simulot Nov 2, 2024
e2873d9
Merge branch 'next' into archive
simulot Nov 2, 2024
e791d4d
Rename Adapter interface to Reader and update references in upload co…
simulot Nov 2, 2024
fdd1b28
Merge branch 'next' into archive
simulot Nov 2, 2024
8939f36
Add AssetWriter interface and implement context-aware asset writing
simulot Nov 2, 2024
254b645
Refactor LocalAssetWriter to use fs.FS directly and enhance MkdirAll …
simulot Nov 2, 2024
9b66771
Enhance LocalAssetWriter to track created directories and avoid redun…
simulot Nov 2, 2024
029e561
Add XMP reading and writing functionality with GPS and time conversion
simulot Nov 3, 2024
db53422
Add album support to Asset and XMP reading/writing functionality
simulot Nov 3, 2024
9044af0
Refactor OpenFile function to return WFile interface for enhanced wri…
simulot Nov 3, 2024
f7ee727
Add WriteGroup method to AssetWriter and enhance WriteAsset to suppor…
simulot Nov 3, 2024
69f55c2
Add album association to assets and enhance import flags for Google P…
simulot Nov 3, 2024
a97c533
Refactor upload command options to streamline flag management and enh…
simulot Nov 3, 2024
ed0164c
Refactor import command to enhance folder options handling and stream…
simulot Nov 3, 2024
fd59efd
Refactor upload and archive commands to streamline options handling a…
simulot Nov 3, 2024
70463e9
Rename Stars field to Rating in Asset struct for clarity
simulot Nov 6, 2024
d421520
Refactor XMP read and write to write immich image properties using a…
simulot Nov 6, 2024
8377d62
Enhance XMP file handling in folder read/write operations to support …
simulot Nov 6, 2024
31dc283
Edit release.md: Add new `archive` command to store photos and videos…
simulot Nov 6, 2024
9674f50
Refactor command flag handling to include parent command context for …
simulot Nov 7, 2024
cb33c5b
Add job management endpoints and tag handling functionality, thx to b…
simulot Nov 7, 2024
c463af1
Refactor asset retrieval and tagging: Introduce SearchMetadataQuery f…
simulot Nov 8, 2024
f6fb156
Add Tags support to Asset structure and introduce Tag type for asset …
simulot Nov 8, 2024
8b75656
Add FromImmich adapter with flags for asset retrieval and filtering
simulot Nov 8, 2024
ddbf781
Refactor client initialization and add FromImmich command for archiving
simulot Nov 8, 2024
0cc5706
Add support for tags in XMP asset handling: enhance reader and writer…
simulot Nov 10, 2024
2013d67
Refactor ImmichClient methods and enhance asset handling: rename GetA…
simulot Nov 10, 2024
1443c1c
Add immichfs package for reading assets from Immich server with file …
simulot Nov 10, 2024
fd7c5a5
Refactor FromImmich adapter: enhance asset filtering, and improve err…
simulot Nov 10, 2024
05f4253
Add support for tags in XMP asset handling: update reader and writer,…
simulot Nov 10, 2024
6a8ee0c
Enhance client error handling: ensure client opens successfully and m…
simulot Nov 10, 2024
e394927
Add Tagged event type to file events: update constants and string map…
simulot Nov 10, 2024
f27a71a
Enhance asset handling: add XMP file parsing and manage asset tags du…
simulot Nov 10, 2024
106df5f
Add description field to Asset struct and update XMP handling
simulot Nov 10, 2024
323d2c2
Add description handling to asset creation and update during upload
simulot Nov 10, 2024
835145d
Refactor asset handling: update OriginalFileName usage and add FromIm…
simulot Nov 11, 2024
5eed97e
Comment out Epson Scanner test case in TestGetInfo for grouped handling
simulot Nov 11, 2024
4b96e00
Update AlbumContent struct to use pointer for Assets and enhance GetA…
simulot Nov 11, 2024
aab3fa7
Implement album-specific asset retrieval in FromImmich adapter and up…
simulot Nov 11, 2024
01e1d48
Comment out unused flags in FromImmich command options for asset retr…
simulot Nov 11, 2024
0328c12
Add documentation for new `archive --from-immich` and `upload --from-…
simulot Nov 11, 2024
6f6847f
Update release version to 0.23.0-alpha5 in documentation
simulot Nov 11, 2024
efb6cbf
Fix grammatical error in documentation for `upload --from-immich` com…
simulot Nov 11, 2024
f2fa875
Check the tag DateTimeUTC when using exiftool and improve error ha…
simulot Nov 11, 2024
77664ba
Refactor FromImmich to use flags.client for API calls instead of a se…
simulot Nov 11, 2024
071d007
Change date string normalization to uppercase in DateMethod.Set
simulot Nov 11, 2024
8585e06
Refactor date formatting in AssetUpload to use a constant TimeFormat …
simulot Nov 11, 2024
0853301
Update release notes for v0.23.0-alpha6 and set default capture date …
simulot Nov 11, 2024
1861b45
Update dependencies in go.mod and go.sum to latest versions
simulot Nov 11, 2024
d473639
Improve error logging in manageGroupAlbums by adding a static "error"…
simulot Nov 15, 2024
9cbabb0
Refactor metadata package structure and update references to assets p…
simulot Nov 16, 2024
4745cf3
fix Upload Error - Invalid Argument - 0.23.0-alpha5 - Windows #534
simulot Nov 17, 2024
7f29071
fix Upload Error - Invalid Argument - 0.23.0-alpha5 - Windows #534
simulot Nov 17, 2024
181b2aa
Update go.sum to remove deprecated fsnotify and samber/slog-multi ver…
simulot Nov 17, 2024
190cf49
Removing direct EXIF metadata reading functionality and corresponding…
simulot Nov 17, 2024
3306536
Remove unused EXIF references and clean up related test cases
simulot Nov 17, 2024
0d0f1f6
fix Upload Error - Invalid Argument - 0.23.0-alpha5 - Windows #534
simulot Nov 17, 2024
6849df1
Update FSAndName to use FullName for logging and add FullName method
simulot Nov 17, 2024
38e42e4
Fix album name assignment logic in parseDir function
simulot Nov 17, 2024
267f9bd
Refactor ExifTool initialization and metadata reading methods for imp…
simulot Nov 17, 2024
41555ee
Remove unused DateHandlingFlags and related functionality from dateFr…
simulot Nov 17, 2024
f2d0739
Refactor Asset methods to remove redundant CaptureDate assignment and…
simulot Nov 17, 2024
41f0e36
Refactor metadata handling to eliminate DateHandlingFlags and streaml…
simulot Nov 17, 2024
fb825d3
Add XMP sidecar handling with GPS and metadata conversion utilities
simulot Nov 17, 2024
de18dab
Remove unused conversion functions and streamline Tag struct JSON han…
simulot Nov 17, 2024
4b1b1da
Implement XMP sidecar reading and JSON sidecar writing in asset handling
simulot Nov 17, 2024
6506b86
Refactor album handling in FromImmich adapter to improve clarity and …
simulot Nov 17, 2024
e784f3a
Add JSON tags to Metadata and Tag structs for improved serialization
simulot Nov 17, 2024
02ded48
Refactor Google Photos adapter to streamline metadata handling and re…
simulot Nov 17, 2024
7379ce0
Refactor client initialization to use application logger and streamli…
simulot Nov 17, 2024
f555f0b
Refactor ExifTool test to improve flag handling and enhance readabili…
simulot Nov 17, 2024
3690ff8
Remove JSON serialization for sensitive fields in Album, Metadata, an…
simulot Nov 17, 2024
555d45e
Add unit test for Asset JSON deserialization and tag validation
simulot Nov 17, 2024
b8250fa
Enhance file handling in LocalAssetWriter and update FromImmich initi…
simulot Nov 17, 2024
4cec505
Add JSON sidecar support and enhance metadata handling in LocalAssetB…
simulot Nov 17, 2024
7ae47d7
Fix filepath joining in makeAsset function to use path package
simulot Nov 17, 2024
788ddd1
Remove goexif dependency from go.mod and go.sum
simulot Nov 17, 2024
ce7d2e6
Fix metadata field access in makeAsset function to use FileName inste…
simulot Nov 18, 2024
0b05fbb
Refactor ExifTool test to simplify initialization and enhance metadat…
simulot Nov 18, 2024
7154412
Refactor Asset methods to use 'a' receiver and enhance tag handling i…
simulot Nov 19, 2024
a41de42
Add support for tags in ImportFolderOptions and implement folder stru…
simulot Nov 19, 2024
1ea0c94
Add UnmarshalJSON function for generic JSON deserialization
simulot Nov 21, 2024
46ac722
Add UnMarshalMetadata function for JSON deserialization of Metadata
simulot Nov 21, 2024
48d8332
Comment out asset tag management in handleAsset function
simulot Nov 21, 2024
223c701
Add session tag support in ImportFolderOptions and update asset taggi…
simulot Nov 21, 2024
a3217e6
Fix session tag format in NewLocalFiles function to use curly braces
simulot Nov 21, 2024
1abc5ad
Fix session tag format in ImportFolderOptions to use curly braces
simulot Nov 21, 2024
3f127b7
Update release notes for v0.23.0-alpha6: add new features for tag man…
simulot Nov 21, 2024
76755e5
Update release notes to clarify folder-as-tags usage and add explanat…
simulot Nov 21, 2024
04ee1f8
Add session tag support and enhance asset tagging logic in Google Pho…
simulot Nov 21, 2024
6ff997a
Update release notes to clarify folder import tags and add Google Pho…
simulot Nov 21, 2024
0acbdde
fix #534
simulot Nov 22, 2024
72d0fdb
Merge remote-tracking branch 'origin/next' into issue-#534
simulot Nov 22, 2024
ba53156
Document known issue with errors on Windows in release notes
simulot Nov 22, 2024
7d0d333
Add takeout tagging support and update related documentation
simulot Nov 22, 2024
3db234a
Update release notes to format tag options consistently and improve c…
simulot Nov 22, 2024
de5c675
Refactor move the package 'application' outside of the package 'comma…
simulot Nov 24, 2024
fb8732b
Refactor command structure by moving 'commands' package to 'applicati…
simulot Nov 24, 2024
4ecd469
move tobe implemented command in the _todo package
simulot Nov 24, 2024
e1cc88f
rename 'command' package into 'cmd'
simulot Nov 24, 2024
6e459c0
rename package 'application' as 'app'
simulot Nov 24, 2024
62ef829
rename the 'logger' package by 'journal' and move it into the 'intern…
simulot Nov 24, 2024
653c02a
move the ui package into internal
simulot Nov 24, 2024
731df23
move all 'helpers' in the 'internal' folder
simulot Nov 24, 2024
ea176a0
update test to include tags in expected results for in-memory local a…
simulot Nov 24, 2024
8fd06b8
remove unused ImmichServerFlags and Run command implementations
simulot Nov 24, 2024
cbfc25f
add documentation generation command and update dependencies
simulot Nov 24, 2024
6e3d62a
rewrite the readme.md file for the new version of immich-go
simulot Nov 24, 2024
bfeea18
update readme.md to enhance project description and installation inst…
simulot Nov 24, 2024
d180f87
fix: improve grammar and clarity in readme.md
simulot Nov 24, 2024
4adb6ce
Merge branch 'main' into next
simulot Nov 24, 2024
21e795b
fix linter message
simulot Nov 24, 2024
bbabe43
fix: handle cancellation on file stat error in ImmichFS
simulot Nov 24, 2024
c33def2
fix: handle file opening error in AssetUpload and update import for s…
simulot Nov 24, 2024
69f5c8a
deactivate some dead code
simulot Nov 24, 2024
0874168
refactor: remove unused mockedAsset struct from series_test.go
simulot Nov 24, 2024
e502a35
refactor: remove unnecessary blank lines in folder adapter files
simulot Nov 24, 2024
08e524f
refactor: rename parameter in GroupFilter method for clarity
simulot Nov 24, 2024
7705716
refactor: rename receiver in GroupFilter method for clarity
simulot Nov 24, 2024
9bd94c5
refactor: remove unnecessary blank lines in handleAsset function
simulot Nov 24, 2024
5a6425f
refactor: rename receiver in GroupFilter method for clarity
simulot Nov 24, 2024
f0106dd
refactor: reorder import statements for consistency
simulot Nov 24, 2024
b55447a
refactor: rename receiver in GroupFilter method for clarity
simulot Nov 24, 2024
6ac70c2
ci: add step to install ExifTool in CI workflow
simulot Nov 24, 2024
dec475d
edit readme
simulot Nov 25, 2024
39431fc
WIP
simulot Nov 27, 2024
de5e2ff
refactor: reimplement direct read of metadata
simulot Nov 28, 2024
410b7e6
refactor: update MetadataFromDirectRead to accept io.Reader and filename
simulot Nov 28, 2024
ff155f8
refactor: update temp file creation to include file extension
simulot Nov 28, 2024
18c25c5
refactor: update time extraction method to use TakeTimeFromPath
simulot Nov 28, 2024
cb9ecde
refactor: enhance metadata extraction by checking for JSON sidecar fi…
simulot Nov 28, 2024
8102b20
refactor: update fileCreatedAt handling to use modified time when cap…
simulot Nov 28, 2024
067fdff
refactor: update logging to use file name instead of asset for error …
simulot Nov 28, 2024
85581e8
refactor: update GlobWalkFS to use directory name instead "."
simulot Nov 28, 2024
5b15c6c
refactor: remove the support of exiftool
simulot Nov 30, 2024
bc2a17c
refactor: take the full path of the file to determine the date
simulot Nov 30, 2024
b9b5829
refactor: enhance DateRange to support time zone handling
simulot Nov 30, 2024
a5ab438
refactor: remove the support of exiftool, and take time from name
simulot Nov 30, 2024
21cdcb7
refactor: update InitDateRange to accept time zone and improve date r…
simulot Nov 30, 2024
5bcdef9
refactor: adjust date range calculations to include additional day in…
simulot Nov 30, 2024
8020d46
refactor: set time zone option in NewFromFolderCommand
simulot Nov 30, 2024
cc14818
refactor: add test case for date handling with time zone in ImportFol…
simulot Nov 30, 2024
ed642b1
refactor: remove dependency on go-exiftool from go.mod and go.sum
simulot Nov 30, 2024
4e1a7e5
refactor: enhance test case for date handling by adding filename date…
simulot Nov 30, 2024
8776b28
refactor: update date range calculations and improve test case timezo…
simulot Nov 30, 2024
6c7c64e
refactor: improve error message for unsupported metadata formats and …
simulot Nov 30, 2024
227948b
refactor: update timezone handling in Google Photos upload command an…
simulot Nov 30, 2024
7bdb042
Merge pull request #545 from simulot:simulot/issue543
simulot Nov 30, 2024
8d3f698
proofreading readme.md
simulot Nov 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
go-version-file: "go.mod"
cache-dependency-path: "go.sum"

- name: Install ExifTool
run: sudo apt-get install -y exiftool

- name: golangci-lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ archive.tar
*.test
.env
*.env
test-config.yaml
__debug_*
192 changes: 191 additions & 1 deletion .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# This is an example .goreleaser.yml file with some sensible defaults.
# Make sure to check the documentation at https://goreleaser.com
version: 2

before:
hooks:
# You may remove this if you don't use go modules.
Expand All @@ -23,7 +25,7 @@ builds:
flags:
- -trimpath
ldflags:
- '-s -w "-extldflags=-static" -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} -X main.builtBy=goreleaser'
- '-s -w "-extldflags=-static" -X version.Version={{.Version}} -X version.Commit={{.Commit}} -X Version.Date={{.Date}} -X main.builtBy=goreleaser'

archives:
- format: tar.gz
Expand Down Expand Up @@ -54,3 +56,191 @@ changelog:
# Feel free to remove those if you don't want/use them.
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
# vim: set ts=2 sw=2 tw=0 fo=cnqoj

# .goreleaser.yaml
release:
# Repo in which the release will be created.
# Default: extracted from the origin remote URL or empty if its private hosted.
# github:
# owner: user
# name: repo

# IDs of the archives to use.
# Empty means all IDs.
#
# Default: [].
# ids:
# - foo
# - bar

# If set to true, will not auto-publish the release.
# Note: all GitHub releases start as drafts while artifacts are uploaded.
# Available only for GitHub and Gitea.
draft: true

# Whether to remove existing draft releases with the same name before creating
# a new one.
#
# Only effective if `draft` is set to true.
# Available only for GitHub.
replace_existing_draft: true

# Whether to remove an artifact that already exists.
#
# Available only for GitHub.
# This might be a bit expensive (rate-limiting speaking), so it is only done
# when the upload of an artifact fails with a 422 (which means it already
# exists in the release).
# We then grab the list of artifacts from the release, and delete the file
# that matches the one we're trying to upload.
# GoReleaser will then retry its upload.
replace_existing_artifacts: true

# Useful if you want to delay the creation of the tag in the remote.
# You can create the tag locally, but not push it, and run GoReleaser.
# It'll then set the `target_commitish` portion of the GitHub release to the
# value of this field.
# Only works on GitHub.
#
# Default: ''.
# Templates: allowed.
target_commitish: "{{ .Commit }}"

# This allows to change which tag GitHub will create.
# Usually you'll use this together with `target_commitish`, or if you want to
# publish a binary from a monorepo into a public repository somewhere, without
# the tag prefix.
#
# This feature is only available in GoReleaser Pro.
# Default: '{{ .PrefixedCurrentTag }}'.
# Templates: allowed.
# tag: "{{ .CurrentTag }}"

# If set, will create a release discussion in the category specified.
#
# Warning: do not use categories in the 'Announcement' format.
# Check https://github.com/goreleaser/goreleaser/issues/2304 for more info.
#
# Default: ''.
# discussion_category_name: General

# If set to auto, will mark the release as not ready for production
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1
# If set to true, will mark the release as not ready for production.
# Default: false.
prerelease: auto

# If set to false, will NOT mark the release as "latest".
# This prevents it from being shown at the top of the release list,
# and from being returned when calling https://api.github.com/repos/OWNER/REPO/releases/latest.
#
# Available only for GitHub.
#
# Default: true.
make_latest: true

# What to do with the release notes in case there the release already exists.
#
# Valid options are:
# - `keep-existing`: keep the existing notes
# - `append`: append the current release notes to the existing notes
# - `prepend`: prepend the current release notes to the existing notes
# - `replace`: replace existing notes
#
# Default: `keep-existing`.
mode: append

# Header for the release body.
#
# Templates: allowed.
# header: |
# ## Some title ({{ .Date }})

# Welcome to this new release!

# Header for the release body.
#
# This feature is only available in GoReleaser Pro.
# header:
# # Loads from an URL.
# from_url:
# # Templates: allowed.
# url: https://foo.bar/header.md
# headers:
# x-api-token: "${MYCOMPANY_TOKEN}"

# # Loads from a local file.
# # Overrides `from_url`.
# from_file:
# # Templates: allowed.
# path: ./header.md

# Footer for the release body.
#
# Templates: allowed.
# footer: |
# ## Thanks

# Those were the changes on {{ .Tag }}!

# Footer for the release body.
#
# This feature is only available in GoReleaser Pro.
# footer:
# # Loads from an URL.
# from_url:
# # Templates: allowed.
# url: https://foo.bar/footer.md
# footers:
# x-api-token: "${MYCOMPANY_TOKEN}"

# # Loads from a local file.
# # Overrides `from_url`.
# from_file:
# # Templates: allowed.
# path: ./footer.md

# # You can change the name of the release.
# #
# # Default: '{{.Tag}}' ('{{.PrefixedTag}}' on Pro).
# # Templates: allowed.
# name_template: "{{.ProjectName}}-v{{.Version}} {{.Env.USER}}"

# You can disable this pipe in order to not create the release on any SCM.
# Keep in mind that this might also break things that depend on the release
# URL, for instance, homebrew taps.
#
# Templates: allowed.
disable: true

# Set this to true if you want to disable just the artifact upload to the SCM.
# If this is true, GoReleaser will still create the release with the
# changelog, but won't upload anything to it.
#
# Templates: allowed.
skip_upload: true

# You can add extra pre-existing files to the release.
# The filename on the release will be the last part of the path (base).
# If another file with the same name exists, the last one found will be used.
#
# Templates: allowed.
# extra_files:
# - glob: ./path/to/file.txt
# - glob: ./glob/**/to/**/file/**/*
# - glob: ./glob/foo/to/bar/file/foobar/override_from_previous
# - glob: ./single_file.txt
# name_template: file.txt # note that this only works if glob matches 1 file only

# Additional templated extra files to add to the release.
# Those files will have their contents pass through the template engine,
# and its results will be added to the release.
#
# This feature is only available in GoReleaser Pro.
# Templates: allowed.
# templated_extra_files:
# - src: LICENSE.tpl
# dst: LICENSE.txt

# # Upload metadata.json and artifacts.json to the release as well.
# include_meta: true
16 changes: 16 additions & 0 deletions adapters/adpaters.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package adapters

import (
"context"

"github.com/simulot/immich-go/internal/assets"
)

type Reader interface {
Browse(cxt context.Context) chan *assets.Group
}

type AssetWriter interface {
WriteAsset(context.Context, *assets.Asset) error
// WriteGroup(ctx context.Context, group *assets.Group) error
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 151 additions & 0 deletions adapters/folder/options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
package folder

import (
"fmt"
"strings"
"time"

cliflags "github.com/simulot/immich-go/internal/cliFlags"
"github.com/simulot/immich-go/internal/filenames"
"github.com/simulot/immich-go/internal/filetypes"
"github.com/simulot/immich-go/internal/filters"
"github.com/simulot/immich-go/internal/namematcher"
"github.com/spf13/cobra"
)

// ImportFolderOptions represents the flags used for importing assets from a file system.
type ImportFolderOptions struct {
// UsePathAsAlbumName determines whether to create albums based on the full path to the asset.
UsePathAsAlbumName AlbumFolderMode

// AlbumNamePathSeparator specifies how multiple (sub) folders are joined when creating album names.
AlbumNamePathSeparator string

// ImportIntoAlbum is the name of the album where all assets will be added.
ImportIntoAlbum string

// BannedFiles is a list of file name patterns to be excluded from the import process.
BannedFiles namematcher.List

// Recursive indicates whether to explore the folder and all its sub-folders.
Recursive bool

// InclusionFlags controls the file extensions to be included in the import process.
InclusionFlags cliflags.InclusionFlags

// // ExifToolFlags specifies options for the exif.
// ExifToolFlags exif.ExifToolFlags

// IgnoreSideCarFiles indicates whether to ignore XMP files during the import process.
IgnoreSideCarFiles bool

// Stack jpg/raw
StackJpgWithRaw bool

// Stack burst
StackBurstPhotos bool

// SupportedMedia is the server's actual list of supported media types.
SupportedMedia filetypes.SupportedMedia

// InfoCollector is used to extract information from the file name.
InfoCollector *filenames.InfoCollector

// ManageHEICJPG determines whether to manage HEIC to JPG conversion options.
ManageHEICJPG filters.HeicJpgFlag

// ManageRawJPG determines how to manage raw and JPEG files.
ManageRawJPG filters.RawJPGFlag

// BurstFlag determines how to manage burst photos.
ManageBurst filters.BurstFlag

// ManageEpsonFastFoto enables the management of Epson FastFoto files.
ManageEpsonFastFoto bool

// Tags is a list of tags to be added to the imported assets.
Tags []string

// Folder as tags
FolderAsTags bool

// SessionTag indicates whether to add a session tag to the imported assets.
SessionTag bool
session string // Session tag value

// TakeDateFromFilename indicates whether to take the date from the filename if the date isn't available in the image.
TakeDateFromFilename bool

// local time zone
TZ *time.Location
}

func (o *ImportFolderOptions) AddFromFolderFlags(cmd *cobra.Command, parent *cobra.Command) {
o.ManageHEICJPG = filters.HeicJpgNothing
o.ManageRawJPG = filters.RawJPGNothing
o.ManageBurst = filters.BurstNothing
o.Recursive = true
o.SupportedMedia = filetypes.DefaultSupportedMedia
o.UsePathAsAlbumName = FolderModeNone
o.BannedFiles, _ = namematcher.New(
`@eaDir/`,
`@__thumb/`, // QNAP
`SYNOFILE_THUMB_*.*`, // SYNOLOGY
`Lightroom Catalog/`, // LR
`thumbnails/`, // Android photo
`.DS_Store/`, // Mac OS custom attributes
`._*.*`, // MacOS resource files
)
cmd.Flags().StringVar(&o.ImportIntoAlbum, "into-album", "", "Specify an album to import all files into")
cmd.Flags().Var(&o.UsePathAsAlbumName, "folder-as-album", "Import all files in albums defined by the folder structure. Can be set to 'FOLDER' to use the folder name as the album name, or 'PATH' to use the full path as the album name")
cmd.Flags().StringVar(&o.AlbumNamePathSeparator, "album-path-joiner", " / ", "Specify a string to use when joining multiple folder names to create an album name (e.g. ' ',' - ')")
cmd.Flags().BoolVar(&o.Recursive, "recursive", true, "Explore the folder and all its sub-folders")
cmd.Flags().Var(&o.BannedFiles, "ban-file", "Exclude a file based on a pattern (case-insensitive). Can be specified multiple times.")
cmd.Flags().BoolVar(&o.IgnoreSideCarFiles, "ignore-sidecar-files", false, "Don't upload sidecar with the photo.")

cmd.Flags().StringSliceVar(&o.Tags, "tag", nil, "Add tags to the imported assets. Can be specified multiple times. Hierarchy is supported using a / separator (e.g. 'tag1/subtag1')")
cmd.Flags().BoolVar(&o.FolderAsTags, "folder-as-tags", false, "Use the folder structure as tags, (ex: the file holiday/summer 2024/file.jpg will have the tag holiday/summer 2024)")
cmd.Flags().BoolVar(&o.SessionTag, "session-tag", false, "Tag uploaded photos with a tag \"{immich-go}/YYYY-MM-DD HH-MM-SS\"")

cliflags.AddInclusionFlags(cmd, &o.InclusionFlags)
cmd.Flags().BoolVar(&o.TakeDateFromFilename, "date-from-name", true, "Use the date from the filename if the date isn't available in the metadata (Only for .jpg,mp4,.heic,.dng,cr2,.cr3,).")

// exif.AddExifToolFlags(cmd, &o.ExifToolFlags) // disabled for now

if parent != nil && parent.Name() == "upload" {
cmd.Flags().Var(&o.ManageHEICJPG, "manage-heic-jpeg", "Manage coupled HEIC and JPEG files. Possible values: KeepHeic, KeepJPG, StackCoverHeic, StackCoverJPG")
cmd.Flags().Var(&o.ManageRawJPG, "manage-raw-jpeg", "Manage coupled RAW and JPEG files. Possible values: KeepRaw, KeepJPG, StackCoverRaw, StackCoverJPG")
cmd.Flags().Var(&o.ManageBurst, "manage-burst", "Manage burst photos. Possible values: Stack, StackKeepRaw, StackKeepJPEG")
cmd.Flags().BoolVar(&o.ManageEpsonFastFoto, "manage-epson-fastfoto", false, "Manage Epson FastFoto file (default: false)")
}
}

// AlbumFolderMode represents the mode in which album folders are organized.
// Implement the interface pflag.Value

type AlbumFolderMode string

const (
FolderModeNone AlbumFolderMode = "NONE"
FolderModeFolder AlbumFolderMode = "FOLDER"
FolderModePath AlbumFolderMode = "PATH"
)

func (m AlbumFolderMode) String() string {
return string(m)
}

func (m *AlbumFolderMode) Set(v string) error {
v = strings.TrimSpace(strings.ToUpper(v))
switch v {
case string(FolderModeFolder), string(FolderModePath):
*m = AlbumFolderMode(v)
default:
return fmt.Errorf("invalid value for folder mode, expected %s, %s or %s", FolderModeFolder, FolderModePath, FolderModeNone)
}
return nil
}

func (m AlbumFolderMode) Type() string {
return "folderMode"
}
Loading