mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-01 23:01:10 +00:00
Merge pull request #107 from BinaryAlley/refactor/corrects-media-library-cover-storage-internal-path
Corrects media library cover storage internal path
This commit is contained in:
3 files changed
+7
-3
No files matched your search
+5
-1
@@ -192,7 +192,11 @@ public class LibrarySavedDomainEventHandler : INotificationHandler<LibrarySavedD
|
||||
if (renameFileResult.IsError)
|
||||
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>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
libraryDiv.className = 'media-panel';
|
||||
|
||||
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>
|
||||
`;
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
if (await dialogService.show('@_localizer["DeleteLibraryConfirm"]'.replace('{0}', libraryTitle),
|
||||
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 success = await callApiDeleteAsync(url.replace('/@(default(Guid))', `/${libraryId}`));
|
||||
|
||||
|
||||
Reference in new issue
Block a user