mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Bugfixes from last PR (#1928)
* Fixed a regression where confirm-email was validating for a real email when it's not required. * Fixed fit to screen breaking as canvas was still showing on the screen when it should have been hidden. * Fixed a missing age rating in the pipe * Fixed fit to height not properly aligning the image * Tweaked Startup check for base url
This commit is contained in:
parent
2b1570b144
commit
10e4b318cb
@ -1,9 +1,5 @@
|
||||
namespace API.Errors;
|
||||
|
||||
public record ApiException
|
||||
{
|
||||
public ApiException(int status, string? message = null, string? details = null)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
#nullable enable
|
||||
public record ApiException(int Status, string? Message = null, string? Details = null);
|
||||
#nullable disable
|
||||
|
@ -401,7 +401,7 @@ public class Startup
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
if (ex.Message.Contains("Permission denied") && baseUrl.Equals(Configuration.DefaultBaseUrl) && new OsInfo().IsDocker)
|
||||
if ((ex.Message.Contains("Permission denied") || ex.Message.Contains("UnauthorizedAccessException")) && baseUrl.Equals(Configuration.DefaultBaseUrl) && new OsInfo().IsDocker)
|
||||
{
|
||||
// Swallow the exception as the install is non-root and Docker
|
||||
return;
|
||||
|
@ -2,5 +2,5 @@
|
||||
"TokenKey": "super secret unguessable key",
|
||||
"Port": 5000,
|
||||
"IpAddresses": "",
|
||||
"BaseUrl": "/test/"
|
||||
"BaseUrl": "/"
|
||||
}
|
@ -16,7 +16,7 @@ public class OsInfo : IOsInfo
|
||||
public static bool IsWindows => Os == Os.Windows;
|
||||
|
||||
// this needs to not be static so we can mock it
|
||||
public bool IsDocker { get; }
|
||||
public bool IsDocker { get; private set; }
|
||||
|
||||
public string Version { get; }
|
||||
public string Name { get; }
|
||||
@ -41,7 +41,6 @@ public class OsInfo : IOsInfo
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public OsInfo(IEnumerable<IOsVersionAdapter> versionAdapters)
|
||||
|
@ -14,7 +14,7 @@ img {
|
||||
}
|
||||
|
||||
&.full-height {
|
||||
height: calc(100vh - $scrollbarHeight);
|
||||
height: calc(100vh); // We need to - $scrollbarHeight when there is a horizontal scroll on macos
|
||||
display: flex;
|
||||
align-content: center;
|
||||
}
|
||||
|
@ -1,13 +0,0 @@
|
||||
import { DetailsVersion } from "./details-version";
|
||||
|
||||
|
||||
export interface ClientInfo {
|
||||
os: DetailsVersion,
|
||||
browser: DetailsVersion,
|
||||
platformType: string,
|
||||
kavitaUiVersion: string,
|
||||
screenResolution: string;
|
||||
usingDarkTheme: boolean;
|
||||
|
||||
collectedAt?: Date;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
export interface DetailsVersion {
|
||||
name: string;
|
||||
version: string;
|
||||
}
|
@ -67,7 +67,8 @@ export class ManageEmailSettingsComponent implements OnInit {
|
||||
}
|
||||
|
||||
testEmailServiceUrl() {
|
||||
this.settingsService.testEmailServerSettings(this.settingsForm.get('emailServiceUrl')?.value || '').pipe(take(1)).subscribe(async (result: EmailTestResult) => {
|
||||
if (this.settingsForm.get('emailServiceUrl')?.value === '') return;
|
||||
this.settingsService.testEmailServerSettings(this.settingsForm.get('emailServiceUrl')?.value).pipe(take(1)).subscribe(async (result: EmailTestResult) => {
|
||||
if (result.successful) {
|
||||
this.toastr.success('Email Service was reachable');
|
||||
} else {
|
||||
|
@ -8,6 +8,8 @@ import { ReaderSetting } from '../../_models/reader-setting';
|
||||
import { ImageRenderer } from '../../_models/renderer';
|
||||
import { ManagaReaderService } from '../../_series/managa-reader.service';
|
||||
|
||||
const ValidSplits = [PageSplitOption.SplitLeftToRight, PageSplitOption.SplitRightToLeft];
|
||||
|
||||
@Component({
|
||||
selector: 'app-canvas-renderer',
|
||||
templateUrl: './canvas-renderer.component.html',
|
||||
@ -178,10 +180,16 @@ export class CanvasRendererComponent implements OnInit, AfterViewInit, OnDestroy
|
||||
if (!this.ctx || !this.canvas) return;
|
||||
this.canvasImage = img[0];
|
||||
this.cdRef.markForCheck();
|
||||
|
||||
if (this.layoutMode !== LayoutMode.Single || !ValidSplits.includes(this.pageSplit)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const needsSplitting = this.updateSplitPage();
|
||||
if (!needsSplitting) return;
|
||||
|
||||
// This is toggling true when manga reader shouldn't use this code
|
||||
|
||||
this.renderWithCanvas = true;
|
||||
if (this.currentImageSplitPart === SPLIT_PAGE_PART.NO_SPLIT) return;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<ng-container *ngIf="isValid() && !this.mangaReaderService.shouldSplit(this.currentImage, this.pageSplit)">
|
||||
<div class="image-container {{imageFitClass$ | async}}"
|
||||
[style.filter]="(darkenss$ | async) ?? '' | safeStyle">
|
||||
[style.filter]="(darkenss$ | async) ?? '' | safeStyle" [style.height]="(imageContainerHeight$ | async) ?? '' | safeStyle">
|
||||
<ng-container *ngIf="currentImage">
|
||||
<img alt=" "
|
||||
#image [src]="currentImage.src"
|
||||
|
@ -27,6 +27,7 @@ export class SingleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
||||
@Output() imageHeight: EventEmitter<number> = new EventEmitter<number>();
|
||||
|
||||
imageFitClass$!: Observable<string>;
|
||||
imageContainerHeight$!: Observable<string>;
|
||||
showClickOverlayClass$!: Observable<string>;
|
||||
readerModeClass$!: Observable<string>;
|
||||
darkenss$: Observable<string> = of('brightness(100%)');
|
||||
@ -43,7 +44,7 @@ export class SingleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
||||
get LayoutMode() {return LayoutMode;}
|
||||
|
||||
constructor(private readonly cdRef: ChangeDetectorRef, public mangaReaderService: ManagaReaderService,
|
||||
@Inject(DOCUMENT) private document: Document, private readerService: ReaderService) { }
|
||||
@Inject(DOCUMENT) private document: Document) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.readerModeClass$ = this.readerSettings$.pipe(
|
||||
@ -53,13 +54,28 @@ export class SingleRendererComponent implements OnInit, OnDestroy, ImageRenderer
|
||||
takeUntil(this.onDestroy)
|
||||
);
|
||||
|
||||
this.imageContainerHeight$ = this.readerSettings$.pipe(
|
||||
map(values => values.fitting),
|
||||
map(mode => {
|
||||
if ( mode !== FITTING_OPTION.HEIGHT) return '';
|
||||
|
||||
const readingArea = this.document.querySelector('.reading-area');
|
||||
if (!readingArea) return 'calc(100vh)';
|
||||
|
||||
if (this.currentImage.width - readingArea.scrollWidth > 0) {
|
||||
return 'calc(100vh - 34px)'
|
||||
}
|
||||
return 'calc(100vh)'
|
||||
}),
|
||||
filter(_ => this.isValid()),
|
||||
takeUntil(this.onDestroy)
|
||||
);
|
||||
|
||||
this.pageNum$.pipe(
|
||||
takeUntil(this.onDestroy),
|
||||
tap(pageInfo => {
|
||||
this.pageNum = pageInfo.pageNum;
|
||||
this.maxPages = pageInfo.maxPages;
|
||||
|
||||
// TODO: Put this here this.currentImage = this.getPagez
|
||||
}),
|
||||
).subscribe(() => {});
|
||||
|
||||
|
@ -26,7 +26,8 @@ export class AgeRatingPipe implements PipeTransform {
|
||||
case AgeRating.G: return of('G');
|
||||
case AgeRating.KidsToAdults: return of('Kids to Adults');
|
||||
case AgeRating.Mature: return of('Mature');
|
||||
case AgeRating.Mature17Plus: return of('M');
|
||||
case AgeRating.Mature15Plus: return of('MA15+');
|
||||
case AgeRating.Mature17Plus: return of('Mature 17+');
|
||||
case AgeRating.RatingPending: return of('Rating Pending');
|
||||
case AgeRating.Teen: return of('Teen');
|
||||
case AgeRating.X18Plus: return of('X18+');
|
||||
|
@ -19,7 +19,7 @@ export class ConfirmEmailComponent {
|
||||
token: string = '';
|
||||
|
||||
registerForm: FormGroup = new FormGroup({
|
||||
email: new FormControl('', [Validators.required, Validators.email]),
|
||||
email: new FormControl('', [Validators.required]),
|
||||
username: new FormControl('', [Validators.required]),
|
||||
password: new FormControl('', [Validators.required, Validators.maxLength(32), Validators.minLength(6), Validators.pattern("^.{6,32}$")]),
|
||||
});
|
||||
|
@ -7,7 +7,7 @@
|
||||
"name": "GPL-3.0",
|
||||
"url": "https://github.com/Kareadita/Kavita/blob/develop/LICENSE"
|
||||
},
|
||||
"version": "0.7.1.34"
|
||||
"version": "0.7.1.35"
|
||||
},
|
||||
"servers": [
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user