Volume relative numbering (#1421)

* Order issues by volume first is series detail

* Display volume along with chapter in chapters tab

* Move volume title to tooltip in card-item

* Consolidate card-item tooltip into one variable.

* Version as per comments
This commit is contained in:
tjarls 2022-08-14 14:40:46 +01:00 committed by GitHub
parent f22e8e88d7
commit c328f684a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 18 deletions

View File

@ -485,8 +485,7 @@ public class SeriesService : ISeriesService
if (v.Number == 0) return c;
c.VolumeTitle = v.Name;
return c;
})).ToList();
}).OrderBy(c => float.Parse(c.Number), new ChapterSortComparer()));
foreach (var chapter in chapters)
{
@ -505,8 +504,7 @@ public class SeriesService : ISeriesService
} else
{
retChapters = chapters
.Where(ShouldIncludeChapter)
.OrderBy(c => float.Parse(c.Number), new ChapterSortComparer());
.Where(ShouldIncludeChapter);
}
var storylineChapters = volumes

View File

@ -75,8 +75,8 @@ export class CardItemComponent implements OnInit, OnDestroy {
*/
@Input() suppressArchiveWarning: boolean = false;
/**
* The number of updates/items within the card. If less than 2, will not be shown.
*/
* The number of updates/items within the card. If less than 2, will not be shown.
*/
@Input() count: number = 0;
/**
* Additional information to show on the overlay area. Will always render.
@ -99,10 +99,10 @@ export class CardItemComponent implements OnInit, OnDestroy {
* Format of the entity (only applies to Series)
*/
format: MangaFormat = MangaFormat.UNKNOWN;
chapterTitle: string = '';
tooltipTitle: string = this.title;
/**
* This is the download we get from download service.
* This is the download we get from download service.
*/
download$: Observable<DownloadEvent | null> | null = null;
@ -118,12 +118,6 @@ export class CardItemComponent implements OnInit, OnDestroy {
private user: User | undefined;
get tooltipTitle() {
if (this.chapterTitle === '' || this.chapterTitle === null) return this.title;
return this.chapterTitle;
}
get MangaFormat(): typeof MangaFormat {
return MangaFormat;
}
@ -158,14 +152,21 @@ export class CardItemComponent implements OnInit, OnDestroy {
this.format = (this.entity as Series).format;
if (this.utilityService.isChapter(this.entity)) {
this.chapterTitle = this.utilityService.asChapter(this.entity).titleName;
const chapterTitle = this.utilityService.asChapter(this.entity).titleName;
if (chapterTitle === '' || chapterTitle === null) {
this.tooltipTitle = (this.utilityService.asChapter(this.entity).volumeTitle + ' ' + this.title).trim();
} else {
this.tooltipTitle = chapterTitle;
}
} else if (this.utilityService.isVolume(this.entity)) {
const vol = this.utilityService.asVolume(this.entity);
if (vol.chapters !== undefined && vol.chapters.length > 0) {
this.chapterTitle = vol.chapters[0].titleName;
this.tooltipTitle = vol.chapters[0].titleName;
}
if (this.tooltipTitle === '') {
this.tooltipTitle = vol.name;
}
}
this.accountService.currentUser$.pipe(takeUntil(this.onDestroy)).subscribe(user => {
this.user = user;
});

View File

@ -125,7 +125,7 @@ export class SeriesDetailComponent implements OnInit, OnDestroy, AfterContentChe
/**
* Track by function for Chapter to tell when to refresh card data
*/
trackByChapterIdentity = (index: number, item: Chapter) => `${item.title}_${item.number}_${item.pagesRead}`;
trackByChapterIdentity = (index: number, item: Chapter) => `${item.title}_${item.number}_${item.volumeId}_${item.pagesRead}`;
trackByRelatedSeriesIdentiy = (index: number, item: RelatedSeris) => `${item.series.name}_${item.series.libraryId}_${item.series.pagesRead}_${item.relation}`;
trackByStoryLineIdentity = (index: number, item: StoryLineItem) => {
if (item.isChapter) {