OPDS Enhancements (#1687)

* Bump express from 4.17.2 to 4.18.2 in /UI/Web

Bumps [express](https://github.com/expressjs/express) from 4.17.2 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.2...4.18.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump decode-uri-component from 0.2.0 to 0.2.2 in /UI/Web

Bumps [decode-uri-component](https://github.com/SamVerschueren/decode-uri-component) from 0.2.0 to 0.2.2.
- [Release notes](https://github.com/SamVerschueren/decode-uri-component/releases)
- [Commits](https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.2)

---
updated-dependencies:
- dependency-name: decode-uri-component
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Bump qs and express in /UI/Web

Bumps [qs](https://github.com/ljharb/qs) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `qs` from 6.5.3 to 6.11.0
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.5.3...v6.11.0)

Updates `express` from 4.17.2 to 4.18.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.2...4.18.2)

---
updated-dependencies:
- dependency-name: qs
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Added genre and authors to Series level, added summary to volume and chapter level.

Force order on reading list title as Chunky enforces their own sort order and doesn't respect the spec.

* Moved all the reading list formatting logic to the backend. This allows us to re-use the UI logic for OPDS streams.

* Fixed a broken unit test

* Code smells

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This commit is contained in:
Joe Milazzo 2022-12-10 11:07:55 -06:00 committed by GitHub
parent fbd9b36e35
commit 1a729adf40
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 369 additions and 344 deletions

View file

@ -1,3 +1,4 @@
import { LibraryType } from "./library";
import { MangaFormat } from "./manga-format";
export interface ReadingListItem {
@ -13,6 +14,8 @@ export interface ReadingListItem {
libraryId: number;
id: number;
releaseDate: string;
title: string;
libraryType: LibraryType;
}
export interface ReadingList {

View file

@ -10,7 +10,7 @@
<div class="flex-grow-1">
<div class="g-0">
<h5 class="mb-1 pb-0" id="item.id--{{position}}">
{{title}}
{{item.title}}
<div class="float-end">
<button class="btn btn-primary" (click)="readChapter(item)">
<span>
@ -23,8 +23,8 @@
<i class="fa fa-trash me-1" aria-hidden="true"></i>
</span>
<span class="d-none d-sm-inline-block">Remove</span>
</button>
</div>
</button>
</div>
</h5>
<div class="ps-1 d-none d-md-inline-block">

View file

@ -24,8 +24,6 @@ export class ReadingListItemComponent implements OnInit {
@Output() read: EventEmitter<ReadingListItem> = new EventEmitter();
@Output() remove: EventEmitter<ReadingListItem> = new EventEmitter();
title: string = '';
get MangaFormat(): typeof MangaFormat {
return MangaFormat;
}
@ -33,34 +31,7 @@ export class ReadingListItemComponent implements OnInit {
constructor(public imageService: ImageService, private utilityService: UtilityService,
private readonly cdRef: ChangeDetectorRef) { }
ngOnInit(): void {
this.formatTitle(this.item);
}
formatTitle(item: ReadingListItem) {
if (item.chapterNumber === '0') {
this.title = 'Volume ' + item.volumeNumber;
}
if (item.seriesFormat === MangaFormat.EPUB) {
const specialTitle = this.utilityService.cleanSpecialTitle(item.chapterNumber);
if (specialTitle === '0') {
this.title = 'Volume ' + this.utilityService.cleanSpecialTitle(item.volumeNumber);
} else {
this.title = 'Volume ' + specialTitle;
}
}
let chapterNum = item.chapterNumber;
if (!item.chapterNumber.match(/^\d+$/)) {
chapterNum = this.utilityService.cleanSpecialTitle(item.chapterNumber);
}
if (this.title === '') {
this.title = this.utilityService.formatChapterName(this.libraryTypes[item.libraryId], true, true) + chapterNum;
}
this.cdRef.markForCheck();
}
ngOnInit(): void {}
readChapter(item: ReadingListItem) {
this.read.emit(item);