Fixed bug where deletes of artifact groupings would not cascade

This commit is contained in:
Vincent Allen
2025-11-12 19:10:35 -05:00
parent b34449808f
commit 9298829db6
325 changed files with 5233 additions and 20996 deletions

View File

@@ -1,4 +1,21 @@
namespace OpenArchival.Blazor.FileViewer;
/*
“Commons Clause” License Condition v1.0
https://commonsclause.com/
The Software is provided to you by the Licensor under the License, as defined below, subject to the following condition.
Without limiting other conditions in the License, the grant of rights under the License will not include, and the License does not grant to you, the right to Sell the Software.
For purposes of the foregoing, “Sell” means practicing any or all of the rights granted to you under the License to provide to third parties, for a fee or other consideration (including without limitation fees for hosting or consulting/ support services related to the Software), a product or service whose value derives, entirely or substantially, from the functionality of the Software. Any license notice or attribution required by the License must also include this Commons Clause License Condition notice.
Software: Open Archival
License: GNU GPL: https://www.gnu.org/licenses/gpl-3.0.en.html
Licensor: Vincent Allen
*/
namespace OpenArchival.Blazor.FileViewer;
using System;
using System.Collections.Generic;
@@ -6,12 +23,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
public static class FileViewerFactory
{
private static Dictionary<string, Type> _extensionMapping = [];
static FileViewerFactory() {
static FileViewerFactory()
{
// Image types taken from https://developer.mozilla.org/en-US/docs/Web/Media/Guides/Formats/Image_types
RegisterViewerComponent<ImageViewer>([".apng", ".png", ".avif", ".gif", ".jpg", ".jpeg", ".jfif", ".pjpeg", ".pjp", ".svg", ".webp"]);
}
@@ -26,13 +43,13 @@ public static class FileViewerFactory
public static Type GetViewerComponent(string filename)
{
if (_extensionMapping.TryGetValue(Path.GetExtension(filename).ToLowerInvariant(), out var componentType))
if (_extensionMapping.TryGetValue(Path.GetExtension(filename).ToLowerInvariant(), out var componentType))
{
return componentType;
}
}
else
{
return typeof(UnsupportedFileViewer);
}
}
}
}