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
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:
+1
-1
@@ -26,7 +26,7 @@ De admin toont alleen een badge Live of Niet live.
|
|||||||
| Instelling | Betekenis |
|
| Instelling | Betekenis |
|
||||||
|---|---|
|
|---|---|
|
||||||
| `Media__Directory` | De map voor de afbeeldingen, **buiten de release** en buiten de webroot. Zonder deze instelling (of als de map niet beschrijfbaar is) staan uploads uit; bestaande bestanden en de publieke hero blijven werken. Niet in een committed appsettings-bestand. |
|
| `Media__Directory` | De map voor de afbeeldingen, **buiten de release** en buiten de webroot. Zonder deze instelling (of als de map niet beschrijfbaar is) staan uploads uit; bestaande bestanden en de publieke hero blijven werken. Niet in een committed appsettings-bestand. |
|
||||||
| `Media__MaxUploadBytes` (10 MB), `Media__MaxPixels` (64 miljoen), `Media__MaxParallelJobs` (2), `Media__DecodeTimeoutSeconds` (20), `Media__MaxTotalBytes` (2 GB), `Media__RetentionDays` (7), `Media__TrashDays` (standaard 7: bewaartijd van foto's in de prullenbak van de mediabibliotheek), `Media__AutoCleanupUnattached` (standaard `true`; `false` bewaart ongebruikte uploads tot iemand ze verwijdert, voor de mediabibliotheek) | Grenzen en bewaartijd; standaardwaarden zijn bedoeld om te blijven. |
|
| `Media__MaxUploadBytes` (10 MB), `Media__MaxPixels` (64 miljoen), `Media__MaxParallelJobs` (2), `Media__DecodeTimeoutSeconds` (20), `Media__MaxTotalBytes` (2 GB), `Media__RetentionDays` (7), `Media__TrashDays` (standaard 7: bewaartijd van foto's in de prullenbak van de mediabibliotheek), `Media__AutoCleanupUnattached` (standaard `false`: ongebruikte uploads blijven bewaard tot iemand ze in de mediabibliotheek verwijdert; `true` ruimt ze na de bewaartijd automatisch op) | Grenzen en bewaartijd; standaardwaarden zijn bedoeld om te blijven. |
|
||||||
| `Hero__TextOnlyRegion` | `true` voor een site waarvan de hero geen afbeeldingen heeft (SLP Software; staat in de committed instellingen van die site): een hero zonder slides wordt dan als tekst (titelregels, lead, knoppen) in de eerste HTML geschreven. Uit (standaard, ook voor ASF): een hero zonder slides laat de pagina ongemoeid. |
|
| `Hero__TextOnlyRegion` | `true` voor een site waarvan de hero geen afbeeldingen heeft (SLP Software; staat in de committed instellingen van die site): een hero zonder slides wordt dan als tekst (titelregels, lead, knoppen) in de eerste HTML geschreven. Uit (standaard, ook voor ASF): een hero zonder slides laat de pagina ongemoeid. |
|
||||||
| `Hero__TitlePrefix` | Merktekst die in de tekst-only-regio als eerste, visueel te verbergen deel van de h1 wordt geschreven (`<span class="cms-hero-title-prefix">`), zodat crawlers en schermlezers de volledige titel lezen. SLP Software: `"SLP Software: "` (committed instelling); leeg (standaard, ook ASF) schrijft niets. De site verbergt de klasse zelf visueel. |
|
| `Hero__TitlePrefix` | Merktekst die in de tekst-only-regio als eerste, visueel te verbergen deel van de h1 wordt geschreven (`<span class="cms-hero-title-prefix">`), zodat crawlers en schermlezers de volledige titel lezen. SLP Software: `"SLP Software: "` (committed instelling); leeg (standaard, ook ASF) schrijft niets. De site verbergt de klasse zelf visueel. |
|
||||||
| `Media__RenderSetTimeoutSeconds` (600), `Media__StripTimeoutSeconds` (60) | De tijd die het knippen van alle varianten van één foto in de achtergrond mag duren, en het verwijderen van metadata bij een upload. Ruim gekozen: een grote foto op een Raspberry Pi kost minuten. |
|
| `Media__RenderSetTimeoutSeconds` (600), `Media__StripTimeoutSeconds` (60) | De tijd die het knippen van alle varianten van één foto in de achtergrond mag duren, en het verwijderen van metadata bij een upload. Ruim gekozen: een grote foto op een Raspberry Pi kost minuten. |
|
||||||
|
|||||||
@@ -68,11 +68,10 @@ public sealed class MediaOptions
|
|||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether photos that were uploaded but never used are removed automatically after <see cref="RetentionDays"/>.
|
/// 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>)
|
/// 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.
|
||||||
/// once the library can show and delete photos. Retired files of photos a person removed stay housekeeping either way.
|
/// 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.
|
||||||
/// Default <c>true</c> keeps today's behaviour (assumption 3 of the media-library list).
|
|
||||||
/// </summary>
|
/// </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>
|
/// <summary>How long a photo stays recoverable in the trash before its files are removed.</summary>
|
||||||
public int TrashDays { get; set; } = 7;
|
public int TrashDays { get; set; } = 7;
|
||||||
|
|||||||
@@ -447,6 +447,7 @@ public class HeroMediaCleanupTests
|
|||||||
public async Task AnImageNobodyUsed_IsRetiredAndRemoved_AfterTheRetentionTime()
|
public async Task AnImageNobodyUsed_IsRetiredAndRemoved_AfterTheRetentionTime()
|
||||||
{
|
{
|
||||||
using var rig = new HeroTestRig();
|
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.Upload(HeroTestRig.Photo());
|
||||||
|
|
||||||
await rig.Cleanup.RunOnceAsync(CancellationToken.None);
|
await rig.Cleanup.RunOnceAsync(CancellationToken.None);
|
||||||
|
|||||||
Reference in New Issue
Block a user