Fixed up some logic around the magazine to undo a previous direction

This commit is contained in:
Joseph Milazzo 2025-05-04 10:00:20 -05:00
parent 08a32a26bc
commit bad5c9dcd6
3 changed files with 5 additions and 3 deletions

View file

@ -5,7 +5,7 @@ namespace API.DTOs;
/// <summary> /// <summary>
/// Simple pairing of LibraryId and LibraryType /// Simple pairing of LibraryId and LibraryType
/// </summary> /// </summary>
public class LibraryTypeDto public sealed record LibraryTypeDto
{ {
public int LibraryId { get; set; } public int LibraryId { get; set; }
public LibraryType LibraryType { get; set; } public LibraryType LibraryType { get; set; }

View file

@ -4,6 +4,7 @@ using API.Data.Metadata;
using API.Entities.Enums; using API.Entities.Enums;
namespace API.Services.Tasks.Scanner.Parser; namespace API.Services.Tasks.Scanner.Parser;
#nullable enable
public class MagazineParser(IDirectoryService directoryService) : DefaultParser(directoryService) public class MagazineParser(IDirectoryService directoryService) : DefaultParser(directoryService)
{ {
@ -17,7 +18,7 @@ public class MagazineParser(IDirectoryService directoryService) : DefaultParser(
Volumes = Parser.LooseLeafVolume, Volumes = Parser.LooseLeafVolume,
Chapters = Parser.DefaultChapter, Chapters = Parser.DefaultChapter,
ComicInfo = comicInfo, ComicInfo = comicInfo,
Format = MangaFormat.Image, Format = Parser.ParseFormat(filePath),
Filename = Path.GetFileName(filePath), Filename = Path.GetFileName(filePath),
FullFilePath = Parser.NormalizePath(filePath), FullFilePath = Parser.NormalizePath(filePath),
Series = string.Empty, Series = string.Empty,
@ -71,7 +72,7 @@ public class MagazineParser(IDirectoryService directoryService) : DefaultParser(
} }
/// <summary> /// <summary>
/// Only applicable for Image files and Image library type /// Only applicable for PDF Files and Magazine library type
/// </summary> /// </summary>
/// <param name="filePath"></param> /// <param name="filePath"></param>
/// <param name="type"></param> /// <param name="type"></param>

View file

@ -647,6 +647,7 @@ export class BookReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.bookService.getBookInfo(this.chapterId).subscribe(info => { this.bookService.getBookInfo(this.chapterId).subscribe(info => {
this.libraryService.getLibraryType(this.libraryId).pipe(take(1)).subscribe(type => { this.libraryService.getLibraryType(this.libraryId).pipe(take(1)).subscribe(type => {
this.libraryType = type; this.libraryType = type;
this.cdRef.markForCheck(); this.cdRef.markForCheck();