Commit Graph

61 Commits

Author SHA1 Message Date
Carl Schwan a213e6bb1d Merge pull request #61011 from nextcloud/carl/cleanup-preview
fix(preview): First cleanup from filecache and then from preview table
2026-06-23 11:08:57 +02:00
Carl Schwan 09aea6312b fix(preview): Don't abort cleanup of previews too early
If we don't find previews in the filecache, this is now normal. Don't
abort and instead delete previews from the new preview table instead.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-22 16:35:33 +02:00
Benjamin Gaussorgues dc5499af46 feat(jobs): clean old job runs
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-06-12 13:53:10 +02:00
Benjamin Gaussorgues 3956e292b4 feat(jobs): add cleanup job for job run history
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-06-12 13:53:10 +02:00
Benjamin Gaussorgues 60ce92a697 feat(utils): add getter for serverid with proper default
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
2026-06-12 13:53:10 +02:00
Carl Schwan fc4938c3ed fix(preview): Better handle errors while migrating previews
Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-06-08 14:44:01 +02:00
Côme Chilliet 1ab09ec753 chore: Apply new coding standard to all files
The diff can be checked using: git diff --ignore-all-space --ignore-blank-lines
To see only the changes not related to blank lines.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2026-06-01 13:46:39 +02:00
Ferdinand Thiessen 27c7164e86 chore: add psalm-api to for classes we need to mock in unit tests
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-28 23:52:43 +02:00
Ferdinand Thiessen 20acaf307e chore: add missing Override attribute to core code
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2026-04-28 21:29:28 +02:00
Carl Schwan fbf84e6473 chore: Replace MoveableMount usage with IMovableMount
The former is private API while the IMovableMount is public.

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-04-24 10:14:37 +02:00
Joas Schilling 5f80f26799 chore: Fix SPDX header
Signed-off-by: Joas Schilling <coding@schilljs.com>
2026-03-16 08:38:16 +01:00
provokateurin fe9e43c165 feat(preview): Expire previews
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-10 15:35:38 +01:00
Carl Schwan 6149168129 feat(preview): On demand preview migration
When requesting previews, which we don't find in oc_previews, search in
IAppData first before creating them.

Move the logic from MovepreviewJob to PreviewMigrationService and reuse
that in the Preview Generator.

At the same time rename MovePreviewJob to PreviewMigrationJob as it is a
better name.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-01-12 14:20:09 +01:00
Carl Schwan 7c1a8a4060 feat: Adapt a bit the snowflake ids API
- Rename setId() -> generateId() in SnowflakeAwareEntity

Signed-off-by: Carl Schwan <carlschwan@kde.org>
2026-01-06 12:57:17 +01:00
Anna Larch 5f797ebc32 refactor: move existing usages of snoflake IDs SnowflakeAwareEntity
Signed-off-by: Anna Larch <anna@nextcloud.com>
2026-01-06 12:57:17 +01:00
Anna Larch f546daada7 refactor: Rename Snowflake Generator and Decoder
And introduce the Snowflake DTO

Signed-off-by: Anna Larch <anna@nextcloud.com>
2026-01-06 12:57:04 +01:00
Carl Schwan 4d47fdaa85 chore: Run rector with new rules for fetch
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-11-18 17:45:57 +01:00
Carl Schwan 336cc3fa35 feat(Db): Use SnowflakeId for previews
Allow to get an id for the storing the preview on disk before inserting
the preview on the DB.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-28 17:50:03 +01:00
Carl Schwan bef3996c3e fix(preview): Make version column a string
And move it to a different table so that we don't have to pay the
storage cost when not using it (most of the times).

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-08 14:07:06 +02:00
Carl Schwan 66f50bd585 refactor(preview): Use same mimetype ids as filecache
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan bd001c9524 refactor: Use Override annotation in new preview code
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan 58023782b6 feat(preview): Store original file mimetype in preview table
Allow to quickly query all the files from a specific mimetype like in
the ResetRenderedTexts command.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan bfc7d5dd9f feat(preview): Implement scanning for previews
This work similarly to the move preview job to migrate the previews to
the new DB table and also reuse some code.

