Release Testing Day 3 (#1496)

* Tweaked log messaging for library scan when no files were scanned.

* When a theme that is set gets removed due to a scan, inform the user to refresh.

* Fixed a typo and make Darkness -> Brightness

* Make download theme files allowed to be invoked by non-authenticated users, to allow new users to get the default theme.

* Hide all series side nav item if there are no libraries exposed to the user

* Fixed an API for Tachiyomi when syncing progress

* Fixed dashboard not responding to Series Removed and Added events.

Ensure we send SeriesRemoved events when they are deleted.

* Reverted Hangfire SQLite due to aborted jobs being resumed, when they shouldnt. Fixed some scan loop issues where cover gen wouldn't be invoked always on new libraries.
This commit is contained in:
Joseph Milazzo 2022-09-01 13:45:34 -05:00 committed by GitHub
parent ab21c1b49e
commit f2249ea39b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 58 additions and 28 deletions

View file

@ -2,7 +2,8 @@ import { DOCUMENT } from '@angular/common';
import { HttpClient } from '@angular/common/http';
import { Inject, Injectable, OnDestroy, Renderer2, RendererFactory2, SecurityContext } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { map, ReplaySubject, Subject, takeUntil } from 'rxjs';
import { ToastrService } from 'ngx-toastr';
import { map, ReplaySubject, Subject, takeUntil, take } from 'rxjs';
import { environment } from 'src/environments/environment';
import { ConfirmService } from '../shared/confirm.service';
import { NotificationProgressEvent } from '../_models/events/notification-progress-event';
@ -35,7 +36,7 @@ export class ThemeService implements OnDestroy {
constructor(rendererFactory: RendererFactory2, @Inject(DOCUMENT) private document: Document, private httpClient: HttpClient,
messageHub: MessageHubService, private domSantizer: DomSanitizer, private confirmService: ConfirmService) {
messageHub: MessageHubService, private domSantizer: DomSanitizer, private confirmService: ConfirmService, private toastr: ToastrService) {
this.renderer = rendererFactory.createRenderer(null, null);
this.getThemes();
@ -47,7 +48,9 @@ export class ThemeService implements OnDestroy {
if (notificationEvent.name !== EVENTS.SiteThemeProgress) return;
if (notificationEvent.eventType === 'ended') {
if (notificationEvent.name === EVENTS.SiteThemeProgress) this.getThemes().subscribe(() => {});
if (notificationEvent.name === EVENTS.SiteThemeProgress) this.getThemes().subscribe(() => {
});
}
});
}
@ -73,6 +76,12 @@ export class ThemeService implements OnDestroy {
return this.httpClient.get<SiteTheme[]>(this.baseUrl + 'theme').pipe(map(themes => {
this.themeCache = themes;
this.themesSource.next(themes);
this.currentTheme$.pipe(take(1)).subscribe(theme => {
if (!themes.includes(theme)) {
this.setTheme(this.defaultTheme);
this.toastr.info('The active theme no longer exists. Please refresh the page.');
}
});
return themes;
}));
}

View file

@ -57,7 +57,7 @@ export class DashboardComponent implements OnInit, OnDestroy {
this.seriesService.getSeries(seriesAddedEvent.seriesId).subscribe(series => {
this.recentlyAddedSeries.unshift(series);
this.cdRef.markForCheck();
this.cdRef.detectChanges();
});
} else if (res.event === EVENTS.SeriesRemoved) {
const seriesRemovedEvent = res.payload as SeriesRemovedEvent;

View file

@ -218,7 +218,7 @@
</div>
<div class="row mb-2">
<div class="col-md-6 col-sm-12">
<label for="darkness" class="form-label range-label">Darkess</label>
<label for="darkness" class="form-label range-label">Brightness</label>
<input type="range" class="form-range" id="darkness"
min="10" max="100" step="1" formControlName="darkness">
<span class="range-text">{{generalSettingsForm.get('darkness')?.value + '%'}}</span>

View file

@ -12,7 +12,7 @@
<app-side-nav-item icon="fa-list" title="Collections" link="/collections/"></app-side-nav-item>
<app-side-nav-item icon="fa-list-ol" title="Reading Lists" link="/lists/"></app-side-nav-item>
<app-side-nav-item icon="fa-bookmark" title="Bookmarks" link="/bookmarks/"></app-side-nav-item>
<app-side-nav-item icon="fa-regular fa-rectangle-list" title="All Series" link="/all-series/"></app-side-nav-item>
<app-side-nav-item icon="fa-regular fa-rectangle-list" title="All Series" link="/all-series/" *ngIf="libraries.length > 0"></app-side-nav-item>
<div class="mb-2 mt-3 ms-2 me-2" *ngIf="libraries.length > 10 && !(navService?.sideNavCollapsed$ | async)">
<label for="filter" class="form-label visually-hidden">Filter</label>
<div class="form-group">

View file

@ -20,7 +20,7 @@
<h5 class="card-title">{{theme.name | sentenceCase}}</h5>
<h6 class="card-subtitle mb-2 text-muted">{{theme.provider | siteThemeProvider}}</h6>
<button class="btn btn-secondary me-2" [disabled]="theme.isDefault" *ngIf="isAdmin" (click)="updateDefault(theme)">Set Default</button>
<button class="btn btn-primary" (click)="applyTheme(theme)" [disabled]="currentTheme.id === theme.id">{{currentTheme.id === theme.id ? 'Applied' : 'Apply'}}</button>
<button class="btn btn-primary" (click)="applyTheme(theme)" [disabled]="currentTheme?.id === theme.id">{{currentTheme?.id === theme.id ? 'Applied' : 'Apply'}}</button>
</div>
</div>
</ng-container>

View file

@ -14,7 +14,7 @@ import { AccountService } from 'src/app/_services/account.service';
})
export class ThemeManagerComponent implements OnInit, OnDestroy {
currentTheme!: SiteTheme;
currentTheme: SiteTheme | undefined;
isAdmin: boolean = false;
user: User | undefined;