* Added the ability to see when a scan started at.

* filename based hashing now uses last write time as well to ensure if the underlying file changes it sends a new copy

* Fixed a bug where we would reset dark mode on the book reader to dark mode if our site was on dark mode, despite user setting light mode.

* Added a single feed entry when some sort of collection, reading list, etc doesn't have anything in it.

* Allow + in the normalization to prevent some series that use + to denote the sequel from not getting merged together.
This commit is contained in:
Joseph Milazzo 2021-10-04 05:33:28 -07:00 committed by GitHub
parent 0dbd45a41d
commit c5b62d00d0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 61 additions and 28 deletions

View file

@ -1,4 +1,5 @@
export interface ScanLibraryProgressEvent {
libraryId: number;
progress: number;
eventTime: string;
}

View file

@ -8,7 +8,7 @@
<div>
<h4>
<span id="library-name--{{idx}}">{{library.name}}</span>&nbsp;
<div class="spinner-border text-primary" style="width: 1.5rem; height: 1.5rem;" role="status" *ngIf="scanInProgress.hasOwnProperty(library.id) && scanInProgress[library.id]" title="Scan in progress">
<div class="spinner-border text-primary" style="width: 1.5rem; height: 1.5rem;" role="status" *ngIf="scanInProgress.hasOwnProperty(library.id) && scanInProgress[library.id].progress" title="Scan in progress. Started at {{scanInProgress[library.id].timestamp | date: 'short'}}">
<span class="sr-only">Scan for {{library.name}} in progress</span>
</div>
<div class="float-right">

View file

@ -24,7 +24,7 @@ export class ManageLibraryComponent implements OnInit, OnDestroy {
* If a deletion is in progress for a library
*/
deletionInProgress: boolean = false;
scanInProgress: {[key: number]: boolean} = {};
scanInProgress: {[key: number]: {progress: boolean, timestamp?: string}} = {};
libraryTrackBy = (index: number, item: Library) => `${item.name}_${item.lastScanned}_${item.type}_${item.folders.length}`;
private readonly onDestroy = new Subject<void>();
@ -41,9 +41,12 @@ export class ManageLibraryComponent implements OnInit, OnDestroy {
if (event.event != EVENTS.ScanLibraryProgress) return;
const scanEvent = event.payload as ScanLibraryProgressEvent;
this.scanInProgress[scanEvent.libraryId] = scanEvent.progress !== 100;
this.scanInProgress[scanEvent.libraryId] = {progress: scanEvent.progress !== 100};
if (scanEvent.progress === 0) {
this.scanInProgress[scanEvent.libraryId].timestamp = scanEvent.eventTime;
}
if (this.scanInProgress[scanEvent.libraryId] === false && scanEvent.progress === 100) {
if (this.scanInProgress[scanEvent.libraryId].progress === false && scanEvent.progress === 100) {
this.libraryService.getLibraries().pipe(take(1)).subscribe(libraries => {
const newLibrary = libraries.find(lib => lib.id === scanEvent.libraryId);
const existingLibrary = this.libraries.find(lib => lib.id === scanEvent.libraryId);

View file

@ -558,9 +558,12 @@ export class BookReaderComponent implements OnInit, AfterViewInit, OnDestroy {
margin = this.user.preferences.bookReaderMargin + '%';
}
this.pageStyles = {'font-family': this.user.preferences.bookReaderFontFamily, 'font-size': this.user.preferences.bookReaderFontSize + '%', 'margin-left': margin, 'margin-right': margin, 'line-height': this.user.preferences.bookReaderLineSpacing + '%'};
if (this.user.preferences.siteDarkMode && !this.user.preferences.bookReaderDarkMode) {
this.user.preferences.bookReaderDarkMode = true;
if (!afterSave) {
if (this.user.preferences.siteDarkMode && !this.user.preferences.bookReaderDarkMode) {
this.user.preferences.bookReaderDarkMode = true;
}
}
this.toggleDarkMode(this.user.preferences.bookReaderDarkMode);
} else {
this.pageStyles = {'font-family': 'default', 'font-size': '100%', 'margin-left': margin, 'margin-right': margin, 'line-height': '100%'};