mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
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:
parent
f22e8e88d7
commit
c328f684a0
@ -485,8 +485,7 @@ public class SeriesService : ISeriesService
|
|||||||
if (v.Number == 0) return c;
|
if (v.Number == 0) return c;
|
||||||
c.VolumeTitle = v.Name;
|
c.VolumeTitle = v.Name;
|
||||||
return c;
|
return c;
|
||||||
})).ToList();
|
}).OrderBy(c => float.Parse(c.Number), new ChapterSortComparer()));
|
||||||
|
|
||||||
|
|
||||||
foreach (var chapter in chapters)
|
foreach (var chapter in chapters)
|
||||||
{
|
{
|
||||||
@ -505,8 +504,7 @@ public class SeriesService : ISeriesService
|
|||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
retChapters = chapters
|
retChapters = chapters
|
||||||
.Where(ShouldIncludeChapter)
|
.Where(ShouldIncludeChapter);
|
||||||
.OrderBy(c => float.Parse(c.Number), new ChapterSortComparer());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var storylineChapters = volumes
|
var storylineChapters = volumes
|
||||||
|
@ -75,8 +75,8 @@ export class CardItemComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
@Input() suppressArchiveWarning: boolean = false;
|
@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;
|
@Input() count: number = 0;
|
||||||
/**
|
/**
|
||||||
* Additional information to show on the overlay area. Will always render.
|
* 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 of the entity (only applies to Series)
|
||||||
*/
|
*/
|
||||||
format: MangaFormat = MangaFormat.UNKNOWN;
|
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;
|
download$: Observable<DownloadEvent | null> | null = null;
|
||||||
|
|
||||||
@ -118,12 +118,6 @@ export class CardItemComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
private user: User | undefined;
|
private user: User | undefined;
|
||||||
|
|
||||||
get tooltipTitle() {
|
|
||||||
if (this.chapterTitle === '' || this.chapterTitle === null) return this.title;
|
|
||||||
return this.chapterTitle;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
get MangaFormat(): typeof MangaFormat {
|
get MangaFormat(): typeof MangaFormat {
|
||||||
return MangaFormat;
|
return MangaFormat;
|
||||||
}
|
}
|
||||||
@ -158,14 +152,21 @@ export class CardItemComponent implements OnInit, OnDestroy {
|
|||||||
this.format = (this.entity as Series).format;
|
this.format = (this.entity as Series).format;
|
||||||
|
|
||||||
if (this.utilityService.isChapter(this.entity)) {
|
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)) {
|
} else if (this.utilityService.isVolume(this.entity)) {
|
||||||
const vol = this.utilityService.asVolume(this.entity);
|
const vol = this.utilityService.asVolume(this.entity);
|
||||||
if (vol.chapters !== undefined && vol.chapters.length > 0) {
|
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.accountService.currentUser$.pipe(takeUntil(this.onDestroy)).subscribe(user => {
|
||||||
this.user = user;
|
this.user = user;
|
||||||
});
|
});
|
||||||
|
@ -125,7 +125,7 @@ export class SeriesDetailComponent implements OnInit, OnDestroy, AfterContentChe
|
|||||||
/**
|
/**
|
||||||
* Track by function for Chapter to tell when to refresh card data
|
* 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}`;
|
trackByRelatedSeriesIdentiy = (index: number, item: RelatedSeris) => `${item.series.name}_${item.series.libraryId}_${item.series.pagesRead}_${item.relation}`;
|
||||||
trackByStoryLineIdentity = (index: number, item: StoryLineItem) => {
|
trackByStoryLineIdentity = (index: number, item: StoryLineItem) => {
|
||||||
if (item.isChapter) {
|
if (item.isChapter) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user