Commit Graph

192 Commits

Author SHA1 Message Date
Jakub Tymejczyk
a2170bc02b Fixes issue 804 2023-02-28 15:33:02 +01:00
john dev
15e3cc3b8c Add support to parse DateTImes with UTC offset 2023-02-15 08:29:41 +01:00
WindLi001
0ac38e6605 Limit thumbnail size of small original photo 2023-02-10 12:53:25 +08:00
Lajos Koszti
1f8664d7f8 fix transaction already commited error
I encountered with the following error:

> 2023/02/05 07:33:00 /app/scanner/face_detection/face_detector.go:92 sql: transaction has already been committed or rolled back
> [0.042ms] [rows:0] SELECT * FROM `media` WHERE `media`.`id` = 823 ORDER BY `media`.`id` LIMIT 1
> 2023/02/05 07:33:00 ERROR: Error detecting faces in image (/photos/Borzsony2017/DSC_0028.NEF): sql: transaction has already been committed or rolled back

It turned out it comes from the api/routes/photos.go

I found a very similar code in album_scanner.go.
The difference I saw was that while in the single photo request the
transaction passed to the `scanner_tasks.Tasks.BeforeProcessMedia` call,
in the album_scann.go the transaction created after this call and
created from the context which returned by `BeforeProcessMedia`.

Another difference was that in the `ProcessSingleMedia` call the
`AfterProcessMedia` call was called with the same - db transaction -
context, in the album_scanner it was called outside of the transaction.

I changed the logic by merging the two behavior:
Create the transaction from the context of `BeforeProcessMedia` and also
use the transaction context in the `AfterProcessMedia`.
After the change the error disappeared.

So to have it in a common place I extracted that logic into a function
and use for both the single photo request and in the album scanner.

I did not go more deeper to find out what's going on with the context
under the hood.
2023-02-05 09:05:05 +01:00
PJ-Watson
5c1bbf9065 Fixed ScanAlbum failing silently.
2.3.12 -> 2.3.13 restructured ScanAlbum so that errors were returned rather than raising a ScannerError directly - this ensures that the errors are logged correctly.
2022-08-12 02:18:59 +01:00
PJ-Watson
7715865309 Add support for .CR3 photos. 2022-08-10 07:43:39 +01:00
PJ-Watson
3e780dbe48 Changed downsampling method to custom type. 2022-08-09 06:09:55 +01:00
PJ-Watson
5c4eeef870 Introduce thumbnail filtering options. 2022-08-05 19:37:55 +01:00
viktorstrate
831e24f654 Fix API tests 2022-07-08 17:44:03 +02:00
viktorstrate
a5d152f0c0 Make scanner tasks share ctx 2022-07-07 22:00:05 +02:00
viktorstrate
f512db6c32 Merge branch 'master' into rework-scanner-internals 2022-07-07 19:58:30 +02:00
viktorstrate
447f05185f Fix scanner queue tests 2022-03-28 18:43:00 +02:00
James Cross
501c50e259 Adding image description to sidebar 2022-03-28 16:08:30 +01:00
viktorstrate
b09d32019e Make it compile again 2022-03-02 17:26:06 +01:00
viktorstrate
6e2a64bc77 WIP: split up scanner into separate tasks 2022-02-15 17:22:41 +01:00
viktorstrate
6361df1793 Start on big scanner code refactoring 2022-02-14 23:57:45 +01:00
viktorstrate
ee5c113c32 Add EXIF modify dates as a fallback for create dates 2022-02-07 17:57:10 +01:00
viktorstrate
f2f75c03b3 Add more keys for potential create dates to exiftool 2022-02-07 17:44:45 +01:00
viktorstrate
0d9760b33f Integrate blurhashes with UI 2022-02-01 23:39:19 +01:00
viktorstrate
b4ad1c4f88 Add blurhash generation 2022-02-01 22:02:08 +01:00
viktorstrate
e509124510 Disable 'media already scanned' logs 2021-11-21 11:41:52 +01:00
viktorstrate
12085698c8 Refactoring + disable cleanup tests for sqlite 2021-11-06 15:41:25 +01:00
viktorstrate
6545a04225 Add tests for modifying media on disk 2021-11-06 13:30:23 +01:00
viktorstrate
0618b70110 Enable foreign keys for sqlite 2021-11-06 13:23:59 +01:00
viktorstrate
c48ede175a Fix exif circular imports in tests 2021-11-06 13:01:01 +01:00
viktorstrate
3040daafb6 Fix tests 2021-11-06 12:38:05 +01:00
viktorstrate
b467f2ca61 Add failing test for #198 2021-11-06 12:23:47 +01:00
viktorstrate
521b121613 Hide faces from frontend if disabled 2021-08-31 12:05:46 +02:00
viktorstrate
9bcfdbb2cd Add environment variables to disable features
Face detection still needs to be hidden on the frontend if it's disabled
2021-08-31 11:34:55 +02:00
Théa Grondier
9365cf0f78 Linting 2021-08-22 23:46:17 +02:00
Théa Grondier
2dadca5e1e Fix: Correctly display counterpart JPGs for RAWs 2021-08-22 17:18:36 +02:00
Marco Herrn
fe9e2752df Treat symlinks to directories like directories
It seems that the first try was not enough. Now symlinks should be
 detected in all cases.
2021-07-20 20:39:11 +02:00
Marco Herrn
0129cb7703 Treat symlinks to directories like directories
This allows symlinking to create additional subalbums.

Closes: #431
2021-07-16 13:48:29 +02:00
Marco Herrn
7c993832ec Add support for Matroska (MKV) video container 2021-07-12 11:36:23 +02:00
Dhole
3de9282fba Sanitize float values in EXIF fields
Read exposure as rational in EXIF internal parser
2021-05-19 13:53:34 +02:00
viktorstrate
049a06302a Add unit tests for scanner media_type 2021-05-06 22:25:17 +02:00
viktorstrate
b022a13e55 Batch exiftool runs + scanner package restructuring 2021-05-06 22:01:48 +02:00
viktorstrate
542e5c8532 Improve scanner_album NewRootPath tests 2021-04-26 20:37:29 +02:00
viktorstrate
253f126aaf Add scanner_album tests 2021-04-26 15:07:06 +02:00
viktorstrate
1029b61a4c Fix faces not getting scanned
- This fixes #344
- Add integration tests for face recognition
- Properly check that the user own the queried album
2021-04-26 12:21:15 +02:00
viktorstrate
d03923992c clean up api log prints 2021-04-26 10:26:54 +02:00
viktorstrate
3073cfb953 Attempt to fix clear db for mysql 2021-04-24 19:28:20 +02:00
viktorstrate
761db0639d Add simple scanner integration test 2021-04-24 18:51:21 +02:00
viktorstrate
60f8a68bf6 Implement database integration tests 2021-04-23 15:10:23 +02:00
viktorstrate
dc8325bd4a Extend exif tests 2021-04-22 22:46:52 +02:00
viktorstrate
88a9d705a9 Add integration tests for exif parsers 2021-04-22 21:37:59 +02:00
viktorstrate
084d9bfef7 Cleanup logs and external exif parser 2021-04-11 22:55:44 +02:00
viktorstrate
ceb8c4103f Fix exiftool detection 2021-04-03 21:39:32 +02:00
viktorstrate
95c174d3a5 Setup husky hooks for api 2021-04-03 17:49:18 +02:00
Kjeldgaard
3bde799fb3 Fix log bug
Fix log bug, exposure time is now float and not string.

Signed-off-by: Kjeldgaard <Kjeldgaard@users.noreply.github.com>
2021-03-31 23:43:44 +02:00