Comic enhancements (#645)
* Adding multiple cases for comic naming conventions
* Changing "Chapter" to "Issue" for comic libraries
* Fixed an issue where the Parse method was using filename with extension to run regex matching, while it should be running on name without extension.
* Refactored to use Getter
* Cleaned up file to use conditional labelling rather than conditional html fragments
* Refactored code to properly check against library type for a given readinglist item
* Cleaned up series detail
* Conditionally remove special tags during parse
* Setup ParseInfoTests for ComicParserTests and also added unit tests from other comic issues created.
* Added more regex cases for naming patterns reported to be common with comics. Some cases added without regex.
* Pushing up changes
Fixed issue with cleanTitleTest.
Tried some patterns for "Cyberpunk 2077" but reverted
* Updated some cases and some spacing on Parser. Cyberpunk 2077 is not implemented as long as there is a # before issue number.
* Fixed the case for Special parsing on TPB. Fixed a piece of code that got deleted that prevented specials from rendering on volumes tab.
* Potential fix for parsing Cyberpunk 2077
- Added a ComicsSeriesSpecialCasesRegex and passed any filename that contains "Cyberpunk 2077" over to it so we can parse it separately. This could be used for any other potential problem series.
* Revert "Potential fix for parsing Cyberpunk 2077"
This reverts commit a14417e640
.
* Added more tests
* Refactored all places in Kavita to use Book, Issue, or Chapter depending on the Library type. Updated Volumes/Chapters to remove Volumes to make it cleaner.
* Removed some leftover test code
Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
This commit is contained in:
parent
f5136c8127
commit
3293e5b424
10 changed files with 392 additions and 265 deletions
|
@ -4,6 +4,7 @@ import { ToastrService } from 'ngx-toastr';
|
|||
import { take } from 'rxjs/operators';
|
||||
import { ConfirmService } from 'src/app/shared/confirm.service';
|
||||
import { UtilityService } from 'src/app/shared/_services/utility.service';
|
||||
import { LibraryType } from 'src/app/_models/library';
|
||||
import { MangaFormat } from 'src/app/_models/manga-format';
|
||||
import { ReadingList, ReadingListItem } from 'src/app/_models/reading-list';
|
||||
import { AccountService } from 'src/app/_services/account.service';
|
||||
|
@ -12,6 +13,8 @@ import { ActionService } from 'src/app/_services/action.service';
|
|||
import { ImageService } from 'src/app/_services/image.service';
|
||||
import { ReadingListService } from 'src/app/_services/reading-list.service';
|
||||
import { IndexUpdateEvent, ItemRemoveEvent } from '../dragable-ordered-list/dragable-ordered-list.component';
|
||||
import { LibraryService } from '../../_services/library.service';
|
||||
import { forkJoin } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
selector: 'app-reading-list-detail',
|
||||
|
@ -19,7 +22,6 @@ import { IndexUpdateEvent, ItemRemoveEvent } from '../dragable-ordered-list/drag
|
|||
styleUrls: ['./reading-list-detail.component.scss']
|
||||
})
|
||||
export class ReadingListDetailComponent implements OnInit {
|
||||
|
||||
items: Array<ReadingListItem> = [];
|
||||
listId!: number;
|
||||
readingList!: ReadingList;
|
||||
|
@ -32,6 +34,7 @@ export class ReadingListDetailComponent implements OnInit {
|
|||
hasDownloadingRole: boolean = false;
|
||||
downloadInProgress: boolean = false;
|
||||
|
||||
libraryTypes: {[key: number]: LibraryType} = {};
|
||||
|
||||
get MangaFormat(): typeof MangaFormat {
|
||||
return MangaFormat;
|
||||
|
@ -39,7 +42,8 @@ export class ReadingListDetailComponent implements OnInit {
|
|||
|
||||
constructor(private route: ActivatedRoute, private router: Router, private readingListService: ReadingListService,
|
||||
private actionService: ActionService, private actionFactoryService: ActionFactoryService, public utilityService: UtilityService,
|
||||
public imageService: ImageService, private accountService: AccountService, private toastr: ToastrService, private confirmService: ConfirmService) {}
|
||||
public imageService: ImageService, private accountService: AccountService, private toastr: ToastrService,
|
||||
private confirmService: ConfirmService, private libraryService: LibraryService) {}
|
||||
|
||||
ngOnInit(): void {
|
||||
const listId = this.route.snapshot.paramMap.get('id');
|
||||
|
@ -51,7 +55,21 @@ export class ReadingListDetailComponent implements OnInit {
|
|||
|
||||
this.listId = parseInt(listId, 10);
|
||||
|
||||
this.readingListService.getReadingList(this.listId).subscribe(readingList => {
|
||||
this.libraryService.getLibraries().subscribe(libs => {
|
||||
|
||||
});
|
||||
|
||||
forkJoin([
|
||||
this.libraryService.getLibraries(),
|
||||
this.readingListService.getReadingList(this.listId)
|
||||
]).subscribe(results => {
|
||||
const libraries = results[0];
|
||||
const readingList = results[1];
|
||||
|
||||
libraries.forEach(lib => {
|
||||
this.libraryTypes[lib.id] = lib.type;
|
||||
});
|
||||
|
||||
if (readingList == null) {
|
||||
// The list doesn't exist
|
||||
this.toastr.error('This list doesn\'t exist.');
|
||||
|
@ -81,7 +99,6 @@ export class ReadingListDetailComponent implements OnInit {
|
|||
}
|
||||
|
||||
performAction(action: ActionItem<any>) {
|
||||
// TODO: Try to move performAction into the actionables component. (have default handler in the component, allow for overridding to pass additional context)
|
||||
if (typeof action.callback === 'function') {
|
||||
action.callback(action.action, this.readingList);
|
||||
}
|
||||
|
@ -119,7 +136,7 @@ export class ReadingListDetailComponent implements OnInit {
|
|||
return 'Volume ' + this.utilityService.cleanSpecialTitle(item.chapterNumber);
|
||||
}
|
||||
|
||||
return 'Chapter ' + item.chapterNumber;
|
||||
return this.utilityService.formatChapterName(this.libraryTypes[item.libraryId], true, true) + item.chapterNumber;
|
||||
}
|
||||
|
||||
orderUpdated(event: IndexUpdateEvent) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue