Manga Reader Fixes (#1925)

* Fixed up an issue where image might be cut off in fit to height

* Removed some calls to backend for translating age rating to a string

* Fixed an issue with sizing on page splitting right to left.

* Ensure all image access requires apikey

* Removed a TODO
This commit is contained in:
Joe Milazzo 2023-04-13 15:07:11 -05:00 committed by GitHub
parent ff18389954
commit 5c1e9c0521
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 169 additions and 48 deletions

View file

@ -2,23 +2,38 @@ import { Pipe, PipeTransform } from '@angular/core';
import { Observable, of } from 'rxjs';
import { AgeRating } from '../_models/metadata/age-rating';
import { AgeRatingDto } from '../_models/metadata/age-rating-dto';
import { MetadataService } from '../_services/metadata.service';
@Pipe({
name: 'ageRating'
})
export class AgeRatingPipe implements PipeTransform {
constructor(private metadataService: MetadataService) {}
constructor() {}
transform(value: AgeRating | AgeRatingDto | undefined): Observable<string> {
if (value === undefined || value === null) return of('undefined');
if (value === undefined || value === null) return of('Unknown');
if (value.hasOwnProperty('title')) {
return of((value as AgeRatingDto).title);
}
return this.metadataService.getAgeRating((value as AgeRating));
switch(value) {
case AgeRating.Unknown: return of('Unknown');
case AgeRating.EarlyChildhood: return of('Early Childhood');
case AgeRating.AdultsOnly: return of('Adults Only 18+');
case AgeRating.Everyone: return of('Everyone');
case AgeRating.Everyone10Plus: return of('Everyone 10+');
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.RatingPending: return of('Rating Pending');
case AgeRating.Teen: return of('Teen');
case AgeRating.X18Plus: return of('X18+');
case AgeRating.NotApplicable: return of('Not Applicable');
}
return of('Unknown');
}
}