Release Shakeout Day 1 (#1591)

* Fixed an issue where reading list were not able to update their summary due to a duplicate title check.

* Misc code smell cleanup

* Updated .net dependencies and removed unneeded ones

* Fixed an issue where removing a series from want to read list page wouldn't update the page correctly

* Fixed age restriction not applied to Recommended page

* Ensure that Genres and Tags are age restricted gated

* Persons are now age gated as well

* When you choose a cover, the new cover will properly be selected and will focus on it, in the cases there are many other covers available.

* Fixed caching profiles

* Added in a special hook when deleting a library to clear all series Relations before we delete
This commit is contained in:
Joe Milazzo 2022-10-18 16:53:17 -07:00 committed by GitHub
parent 03bd2e9103
commit b802e1e1b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 404 additions and 153 deletions

View file

@ -86,8 +86,6 @@ export class MetadataService {
return of(this.validLanguages);
}
return this.httpClient.get<Array<Language>>(this.baseUrl + 'metadata/all-languages').pipe(map(l => this.validLanguages = l));
//return this.httpClient.get<Array<Language>>(this.baseUrl + 'metadata/all-languages').pipe();
}
getAllPeople(libraries?: Array<number>) {

View file

@ -190,9 +190,12 @@ export class CoverImageChooserComponent implements OnInit, OnDestroy {
this.imageUrls.push(e.target.result); // This is base64 already
this.imageUrlsChange.emit(this.imageUrls);
this.selectedIndex += 1;
this.selectedIndex = this.imageUrls.length - 1;
this.imageSelected.emit(this.selectedIndex); // Auto select newly uploaded image
this.selectedBase64Url.emit(e.target.result);
setTimeout(() => {
(this.document.querySelector('div.image-card[aria-label="Image ' + this.selectedIndex + '"]') as HTMLElement).focus();
})
this.cdRef.markForCheck();
}
@ -209,7 +212,7 @@ export class CoverImageChooserComponent implements OnInit, OnDestroy {
setTimeout(() => {
// Auto select newly uploaded image and tell parent of new base64 url
this.selectImage(this.selectedIndex + 1);
this.selectImage(index >= 0 ? index : this.imageUrls.length - 1);
});
}

View file

@ -1,10 +1,8 @@
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output } from '@angular/core';
import { NavigationStart, Router } from '@angular/router';
import { Router } from '@angular/router';
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
import { ToastrService } from 'ngx-toastr';
import { filter, take } from 'rxjs/operators';
import { Series } from 'src/app/_models/series';
import { AccountService } from 'src/app/_services/account.service';
import { ImageService } from 'src/app/_services/image.service';
import { ActionFactoryService, Action, ActionItem } from 'src/app/_services/action-factory.service';
import { SeriesService } from 'src/app/_services/series.service';
@ -37,7 +35,10 @@ export class SeriesCardComponent implements OnInit, OnChanges, OnDestroy {
@Input() relation: RelationKind | undefined = undefined;
@Output() clicked = new EventEmitter<Series>();
@Output() reload = new EventEmitter<boolean>();
/**
* Emits when a reload needs to occur and the id of the entity
*/
@Output() reload = new EventEmitter<number>();
@Output() dataChanged = new EventEmitter<Series>();
/**
* When the card is selected.
@ -103,7 +104,7 @@ export class SeriesCardComponent implements OnInit, OnChanges, OnDestroy {
case Action.RemoveFromWantToReadList:
this.actionService.removeMultipleSeriesFromWantToReadList([series.id]);
if (this.router.url.startsWith('/want-to-read')) {
this.reload.emit(true);
this.reload.emit(series.id);
}
break;
case(Action.AddToCollection):
@ -125,7 +126,7 @@ export class SeriesCardComponent implements OnInit, OnChanges, OnDestroy {
this.seriesService.getSeries(data.id).subscribe(series => {
this.data = series;
this.cdRef.markForCheck();
this.reload.emit(true);
this.reload.emit(series.id);
this.dataChanged.emit(series);
});
}
@ -145,7 +146,7 @@ export class SeriesCardComponent implements OnInit, OnChanges, OnDestroy {
async deleteSeries(series: Series) {
this.actionService.deleteSeries(series, (result: boolean) => {
if (result) {
this.reload.emit(true);
this.reload.emit(series.id);
}
});
}

View file

@ -16,7 +16,7 @@
<app-carousel-reel [items]="inProgress" title="On Deck" (sectionClick)="handleSectionClick($event)">
<ng-template #carouselItem let-item let-position="idx">
<app-series-card [data]="item" [libraryId]="item.libraryId" [suppressLibraryLink]="libraryId !== 0" (reload)="reloadInProgress($event)" (dataChanged)="reloadInProgress($event)"></app-series-card>
<app-series-card [data]="item" [libraryId]="item.libraryId" [suppressLibraryLink]="libraryId !== 0" (reload)="reloadInProgress(item)" (dataChanged)="reloadInProgress($event)"></app-series-card>
</ng-template>
</app-carousel-reel>

View file

@ -66,8 +66,8 @@ export class LibraryRecommendedComponent implements OnInit, OnDestroy {
}
reloadInProgress(series: Series | boolean) {
if (series === true || series === false) {
reloadInProgress(series: Series | number) {
if (Number.isInteger(series)) {
if (!series) {return;}
}
// If the update to Series doesn't affect the requirement to be in this stream, then ignore update request

View file

@ -23,8 +23,9 @@
[refresh]="refresh"
(applyFilter)="updateFilter($event)">
<ng-template #cardItem let-item let-position="idx">
<app-series-card [data]="item" [libraryId]="item.libraryId" (reload)="removeSeries(item.id)"
(selection)="bulkSelectionService.handleCardSelection('series', position, series.length, $event)" [selected]="bulkSelectionService.isCardSelected('series', position)" [allowSelection]="true"
<app-series-card [data]="item" [libraryId]="item.libraryId" (reload)="removeSeries($event)"
(selection)="bulkSelectionService.handleCardSelection('series', position, series.length, $event)"
[selected]="bulkSelectionService.isCardSelected('series', position)" [allowSelection]="true"
></app-series-card>
</ng-template>

View file

@ -61,6 +61,7 @@ export class WantToReadComponent implements OnInit, OnDestroy {
break;
}
}
collectionTag: any;
tagImage: any;
@ -164,6 +165,23 @@ export class WantToReadComponent implements OnInit, OnDestroy {
if (!data.isFirst) this.filterUtilityService.updateUrlFromFilter(this.seriesPagination, this.filter);
this.loadPage();
}
handleAction(action: ActionItem<Series>, series: Series) {
// let lib: Partial<Library> = library;
// if (library === undefined) {
// lib = {id: this.libraryId, name: this.libraryName};
// }
// switch (action.action) {
// case(Action.Scan):
// this.actionService.scanLibrary(lib);
// break;
// case(Action.RefreshMetadata):
// this.actionService.refreshMetadata(lib);
// break;
// default:
// break;
// }
}
}