Commit Graph

629 Commits

Author SHA1 Message Date
Googol Lee
701e3379ea Add orientation tests. (#1249) 2025-07-19 16:29:42 +02:00
Googol Lee
69915575d5 Add blurhash task, instead of a global blurhash generating. (#1250) 2025-07-18 15:37:51 +02:00
Googol Lee
50209bc55c Fix the coverage for codecov. (#1251) 2025-07-18 15:21:03 +02:00
Kostiantyn
d7cc42ed6e Bump several API deps (#1247)
Co-authored-by: Konstantin Koval
2025-07-18 11:43:41 +03:00
Kostiantyn
124b6d34a9 Auto-orient image during processing (#1242)
* Auto-orient image during processing

* Detect if thumb was rotated 90 degrees and switch dimentions

* Consistently auto-rotate images

* fix incorrect path for the original photo dimensions reading

* Swap the dimensions if needed and call the `wand.ThumbnailImage()` unconditionally

* revert unnecessary line split

---------

Co-authored-by: Konstantin Koval
2025-07-11 13:21:28 +03:00
Googol Lee
06d2e05ae4 Non-fork face detection, avoiding a race condition. (#1243)
* Non-fork face detection, avoiding a race condition.

* Update scanner test.
2025-07-11 11:16:41 +02:00
Googol Lee
6aca4fe2f9 Fix scanner test. (#1241) 2025-07-09 22:25:44 +02:00
Googol Lee
3f57330a6e Make TaskContext as context.Context. (#1232) 2025-07-01 19:30:31 +02:00
Kostiantyn
029bf280e5 Bump GQLparser and GQLgen deps in API (#1234)
Co-authored-by: Konstantin Koval
2025-06-30 22:53:20 +03:00
dependabot[bot]
7067e1097c Bump github.com/go-viper/mapstructure/v2 (#1230)
Bumps the go_modules group with 1 update in the /api directory: [github.com/go-viper/mapstructure/v2](https://github.com/go-viper/mapstructure).


Updates `github.com/go-viper/mapstructure/v2` from 2.2.1 to 2.3.0
- [Release notes](https://github.com/go-viper/mapstructure/releases)
- [Changelog](https://github.com/go-viper/mapstructure/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-viper/mapstructure/compare/v2.2.1...v2.3.0)

---
updated-dependencies:
- dependency-name: github.com/go-viper/mapstructure/v2
  dependency-version: 2.3.0
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-30 17:32:27 +03:00
Googol Lee
36edc2534c Change default thumbnail of album. (#1225) 2025-06-30 11:05:48 +02:00
Googol Lee
0192e4e640 Drop tables instead of truncating tables. (#1224) 2025-06-26 22:19:09 +02:00
Kostiantyn
73ae3e8132 Bump API deps to versions, released this week (#1220)
Co-authored-by: Konstantin Koval
2025-06-20 11:39:07 +03:00
Kostiantyn
2b1240b88b Refactor API video route (#1202)
* Refactored code; temp disable workflows on push

* remove printf leftovers

* A better sanitizing code

* extend auth routes tests

* more tests, fix 2 bugs in token processing

* more refactoring and fixes

* optimize video mediaURLs DB query and make testCachePath in utils thread-safe

* fix always passing test

* and more refactoring; 1 more test, but cleanup still has to be fixed

* more debug code in the test

* fix the test

* Final commit

* Adding a defer function just in case of panic

* Address some of review comments

* Protect the shared var by mutex; implement correct context-aware scanning

* Better error; better initial func wrap/capture; better log messages in `photos.go`;

* Addressing a few more review comments

* Order the query results; a better error type catch; setting the MP4 content type header explicitly

* try to fix the cancelation detection condition

* Extract a function and call it by name

---------

Co-authored-by: Konstantin Koval
2025-06-18 20:38:19 +03:00
Kostiantyn
9369f72d3b Bump API deps from last 2 weeks (#1218)
Co-authored-by: Konstantin Koval
2025-06-13 20:58:03 +03:00
Kostiantyn
a22967b7d0 Refactor the Periodic Scanner module (#1210)
* Initial fix of a race condition

* better logging

* some refactoring and graceful shutdown

* fix more potential race condition places; a better app shutdown

* add test and fix some issues

* some housekeeping

* more descriptive asserts

* Address review suggestions

* Better server shutdown logic + better message about the .env file not found

* Create context inside the shutdown goroutine; removed unnecessary shutdown from the main function

* Move HTTP server to the main process and remove unnecessary code

* log shutdown error if any

* Get back to the local `scanner` variable

* Protecting scanner with mutex

* Adding the mutex to the shutdown function

* Addressing the race condition at the init stage

---------

Co-authored-by: Konstantin Koval
2025-06-11 17:09:22 +03:00
Googol Lee
0da8bef69e Update log for passing attrs with context. (#1216)
* Update log for passing attrs with context.

* Check type-casting

* add tests.

* Use t.Cleanup() to restore the global value.

* Fix error.

* Update tests.

* Add comments.

* Remove cover.cov

* Update doc.

* Update git ignore.
2025-06-07 17:11:50 +02:00
marc7s
1d1305628a Add multiple face group merge support (#1162)
* Migrate multiple merge faces code from merge-multiple branch

* Revert translations

* Remove unnecessary node

* Add aria labels

* Code review changes

* Add frontend test for MergeFaceGroupsModal
2025-06-07 10:21:02 +03:00
Googol Lee
535f8e57fd Use Magickwand to handle images. (#1212)
* Add MagickWand perf test.

* Use MagickWand.

* Calculate the right thumbnail dimension.

* Remove magick bin file.

* Add building dependencies.

* Build images.

* Add --no-install-recommends

* Remove unused field.

* Fix typo

* Use uint in the worker.

* Add guard

* Always update apt.

* Fix EncodeJpeg() with the quality

* Rename the local error with a better name.

* Add worker.Terminate()

* Fix typo

* Rebase with master and rollback the build workflow.
2025-06-03 22:04:03 +02:00
Kostiantyn
c390f83355 Bump gorm and its postgres driver to the latest versions (#1215)
Co-authored-by: Konstantin Koval
2025-06-02 11:51:02 +03:00
Googol Lee
a378522af4 Use magick generating thumbnails.
Fix #1204

* Add bad medias to scanner_test.

* Fix the script.

* Add GenerateThumbnail function.

* Add identify dimension

* Use new API. Cover json condition.

* Use magick to generate thumbnails.

* Update go mod.

* Remove dependency of executable_worker -> test_utils

* Reduce dependency of magick.

* Use magick to get dimension.

* Remove almost all code around `image` package.

* Fix thumbnailing with multi-frame gif.

* Remove the struct in wrapper.

* Fix typo.

* Build images.

* Update logs

* Add jpeg decoder.

* Remove code dependency.

* Add log to confirm scan in parallel.

* Update log

* Add reformat image perf tests.

* Rollback the build workflow.
2025-05-22 09:01:43 +02:00
Kostiantyn
a1aadf678d Bump several API dependencies to their latest versions (#1203)
Co-authored-by: Konstantin Koval
2025-05-11 12:08:58 +03:00
Googol Lee
fe3cc16026 Remove Thumbnail Preferences. (#1200)
* Remove thumbnail preferences. #1089

* Remove thumbnail preferences test.

* Remove thumbnail preferences from backend.

* Fix database.go

* Update generated TS files.

* Reorder the migrations.
2025-05-11 10:44:58 +02:00
Kostiantyn
27a0b082d1 Handle photo not found case in API routes (#1201)
* Handle media not found issue

* temporary run workflows for master pushes only; tests

* revert temp workflow changes

---------

Co-authored-by: Konstantin Koval
2025-05-10 17:45:32 +03:00
Kostiantyn
36f3924b4f Bump GQLgen, GQLparser and GORM versions in API (#1197)
* Bump GQLparser and GORM versions in API

* Bump GQLgen as well

* Revert GORM update

---------

Co-authored-by: Konstantin Koval
2025-05-05 18:14:59 +03:00
Kostiantyn
5d46478c01 Fix the incorrect thumbnails for albums issue (#1198)
* The fix with test

* Fix test's foreign key issue

* 2 more test cases

* Fix the empty album test expectation

* Return Nil for no thumbnail case instead of an empty album, as expected by frontend. More tests for thumbnail priority choice

* Fix failed tests

---------

Co-authored-by: Konstantin Koval
2025-05-03 18:48:57 +03:00
Googol Lee
07be0af1c2 Add more real media files to scanner_test (#1195)
* Add real_media to scanner tests.

* Fix tests.

* Remove old test files.

* Fix with reviews.
2025-04-28 11:10:32 +02:00
Peter Dave Hello
cda043ddb8 Add a basic zh-TW Traditional Chinese translation (#1187) 2025-04-22 19:09:49 +03:00
Kostiantyn
0961984134 Bump gqlgen and gqlparser versions in API (#1191)
* Bump `gqlgen` and `gqlparser` versions in API

* new gqlgen version

---------

Co-authored-by: Konstantin Koval
2025-04-21 22:54:49 +03:00
Kostiantyn
18360e71ae Bump several deps to the latest versions (#1189)
Co-authored-by: Konstantin Koval
2025-04-15 12:59:15 +03:00
Kostiantyn
862ac5af39 Bump gqlgen to 0.17.70 (#1184)
Co-authored-by: Konstantin Koval
2025-03-27 20:46:14 +02:00
Kostiantyn
0f19345d86 Bump several GO dependencies to the latest versions (#1182)
Co-authored-by: Konstantin Koval
2025-03-22 22:20:24 +02:00
Googol Lee
e4d5345d56 scan_test now checks title and face groups explicitly instead of only lengths. (#1180) 2025-03-11 20:20:07 +01:00
marc7s
d1636fb7ea Fix album page being empty for users with overlapping paths (#1159)
* Fix album page being empty for users with overlapping paths, closes #658

* Add test for non root album paths

* Add basic test for non root album path
2025-03-11 18:01:50 +02:00
Kostiantyn
736eb1c051 Bump crypto, fixing its CVE vulnerability (#1177)
* Bump `crypto`, fixing its CWE vulnerability

* Bumping several deps for this week

---------

Co-authored-by: Konstantin Koval
2025-03-11 17:45:33 +02:00
Kostiantyn
c4d183627d Bump github.com/go-sql-driver/mysql and golang.org/x/crypto to the latest versions (#1174)
Co-authored-by: Konstantin Koval
2025-02-22 21:11:43 +02:00
Googol Lee
06acd165f2 Bump golang from 1.23-bookworm to 1.24-bookworm, as well as gqlgen. (#1172)
* Bump golang from 1.23-bookworm to 1.24-bookworm

Bumps golang from 1.23-bookworm to 1.24-bookworm.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update to use `go tool`, see https://go.dev/doc/go1.24#go-command.

* Update go.mod to go 1.24

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-17 18:45:30 +01:00
Kostiantyn
ba6a4ec07c Bump crypto and sys dependencies to new minor versions (#1170)
Co-authored-by: Konstantin Koval
2025-02-16 11:43:09 +02:00
Kostiantyn
d9627c2aef Bump x/image, x/text, and x/sync to their latest minor versions (#1167)
Co-authored-by: Konstantin Koval
2025-02-13 14:45:02 +02:00
Andreas
6d716a1f1e improved Thumbnail generation performance (#1158)
* improved Thumbnail generation performance

* unified SQL query style

* adjusted query

* changed query to make it more readable
2025-02-02 21:43:12 +02:00
Kostiantyn
b93d48f94e Bump gqlgen and gqlparser to the latest versions (#1166)
Co-authored-by: Konstantin Koval
2025-02-02 20:51:17 +02:00
Kostiantyn
bdb2aef669 Bump gqlgen, copy, crypto, mint, sys deps to the latest versions in API (#1156)
Co-authored-by: Konstantin Koval
2025-01-19 21:53:50 +02:00
Googol Lee
e045e0f7ae Fix sqlite fk configuration and enable all tests for sqlite. Enable detail SQL log in tests (#1151)
* Fix sqlite fk configuration and enable all tests for sqlite.

* Add default severity to golangci-lint config.
2025-01-02 23:02:19 +01:00
Kostiantyn
33ef0981d7 Bump gqlparser to the latest minor version (#1149)
Co-authored-by: Konstantin Koval
2025-01-02 18:31:24 +02:00
Kostiantyn
9835c1949d Bump gqlgen in API to the latest version and regenerate the code (#1147)
Co-authored-by: Konstantin Koval
2024-12-30 17:17:06 +02:00
Googol Lee
f88fcaba69 Use libmagic to identify files type. (#1124)
* Use libmagic to identify file types.

* Fix mime array for database querying.

* go mod tidy

* Fix typo

* Another fix for the scheduled image build workflow for tag case (#1137)

* Try to fix the incorrect tag processing

* more debug code

* try with context=git

* hopefully, final debug

* the final commit with no debug code

---------

Co-authored-by: Konstantin Koval

* Add benchmark.

* rollback workflows.

* Fix AI comments.

* Build image.

* Fix AI comments.

* Fix AI comments.

* Rollback build workflow.

---------

Co-authored-by: Kostiantyn <32730812+kkovaletp@users.noreply.github.com>
2024-12-14 22:07:03 +01:00
Kostiantyn
f1d4d0a048 Bump crypto, go-ffprobe, and sqlite GO dependencies in /api (#1140)
Updated dependencies for improved performance and security:
- golang.org/x/crypto to version v0.31.0
- gopkg.in/vansante/go-ffprobe.v2 to version v2.2.1
- gorm.io/driver/sqlite to version v1.5.7

Co-authored-by: Konstantin Koval
2024-12-14 20:56:44 +02:00
Kostiantyn
3c53ccc304 Bump several API dependencies to the latest versions (#1138)
* Bump several API dependencies to the latest versions

Bump github.com/stretchr/testify from 1.9.0 to 1.10.0 in /api
Bump github.com/vektah/gqlparser/v2 from 2.5.19 to 2.5.20 in /api
Bump gorm.io/driver/postgres from 1.5.10 to 1.5.11 in /api
Bump golang.org/x/image from 0.22.0 to 0.23.0 in /api
Bump golang.org/x/crypto from 0.29.0 to 0.30.0 in /api
Bump github.com/99designs/gqlgen from 0.17.56 to 0.17.57 in /api

* Regenerate GraphQL code

---------

Co-authored-by: Konstantin Koval
2024-12-06 16:20:48 +02:00
Googol Lee
f1b523a27e Include a group of small but real media files for testing. (#1131)
* Move scanner/test_data/* to a stand-alone directory.

* Include real medias.

* Rename testdata to test_data

* Rename test_data/scanner -> test_data/library

* Clean tests to avoid depneding env.

* Rename: scanner/test_data -> scanner/test_media

* Rename: test_data/bin -> test_data/mock_bin

* Fix paths in tests.
2024-11-23 09:02:11 +01:00
Kostiantyn
dde45c29b9 Bump gorm.io/driver/postgres from 1.5.9 to 1.5.10 in /api (#1135)
Co-authored-by: Konstantin Koval
2024-11-22 13:51:15 +02:00