* 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:
Joseph Milazzo 2022-02-05 17:06:28 -08:00 committed by GitHub
parent 288acbaa70
commit 90de87a49f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 26 deletions

View File

@ -154,10 +154,11 @@ namespace API.Controllers
var bookmarkDirectory =
(await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.BookmarkDirectory)).Value;
var files = (await _unitOfWork.UserRepository.GetAllBookmarksByIds(downloadBookmarkDto.Bookmarks
.Select(b => b.Id)
.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,
$"download_{user.Id}_{series.Id}_bookmarks");

View File

@ -50,7 +50,8 @@ public class EmailService : IEmailService
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)
{
_logger.LogError("There was a critical error sending Confirmation email");

View File

@ -18,13 +18,6 @@
</ng-template>
</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">
<ng-template #carouselItem let-item let-position="idx">
<app-card-item [entity]="item" [title]="item.title" [subtitle]="item.seriesName" [imageUrl]="imageService.getRecentlyAddedItem(item)"

View File

@ -28,7 +28,6 @@ export class LibraryComponent implements OnInit, OnDestroy {
isLoading = false;
isAdmin = false;
recentlyAdded: Series[] = [];
recentlyUpdatedSeries: SeriesGroup[] = [];
recentlyAddedChapters: RecentlyAddedItem[] = [];
inProgress: Series[] = [];
@ -44,17 +43,16 @@ export class LibraryComponent implements OnInit, OnDestroy {
this.messageHub.messages$.pipe(takeUntil(this.onDestroy)).subscribe(res => {
if (res.event === EVENTS.SeriesAdded) {
const seriesAddedEvent = res.payload as SeriesAddedEvent;
this.seriesService.getSeries(seriesAddedEvent.seriesId).subscribe(series => {
this.recentlyAdded.unshift(series);
});
this.loadRecentlyAddedChapters();
this.loadRecentlyAdded();
} else if (res.event === EVENTS.SeriesRemoved) {
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.recentlyUpdatedSeries = this.recentlyUpdatedSeries.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() {
this.loadRecentlyAdded();
this.loadOnDeck();
this.loadRecentlyAddedChapters();
this.loadRecentlyAdded();
}
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.recentlyUpdatedSeries = updatedSeries;
});

View File

@ -29,7 +29,7 @@
</div>
<div class="ml-1">
<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>
<span [innerHTML]="item.localizedName"></span>
</ng-template>
@ -44,7 +44,11 @@
<app-image class="mr-3 search-result" width="24px" [imageUrl]="imageService.getCollectionCoverImage(item.id)"></app-image>
</div>
<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">
&nbsp;<i class="fa fa-angle-double-up" aria-hidden="true" title="Promoted"></i>
<span class="sr-only">(promoted)</span>
</span>
</div>
</div>
</ng-template>
@ -52,7 +56,7 @@
<ng-template #tagTemplate let-item>
<div style="display: flex;padding: 5px;" (click)="goTo('tags', item.id)">
<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>
</ng-template>