Cleanup from the Release (#2127)
* Added an FAQ link on the Kavita+ tab. * Don't query Kavita+ for ratings on comic libraries as there is no upstream provider yet. * Jumpbar keys are a little hard to click * Fixed an issue where libraries that don't allow scrobbling could be scrobbled when generating past history with read events. * Made the min/max release year on metadata filter number and removed the spin arrows for styling. * Fixed disable tabs color contrast due to bootstrap undocumented change. * Refactored whole codebase to unify caching mechanism. Upped the default cache memory amount to 75 to account for the extra data load. Still LRU. Fixed an issue where Cache key was using Port instead. Refactored all the Configuration code to use strongly typed deserialization. * Fixed an issue where get latest progress would throw an exception if there was no progress due to LINQ and MAX query. * Fixed a bug where Send to Device wasn't present on Series cards. * Hooked up the ability to change the cache size for Kavita via the UI.
This commit is contained in:
parent
1ed8889d08
commit
81da9dc444
37 changed files with 402 additions and 272 deletions
|
|
@ -40,7 +40,7 @@ export class ActionService implements OnDestroy {
|
|||
private readingListModalRef: NgbModalRef | null = null;
|
||||
private collectionModalRef: NgbModalRef | null = null;
|
||||
|
||||
constructor(private libraryService: LibraryService, private seriesService: SeriesService,
|
||||
constructor(private libraryService: LibraryService, private seriesService: SeriesService,
|
||||
private readerService: ReaderService, private toastr: ToastrService, private modalService: NgbModal,
|
||||
private confirmService: ConfirmService, private memberService: MemberService, private deviceSerivce: DeviceService) { }
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ export class ActionService implements OnDestroy {
|
|||
* Request a file scan for a given Library
|
||||
* @param library Partial Library, must have id and name populated
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
async scanLibrary(library: Partial<Library>, callback?: LibraryActionCallback) {
|
||||
if (!library.hasOwnProperty('id') || library.id === undefined) {
|
||||
|
|
@ -76,7 +76,7 @@ export class ActionService implements OnDestroy {
|
|||
* Request a refresh of Metadata for a given Library
|
||||
* @param library Partial Library, must have id and name populated
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
async refreshMetadata(library: Partial<Library>, callback?: LibraryActionCallback) {
|
||||
if (!library.hasOwnProperty('id') || library.id === undefined) {
|
||||
|
|
@ -112,7 +112,7 @@ export class ActionService implements OnDestroy {
|
|||
* Request an analysis of files for a given Library (currently just word count)
|
||||
* @param library Partial Library, must have id and name populated
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @returns
|
||||
* @returns
|
||||
*/
|
||||
async analyzeFiles(library: Partial<Library>, callback?: LibraryActionCallback) {
|
||||
if (!library.hasOwnProperty('id') || library.id === undefined) {
|
||||
|
|
@ -285,7 +285,7 @@ export class ActionService implements OnDestroy {
|
|||
* @param seriesId Series Id
|
||||
* @param volumes Volumes, should have id, chapters and pagesRead populated
|
||||
* @param chapters? Chapters, should have id
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
*/
|
||||
markMultipleAsRead(seriesId: number, volumes: Array<Volume>, chapters?: Array<Chapter>, callback?: VoidActionCallback) {
|
||||
this.readerService.markMultipleRead(seriesId, volumes.map(v => v.id), chapters?.map(c => c.id)).pipe(take(1)).subscribe(() => {
|
||||
|
|
@ -306,7 +306,7 @@ export class ActionService implements OnDestroy {
|
|||
* Mark all chapters and the volumes as Unread. All volumes must belong to a series
|
||||
* @param seriesId Series Id
|
||||
* @param volumes Volumes, should have id, chapters and pagesRead populated
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
*/
|
||||
markMultipleAsUnread(seriesId: number, volumes: Array<Volume>, chapters?: Array<Chapter>, callback?: VoidActionCallback) {
|
||||
this.readerService.markMultipleUnread(seriesId, volumes.map(v => v.id), chapters?.map(c => c.id)).pipe(take(1)).subscribe(() => {
|
||||
|
|
@ -326,7 +326,7 @@ export class ActionService implements OnDestroy {
|
|||
/**
|
||||
* Mark all series as Read.
|
||||
* @param series Series, should have id, pagesRead populated
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
*/
|
||||
markMultipleSeriesAsRead(series: Array<Series>, callback?: VoidActionCallback) {
|
||||
this.readerService.markMultipleSeriesRead(series.map(v => v.id)).pipe(take(1)).subscribe(() => {
|
||||
|
|
@ -342,9 +342,9 @@ export class ActionService implements OnDestroy {
|
|||
}
|
||||
|
||||
/**
|
||||
* Mark all series as Unread.
|
||||
* Mark all series as Unread.
|
||||
* @param series Series, should have id, pagesRead populated
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
*/
|
||||
markMultipleSeriesAsUnread(series: Array<Series>, callback?: VoidActionCallback) {
|
||||
this.readerService.markMultipleSeriesUnread(series.map(v => v.id)).pipe(take(1)).subscribe(() => {
|
||||
|
|
@ -425,9 +425,9 @@ export class ActionService implements OnDestroy {
|
|||
|
||||
/**
|
||||
* Adds a set of series to a collection tag
|
||||
* @param series
|
||||
* @param callback
|
||||
* @returns
|
||||
* @param series
|
||||
* @param callback
|
||||
* @returns
|
||||
*/
|
||||
addMultipleSeriesToCollectionTag(series: Array<Series>, callback?: BooleanActionCallback) {
|
||||
if (this.collectionModalRef != null) { return; }
|
||||
|
|
@ -452,7 +452,7 @@ export class ActionService implements OnDestroy {
|
|||
addSeriesToReadingList(series: Series, callback?: SeriesActionCallback) {
|
||||
if (this.readingListModalRef != null) { return; }
|
||||
this.readingListModalRef = this.modalService.open(AddToListModalComponent, { scrollable: true, size: 'md' });
|
||||
this.readingListModalRef.componentInstance.seriesId = series.id;
|
||||
this.readingListModalRef.componentInstance.seriesId = series.id;
|
||||
this.readingListModalRef.componentInstance.title = series.name;
|
||||
this.readingListModalRef.componentInstance.type = ADD_FLOW.Series;
|
||||
|
||||
|
|
@ -474,7 +474,7 @@ export class ActionService implements OnDestroy {
|
|||
addVolumeToReadingList(volume: Volume, seriesId: number, callback?: VolumeActionCallback) {
|
||||
if (this.readingListModalRef != null) { return; }
|
||||
this.readingListModalRef = this.modalService.open(AddToListModalComponent, { scrollable: true, size: 'md' });
|
||||
this.readingListModalRef.componentInstance.seriesId = seriesId;
|
||||
this.readingListModalRef.componentInstance.seriesId = seriesId;
|
||||
this.readingListModalRef.componentInstance.volumeId = volume.id;
|
||||
this.readingListModalRef.componentInstance.type = ADD_FLOW.Volume;
|
||||
|
||||
|
|
@ -496,7 +496,7 @@ export class ActionService implements OnDestroy {
|
|||
addChapterToReadingList(chapter: Chapter, seriesId: number, callback?: ChapterActionCallback) {
|
||||
if (this.readingListModalRef != null) { return; }
|
||||
this.readingListModalRef = this.modalService.open(AddToListModalComponent, { scrollable: true, size: 'md' });
|
||||
this.readingListModalRef.componentInstance.seriesId = seriesId;
|
||||
this.readingListModalRef.componentInstance.seriesId = seriesId;
|
||||
this.readingListModalRef.componentInstance.chapterId = chapter.id;
|
||||
this.readingListModalRef.componentInstance.type = ADD_FLOW.Chapter;
|
||||
|
||||
|
|
@ -517,7 +517,7 @@ export class ActionService implements OnDestroy {
|
|||
|
||||
editReadingList(readingList: ReadingList, callback?: ReadingListActionCallback) {
|
||||
const readingListModalRef = this.modalService.open(EditReadingListModalComponent, { scrollable: true, size: 'lg' });
|
||||
readingListModalRef.componentInstance.readingList = readingList;
|
||||
readingListModalRef.componentInstance.readingList = readingList;
|
||||
readingListModalRef.closed.pipe(take(1)).subscribe((list) => {
|
||||
if (callback && list !== undefined) {
|
||||
callback(readingList);
|
||||
|
|
@ -535,7 +535,7 @@ export class ActionService implements OnDestroy {
|
|||
* @param seriesId Series Id
|
||||
* @param volumes Volumes, should have id, chapters and pagesRead populated
|
||||
* @param chapters? Chapters, should have id
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
* @param callback Optional callback to perform actions after API completes
|
||||
*/
|
||||
async deleteMultipleSeries(seriesIds: Array<Series>, callback?: BooleanActionCallback) {
|
||||
if (!await this.confirmService.confirm('Are you sure you want to delete ' + seriesIds.length + ' series? It will not modify files on disk.')) {
|
||||
|
|
@ -578,15 +578,13 @@ export class ActionService implements OnDestroy {
|
|||
});
|
||||
}
|
||||
|
||||
private async promptIfForce(extraContent: string = '') {
|
||||
// Prompt user if we should do a force or not
|
||||
const config = this.confirmService.defaultConfirm;
|
||||
config.header = 'Force Scan';
|
||||
config.buttons = [
|
||||
{text: 'Yes', type: 'secondary'},
|
||||
{text: 'No', type: 'primary'},
|
||||
];
|
||||
const msg = 'Do you want to force this scan? This is will ignore optimizations that reduce processing and I/O. ' + extraContent;
|
||||
return !await this.confirmService.confirm(msg, config); // Not because primary is the false state
|
||||
sendSeriesToDevice(seriesId: number, device: Device, callback?: VoidActionCallback) {
|
||||
this.deviceSerivce.sendSeriesTo(seriesId, device.id).subscribe(() => {
|
||||
this.toastr.success('File(s) emailed to ' + device.name);
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue