Merge branch 'feature/media-library-phase2' into feature/media-library-phase3c
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user