Corrects media library cover storage internal path

This commit is contained in:
BinaryAlley committed 2025-01-12 10:38:38 +02:00
1 parent ecc332a91a
commit 5a2919f89a
3 files changed
+7 -3

No files matched your search

@@ -192,7 +192,11 @@ public class LibrarySavedDomainEventHandler : INotificationHandler<LibrarySavedD
if (renameFileResult.IsError) if (renameFileResult.IsError)
return renameFileResult.Errors; return renameFileResult.Errors;
return $"cover.{imageCheckResult.Value.ToString().ToLower()}"; // get the internal relative path for the copied file
string relativePath = renameFileResult.Value.Path[AppContext.BaseDirectory.Length..];
if (!relativePath.StartsWith(_pathService.PathSeparator))
relativePath = $"{_pathService.PathSeparator}{relativePath}";
return relativePath;
} }
/// <summary> /// <summary>
@@ -44,7 +44,7 @@
libraryDiv.className = 'media-panel'; libraryDiv.className = 'media-panel';
libraryDiv.innerHTML = ` libraryDiv.innerHTML = `
<img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage}" /> <img src="${globalConfiguration.serverBasePath}/media/libraries/${library.id}/${library.coverImage.substring(library.coverImage.lastIndexOf('cover.'))}" />
<span class="text-light-two"><strong>${library.title}</strong></span> <span class="text-light-two"><strong>${library.title}</strong></span>
`; `;
@@ -72,7 +72,7 @@
if (await dialogService.show('@_localizer["DeleteLibraryConfirm"]'.replace('{0}', libraryTitle), if (await dialogService.show('@_localizer["DeleteLibraryConfirm"]'.replace('{0}', libraryTitle),
jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) { jsLocalizedDialogs.confirmation, DialogButtons.YES_NO, DialogIcon.QUESTION) === DialogButton.YES) {
const libraryId = row.querySelector('a').href.split('id=')[1]; const libraryId = row.querySelector('a').href.split('/').pop();
const url = '@_urlService.GetAbsoluteUrl("DeleteLibrary", "LibraryManagement", new { id = default(Guid) })'; const url = '@_urlService.GetAbsoluteUrl("DeleteLibrary", "LibraryManagement", new { id = default(Guid) })';
const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${libraryId}`)); const success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${libraryId}`));