mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Fixes (#1037)
* When downloading bookmarks, prepend the images with chapterId to ensure there are no conflicts. * Fixed a case where email service wasn't using the custom email service. * Changed how we render some text in search results * Update the recently when we receive scan events
This commit is contained in:
parent
288acbaa70
commit
90de87a49f
@ -154,10 +154,11 @@ namespace API.Controllers
|
|||||||
|
|
||||||
var bookmarkDirectory =
|
var bookmarkDirectory =
|
||||||
(await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.BookmarkDirectory)).Value;
|
(await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.BookmarkDirectory)).Value;
|
||||||
|
|
||||||
var files = (await _unitOfWork.UserRepository.GetAllBookmarksByIds(downloadBookmarkDto.Bookmarks
|
var files = (await _unitOfWork.UserRepository.GetAllBookmarksByIds(downloadBookmarkDto.Bookmarks
|
||||||
.Select(b => b.Id)
|
.Select(b => b.Id)
|
||||||
.ToList()))
|
.ToList()))
|
||||||
.Select(b => Parser.Parser.NormalizePath(_directoryService.FileSystem.Path.Join(bookmarkDirectory, b.FileName)));
|
.Select(b => Parser.Parser.NormalizePath(_directoryService.FileSystem.Path.Join(bookmarkDirectory, $"{b.ChapterId}_{b.FileName}")));
|
||||||
|
|
||||||
var (fileBytes, _) = await _archiveService.CreateZipForDownload(files,
|
var (fileBytes, _) = await _archiveService.CreateZipForDownload(files,
|
||||||
$"download_{user.Id}_{series.Id}_bookmarks");
|
$"download_{user.Id}_{series.Id}_bookmarks");
|
||||||
|
@ -50,7 +50,8 @@ public class EmailService : IEmailService
|
|||||||
|
|
||||||
public async Task SendConfirmationEmail(ConfirmationEmailDto data)
|
public async Task SendConfirmationEmail(ConfirmationEmailDto data)
|
||||||
{
|
{
|
||||||
var success = await SendEmailWithPost(DefaultApiUrl + "/api/email/confirm", data);
|
var emailLink = (await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.EmailServiceUrl)).Value;
|
||||||
|
var success = await SendEmailWithPost(emailLink + "/api/email/confirm", data);
|
||||||
if (!success)
|
if (!success)
|
||||||
{
|
{
|
||||||
_logger.LogError("There was a critical error sending Confirmation email");
|
_logger.LogError("There was a critical error sending Confirmation email");
|
||||||
|
@ -18,13 +18,6 @@
|
|||||||
</ng-template>
|
</ng-template>
|
||||||
</app-carousel-reel>
|
</app-carousel-reel>
|
||||||
|
|
||||||
|
|
||||||
<!-- <app-carousel-reel [items]="recentlyAdded" title="Recently Added Series" (sectionClick)="handleSectionClick($event)">
|
|
||||||
<ng-template #carouselItem let-item let-position="idx">
|
|
||||||
<app-series-card [data]="item" [libraryId]="item.libraryId" (dataChanged)="loadRecentlyAdded()"></app-series-card>
|
|
||||||
</ng-template>
|
|
||||||
</app-carousel-reel> -->
|
|
||||||
|
|
||||||
<app-carousel-reel [items]="recentlyAddedChapters" title="Recently Added">
|
<app-carousel-reel [items]="recentlyAddedChapters" title="Recently Added">
|
||||||
<ng-template #carouselItem let-item let-position="idx">
|
<ng-template #carouselItem let-item let-position="idx">
|
||||||
<app-card-item [entity]="item" [title]="item.title" [subtitle]="item.seriesName" [imageUrl]="imageService.getRecentlyAddedItem(item)"
|
<app-card-item [entity]="item" [title]="item.title" [subtitle]="item.seriesName" [imageUrl]="imageService.getRecentlyAddedItem(item)"
|
||||||
|
@ -28,7 +28,6 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
isLoading = false;
|
isLoading = false;
|
||||||
isAdmin = false;
|
isAdmin = false;
|
||||||
|
|
||||||
recentlyAdded: Series[] = [];
|
|
||||||
recentlyUpdatedSeries: SeriesGroup[] = [];
|
recentlyUpdatedSeries: SeriesGroup[] = [];
|
||||||
recentlyAddedChapters: RecentlyAddedItem[] = [];
|
recentlyAddedChapters: RecentlyAddedItem[] = [];
|
||||||
inProgress: Series[] = [];
|
inProgress: Series[] = [];
|
||||||
@ -44,17 +43,16 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
this.messageHub.messages$.pipe(takeUntil(this.onDestroy)).subscribe(res => {
|
this.messageHub.messages$.pipe(takeUntil(this.onDestroy)).subscribe(res => {
|
||||||
if (res.event === EVENTS.SeriesAdded) {
|
if (res.event === EVENTS.SeriesAdded) {
|
||||||
const seriesAddedEvent = res.payload as SeriesAddedEvent;
|
const seriesAddedEvent = res.payload as SeriesAddedEvent;
|
||||||
this.seriesService.getSeries(seriesAddedEvent.seriesId).subscribe(series => {
|
this.loadRecentlyAdded();
|
||||||
this.recentlyAdded.unshift(series);
|
|
||||||
});
|
|
||||||
this.loadRecentlyAddedChapters();
|
|
||||||
} else if (res.event === EVENTS.SeriesRemoved) {
|
} else if (res.event === EVENTS.SeriesRemoved) {
|
||||||
const seriesRemovedEvent = res.payload as SeriesRemovedEvent;
|
const seriesRemovedEvent = res.payload as SeriesRemovedEvent;
|
||||||
this.recentlyAdded = this.recentlyAdded.filter(item => item.id != seriesRemovedEvent.seriesId);
|
|
||||||
this.inProgress = this.inProgress.filter(item => item.id != seriesRemovedEvent.seriesId);
|
this.inProgress = this.inProgress.filter(item => item.id != seriesRemovedEvent.seriesId);
|
||||||
|
|
||||||
this.recentlyUpdatedSeries = this.recentlyUpdatedSeries.filter(item => item.seriesId != seriesRemovedEvent.seriesId);
|
this.recentlyUpdatedSeries = this.recentlyUpdatedSeries.filter(item => item.seriesId != seriesRemovedEvent.seriesId);
|
||||||
this.recentlyAddedChapters = this.recentlyAddedChapters.filter(item => item.seriesId != seriesRemovedEvent.seriesId);
|
this.recentlyAddedChapters = this.recentlyAddedChapters.filter(item => item.seriesId != seriesRemovedEvent.seriesId);
|
||||||
|
} else if (res.event === EVENTS.ScanSeries) {
|
||||||
|
// We don't have events for when series are updated, but we do get events when a scan update occurs. Refresh recentlyAdded at that time.
|
||||||
|
this.loadRecentlyAdded();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -80,9 +78,8 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
reloadSeries() {
|
reloadSeries() {
|
||||||
this.loadRecentlyAdded();
|
|
||||||
this.loadOnDeck();
|
this.loadOnDeck();
|
||||||
this.loadRecentlyAddedChapters();
|
this.loadRecentlyAdded();
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadInProgress(series: Series | boolean) {
|
reloadInProgress(series: Series | boolean) {
|
||||||
@ -104,13 +101,8 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
loadRecentlyAdded() {
|
|
||||||
this.seriesService.getRecentlyAdded(0, 0, 20).pipe(takeUntil(this.onDestroy)).subscribe(updatedSeries => {
|
|
||||||
this.recentlyAdded = updatedSeries.result;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
loadRecentlyAddedChapters() {
|
loadRecentlyAdded() {
|
||||||
this.seriesService.getRecentlyUpdatedSeries().pipe(takeUntil(this.onDestroy)).subscribe(updatedSeries => {
|
this.seriesService.getRecentlyUpdatedSeries().pipe(takeUntil(this.onDestroy)).subscribe(updatedSeries => {
|
||||||
this.recentlyUpdatedSeries = updatedSeries;
|
this.recentlyUpdatedSeries = updatedSeries;
|
||||||
});
|
});
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="ml-1">
|
<div class="ml-1">
|
||||||
<app-series-format [format]="item.format"></app-series-format>
|
<app-series-format [format]="item.format"></app-series-format>
|
||||||
<span *ngIf="item.name.toLowerCase().trim().indexOf(searchTerm) >= 0; else localizedName" [innerHTML]="item.name"></span>
|
<span *ngIf="item.name.toLowerCase().trim().indexOf(searchTerm) >= 0; else localizedName">{{item.name}}</span>
|
||||||
<ng-template #localizedName>
|
<ng-template #localizedName>
|
||||||
<span [innerHTML]="item.localizedName"></span>
|
<span [innerHTML]="item.localizedName"></span>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
@ -44,7 +44,11 @@
|
|||||||
<app-image class="mr-3 search-result" width="24px" [imageUrl]="imageService.getCollectionCoverImage(item.id)"></app-image>
|
<app-image class="mr-3 search-result" width="24px" [imageUrl]="imageService.getCollectionCoverImage(item.id)"></app-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="ml-1">
|
<div class="ml-1">
|
||||||
<span *ngIf="item.title.toLowerCase().trim().indexOf(searchTerm) >= 0" [innerHTML]="item.title"></span>
|
<span *ngIf="item.title.toLowerCase().trim().indexOf(searchTerm) >= 0">{{item.title}}</span>
|
||||||
|
<span *ngIf="item.promoted">
|
||||||
|
<i class="fa fa-angle-double-up" aria-hidden="true" title="Promoted"></i>
|
||||||
|
<span class="sr-only">(promoted)</span>
|
||||||
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
@ -52,7 +56,7 @@
|
|||||||
<ng-template #tagTemplate let-item>
|
<ng-template #tagTemplate let-item>
|
||||||
<div style="display: flex;padding: 5px;" (click)="goTo('tags', item.id)">
|
<div style="display: flex;padding: 5px;" (click)="goTo('tags', item.id)">
|
||||||
<div class="ml-1">
|
<div class="ml-1">
|
||||||
<span *ngIf="item.title.toLowerCase().trim().indexOf(searchTerm) >= 0" [innerHTML]="item.title"></span>
|
<span *ngIf="item.title.toLowerCase().trim().indexOf(searchTerm) >= 0">{{item.title}}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user