So when we are finding files in appdata/preview, try adding them to the
oc_previews table and delete them from the oc_filecache table.

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan 324b54b863 refactor(preview): Cleanup the implementation of the new preview backend
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan 6f56dcf73e fix(preview): Fix some tests
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan b0357663b9 perf(preview): Optimize migration and simplify DB layout
* Simplify migration by not moving the actual files and just updating
  the DB
* Don't store the storageid in the preview table as it is not needed
* Start adding tests

Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan 6008852232 feat(preview): Support multibucket storage
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan 13c35c0f17 perf(preview): Migrate previews to the new optimized table
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-06 13:37:15 +02:00
Carl Schwan ce02a5b27c refactor: Port away from search
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-10-01 16:32:22 +02:00
Richard Steinmetz 05613984bb fix: calculate node limit using MiB instead of MB
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2025-09-08 15:11:05 +02:00
Carl Schwan ef5edb6801 fix(psalm): Fix ParamNameMismatch with Job::run
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2025-08-29 14:31:39 +02:00
provokateurin 82fb8f8508 refactor: Extend rector to core/
Signed-off-by: provokateurin <kate@provokateurin.de>
2025-05-15 00:16:54 +02:00
Ferdinand Thiessen 072d4e8cba chore: move implementation from OC legacy to OCP\Files
- move implementation to the OCP variant that called the legacy before
- add the missing deprecation notice
- add missing parameter to align both signatures
- use OCP\Files where this method is still used

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-05-14 14:55:45 +02:00
Ferdinand Thiessen 712fe45f46 fix(lookup-server): Only flag new users for lookup update / delete
If the flag was already set then we do not need to overwrite it.

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2025-03-11 09:28:33 +01:00
Louis Chemineau 6744accdd9 chore: Run cs:fix
Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-06 11:09:22 +01:00
Josh cd6ac0470e fix(updater): make clean-up job more robust / easier to debug
Signed-off-by: Josh <josh.t.richards@gmail.com>
2025-02-06 11:09:21 +01:00
provokateurin 54ec472d9a fix(BackgroundJobs): Adjust intervals and time sensitivities
Signed-off-by: provokateurin <kate@provokateurin.de>
2024-10-08 11:26:53 +02:00
Daniel Kesselberg af6de04e9e style: update codestyle for coding-standard 1.2.3
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
2024-08-25 19:34:58 +02:00
Git'Fellow 2ea6713504 fix: Max file size for metadata generation
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
Co-Authored-By: Louis <louis@chmn.me>
Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
2024-08-05 08:48:15 +02:00
Louis Chemineau f00acebf93 fix(files_metadata): Don't run generation job on every upgrade
Signed-off-by: Louis Chemineau <louis@chmn.me>
2024-07-16 15:02:32 +02:00
Andy Scherzinger 1f7e2ba599 chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2024-05-13 17:41:36 +02:00
Hamid Dehnavi 246218d07a Make adjustments based on the review
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2024-02-26 09:22:45 +01:00
Hamid Dehnavi 47361fdc55 Refactor core/BackgroundJobs
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
2024-02-26 09:22:45 +01:00
Maxence Lange c26110cbec better users cycle
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
2024-01-11 15:46:48 +00:00
Louis Chemineau 8eb58d03a9 Wrap metadata generation in try/catch
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-12-13 10:51:15 +01:00
Louis Chemineau a0ff998c00 Add metadata generation job
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-11-16 15:02:38 +01:00
Louis Chemineau 95938d32d9 Add migration from the old to new metadata tables
Signed-off-by: Louis Chemineau <louis@chmn.me>
2023-11-16 09:21:55 +01:00
Faraz Samapoor e98cf3c374 Uses PHP8's constructor property promotion.
Signed-off-by: Faraz Samapoor <fsa@adlas.at>
2023-06-23 23:03:56 +03:30
Arthur Schiwon 6ec5c4715c also use updatedir for cleanup of backups
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
2022-10-01 17:01:28 +02:00
Carl Schwan 48d9c4d2b0 Port existing server code to new interface
Signed-off-by: Carl Schwan <carl@carlschwan.eu>
2022-08-08 17:03:19 +02:00