From c5af95bd7af2c0205a0f68d67e86d0dbeba7c879 Mon Sep 17 00:00:00 2001
From: Jake Mannens
Date: Sat, 23 May 2026 22:38:34 +1000
Subject: Deleted client-side Razor pages
---
Pages/ViewMedia.razor | 265 --------------------------------------------------
1 file changed, 265 deletions(-)
delete mode 100644 Pages/ViewMedia.razor
(limited to 'Pages/ViewMedia.razor')
diff --git a/Pages/ViewMedia.razor b/Pages/ViewMedia.razor
deleted file mode 100644
index 46cbc45..0000000
--- a/Pages/ViewMedia.razor
+++ /dev/null
@@ -1,265 +0,0 @@
-@page "/ViewMedia"
-@using HyperBooru.Util
-@inject IJSRuntime jsRuntime
-@inject IDbContextFactory dbFactory
-@inject ITagService tagService
-@inject IMediaService mediaService
-@inject ISourceService sourceService
-@attribute [Authorize]
-
-@title
-
-
-
-
-
-
-
-
- } else {
- @media.OcrData?.Text
- }
-
-
-
-
-
-
-
-@code {
- [Parameter]
- [SupplyParameterFromQuery(Name = "m")]
- public Guid MediaId { get; set; }
-
- private Media media;
-
- private string title;
-
- private bool infoEditMode = false;
- private string? shortDescription;
- private string? longDescription;
-
- private MediaTagTable mediaTagTable;
- private Dialog deleteDialog;
- private Dialog ocrDialog;
- private TagSelectDialog tagDialog;
-
- private ElementReference shortDescriptionInput;
-
- protected override void OnInitialized() =>
- LoadMedia();
-
- protected override async void OnAfterRender(bool firstRender) {
- if(infoEditMode)
- await shortDescriptionInput.FocusAsync();
- }
-
- private void LoadMedia() {
- using var db = dbFactory.CreateDbContext();
- media = db.Media
- .Include(m => m.Tags)
- .ThenInclude(t => t.TagDefinition)
- .Include(m => m.CurrentUploadedFile)
- .Include(m => m.UploadedFiles)
- .Include(m => m.OcrData)
- .First(m => m.Guid == MediaId);
-
- title = media.DisplayName ?? "Media View";
- }
-
- private void AddTags(TagDefinition[] tagDefs) {
- foreach(var tagDef in tagDefs)
- tagService.AddTag(media, tagDef);
- mediaTagTable.Refresh();
- }
-
- private async void SetIngest(bool ingest) {
- mediaService.SetIngest(media, ingest);
- LoadMedia();
-
- if(ingest)
- StateHasChanged();
- else
- await jsRuntime.InvokeVoidAsync("history.back");
- }
-
- private bool InfoEditMode {
- get => infoEditMode;
- set {
- shortDescription = media.ShortDescription;
- longDescription = media.LongDescription;
- infoEditMode = value;
- StateHasChanged();
- }
- }
-
- private void ApplyInfoEdit(bool apply) {
- if(apply) {
- mediaService.SetDescription(media, shortDescription, longDescription);
- LoadMedia();
- }
-
- infoEditMode = false;
- }
-
- private async void DeleteMedia() {
- mediaService.Delete(media);
- await jsRuntime.InvokeVoidAsync("history.back");
- }
-}
--
cgit v1.3