Skip to content

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Fixed the logic for caluclating time to read on comics

Joseph Milazzo3c92b6d8a525
diff --git a/UI/Web/src/app/series-detail/series-metadata-detail/series-metadata-detail.component.ts b/UI/Web/src/app/series-detail/series-metadata-detail/series-metadata-detail.component.ts
index f7897cef3..f4f5a2fda 100644
--- a/UI/Web/src/app/series-detail/series-metadata-detail/series-metadata-detail.component.ts
+++ b/UI/Web/src/app/series-detail/series-metadata-detail/series-metadata-detail.component.ts
@@ -71,13 +71,13 @@ export class SeriesMetadataDetailComponent implements OnInit, OnChanges {
}
- if (this.series !== null && this.series.wordCount > 0) {
- if (this.series.format === MangaFormat.EPUB) {
+ if (this.series !== null) {
+ if (this.series.format === MangaFormat.EPUB && this.series.wordCount > 0) {
this.minHoursToRead = parseInt(Math.round(this.series.wordCount / MAX_WORDS_PER_HOUR) + '', 10);
this.maxHoursToRead = parseInt(Math.round(this.series.wordCount / MIN_WORDS_PER_HOUR) + '', 10);
- } else {
- this.minHoursToRead = parseInt(Math.round((this.series.wordCount * MAX_PAGES_PER_MINUTE) / 60) + '', 10);
- this.maxHoursToRead = parseInt(Math.round((this.series.wordCount * MIN_PAGES_PER_MINUTE) / 60) + '', 10);
+ } else if (this.series.format !== MangaFormat.EPUB) {
+ this.minHoursToRead = parseInt(Math.round((this.series.pages / MIN_PAGES_PER_MINUTE) / 60) + '', 10);
+ this.maxHoursToRead = parseInt(Math.round((this.series.pages / MAX_PAGES_PER_MINUTE) / 60) + '', 10);
}
}
}