Media:AutoCleanupUnattached standaard uit (de bibliotheek bewaart uploads tot iemand ze verwijdert)
Continuous Integration / config-sls (pull_request) Successful in 6s
Continuous Integration / changes (pull_request) Successful in 16s
Continuous Integration / config-asf (pull_request) Successful in 5s
Continuous Integration / backend-build (pull_request) Successful in 1m30s
Continuous Integration / compile-sites (pull_request) Successful in 1m15s
Continuous Integration / frontend-prepare (pull_request) Successful in 30s
Continuous Integration / vulnerability-scan (pull_request) Successful in 1m23s
Continuous Integration / frontend-lint (pull_request) Successful in 1m8s
Continuous Integration / frontend-test (pull_request) Successful in 2m58s
Continuous Integration / backend-test (pull_request) Successful in 3m48s
Continuous Integration / frontend-build (pull_request) Successful in 3m49s
Continuous Integration / publish-sls-test (pull_request) Skipped
Continuous Integration / publish-sls-production (pull_request) Skipped
Continuous Integration / deploy-sls-test (pull_request) Skipped
Continuous Integration / deploy-sls-production (pull_request) Skipped
Continuous Integration / publish-asf-test (pull_request) Skipped
Continuous Integration / deploy-asf-test (pull_request) Skipped
Continuous Integration / smoke-sls-test (pull_request) Skipped
Continuous Integration / smoke-asf-test (pull_request) Skipped

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 08:13:38 +01:00
co-authored by Claude Sonnet 5.5
parent 5eab6c663f
commit d9ddf9d5ee
3 changed files with 5 additions and 5 deletions
@@ -68,11 +68,10 @@ public sealed class MediaOptions
/// <summary>
/// Whether photos that were uploaded but never used are removed automatically after <see cref="RetentionDays"/>.
/// The media library keeps everything until a person removes it, so set this to <c>false</c> (<c>Media__AutoCleanupUnattached=false</c>)
/// once the library can show and delete photos. Retired files of photos a person removed stay housekeeping either way.
/// Default <c>true</c> keeps today's behaviour (assumption 3 of the media-library list).
/// The media library keeps everything until a person removes it, so the default is <c>false</c>: unused uploads stay until someone deletes them in the library.
/// Set <c>Media__AutoCleanupUnattached=true</c> to get the old behaviour back (removal after the retention time). Retired files of photos a person removed stay housekeeping either way.
/// </summary>
public bool AutoCleanupUnattached { get; set; } = true;
public bool AutoCleanupUnattached { get; set; } = false;
/// <summary>How long a photo stays recoverable in the trash before its files are removed.</summary>
public int TrashDays { get; set; } = 7;
@@ -447,6 +447,7 @@ public class HeroMediaCleanupTests
public async Task AnImageNobodyUsed_IsRetiredAndRemoved_AfterTheRetentionTime()
{
using var rig = new HeroTestRig();
rig.Media.AutoCleanupUnattached = true; // the default is off (the library keeps uploads); this tests the opt-in clean-up
await rig.Upload(HeroTestRig.Photo());
await rig.Cleanup.RunOnceAsync(CancellationToken.None);