43 Commits

Author SHA1 Message Date
Googol Lee
0192e4e640 Drop tables instead of truncating tables. (#1224) 2025-06-26 22:19:09 +02: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
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
f8b9590aa9 Refactoring part 2.1: Long func refactoring in database (#1073)
* Split long functions and optimize code

* Replace `errors.Wrap()` with the `fmt.Errorf()`; rename `process*()` functions to `parse*()`

---------

Co-authored-by: Konstantin Koval
2024-10-04 16:49:41 +03:00
Kostiantyn
d1193c5ca4 Refactoring part 1: Fix some annoying linter warnings in API code (#1064)
* names, constants of reusable strings, removed unneeded `if`, replaced deprecated imports

* more deprecated imports replaced

* What is this?))

* Fix a path and quote a var in Dockerfile

* Addressing review comments

---------

Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-09-30 14:45:02 +02:00
Kostiantyn
df9af39a16 Validate incoming GPS data (#951)
* Validate incoming GPS data and throw an error if it is incorrect, storing Null values

* Extracted GPS data processing to function in external parser; optimized IF in internal parser; removed unnecessary comments; set exact values for positive test

* Add the migration for removing existing invalid GPS data and its test; added better errors to asserts in the GPS validation test

* Install FFmpeg and ExifTool on the API unit-test environment

* Fix 'stripped.jpg', 'IncorrectGPS.jpg', and 'CorrectGPS.jpg' tests for the external parser

* Optimized data validation in the external parser, returned error by the internal parser for invalid data, updated test to expect errors and handle them

* Switched from error to log entry in case of incorrect GPS data, as error handling is not so transparent in the internal parser

---------

Co-authored-by: Konstantin Koval
2024-06-29 10:32:48 +03:00
Kostiantyn
d47bca280e configure SQLite to work in multi-connection mode, so it is not locked when scanner runs a job (#955)
Co-authored-by: Konstantin Koval <kkb@ukr.net>
2024-05-31 09:32:47 +01:00
Jordan Hellier
4133694bc2 fix: remove logging of database url in place for just dialect (#940) 2024-04-27 13:18:56 +01:00
viktorstrate
12085698c8 Refactoring + disable cleanup tests for sqlite 2021-11-06 15:41:25 +01:00
viktorstrate
0618b70110 Enable foreign keys for sqlite 2021-11-06 13:23:59 +01:00
viktorstrate
542e5c8532 Improve scanner_album NewRootPath tests 2021-04-26 20:37:29 +02:00
viktorstrate
3073cfb953 Attempt to fix clear db for mysql 2021-04-24 19:28:20 +02:00
viktorstrate
ed02e90338 Attempt to fix clear db 2021-04-24 19:21:10 +02:00
viktorstrate
d09d5f6ca0 Improve codeql action + fix test db clean 2021-04-24 19:12:45 +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
bbb12003fc Fix #299 and #300 2021-04-13 22:15:47 +02:00
viktorstrate
b6a85d0966 Finish localization
- Add user preferences section to settings
- Make settings page available for all users
- Move log out button to settings page
- Make it possible for each user to choose their desired language
2021-04-11 22:31:42 +02:00
viktorstrate
ad60eccf8b Add database migrations for exif values 2021-04-03 21:20:02 +02:00
viktorstrate
43f89d1929 Update mysql dsn parser
to parse passwords with special characters properly
2021-02-26 13:57:13 +01:00
viktorstrate
abb80ae425 Start on face detection 2021-02-15 17:35:28 +01:00
viktorstrate
35b41e1b56 Database migrator remove media.date_imported 2021-02-13 16:53:02 +01:00
András Maróy
dca81c7918 Don't log postgres password when connecting 2021-01-31 18:53:38 +01:00
András Maróy
be83849bee Implement postgres support 2021-01-31 17:07:29 +01:00
stz184
8b4e2192c2 Fixes photoview/issues#168
- Removed unnecessary migration.
2021-01-30 17:55:12 +02:00
stz184
f723bda7c5 Fixes photoview/issues#168
- Migrated mediaGeoJson resolver to GORM
- Fixed issue loading media list in MediaList() function
- Fixed typo in the column "gps_lonitude" (renamed to "gps_longitude")
2021-01-29 01:23:40 +02:00
viktorstrate
4bc50583d2 Add db max open connections again 2021-01-19 16:59:10 +01:00
viktorstrate
dcca5becb5 Rewrite db retry to reconfigure database on error 2021-01-19 15:49:03 +01:00
viktorstrate
52e8013026 Fix sql compatibility problem when running in Docker 2021-01-17 18:12:32 +01:00
viktorstrate
107da91700 Refactor handling of environment variables 2021-01-17 16:50:48 +01:00
viktorstrate
50d0aa0efb Disable multithreaded scanners for sqlite
as it's not reliable
2021-01-17 13:08:44 +01:00
viktorstrate
fcdb5b4e7b Work on sqlite support 2021-01-17 12:45:23 +01:00
viktorstrate
f711da4d9c Merge branch 'v2.0.0' into v2/multi-database-support 2021-01-17 12:21:32 +01:00
Vladimir Ivanov
85ce3a1018 Update api/database/database.go
Co-authored-by: Viktor Strate Kløvedal <viktorstrate@gmail.com>
2021-01-16 19:35:02 +02:00
stz184
5b7637cb3c Added db connection retry logic 2021-01-12 20:14:28 +02:00
viktorstrate
41b122c461 Start on sqlite support
- TODO: Sqlite doesn't support MD5, all calls to this function should be done
  beforehand.
2021-01-10 18:59:01 +01:00
viktorstrate
732ccd05ab restructure user <-> albums relations in database 2020-12-20 17:10:00 +01:00
viktorstrate
907894dda3 Merge branch 'master' into v2.0.0 2020-12-17 23:18:00 +01:00
viktorstrate
f0d580116b Improve album and media resolvers 2020-12-08 16:24:08 +01:00
viktorstrate
98f13d76e6 Replace database, work on scanning 2020-11-30 21:29:49 +01:00
viktorstrate
177ae91500 Replace database, mostly video 2020-11-25 23:06:47 +01:00
viktorstrate
2e9aa29258 Replace database, mostly media related 2020-11-23 20:43:00 +01:00
viktorstrate
3c23f82330 Replace database, mostly album related 2020-11-23 19:59:01 +01:00