OPDS Rework (#1164)
* Fixed a bug where the bottom of the page could be cut off * Adjusted all the headings to h2, which looks better * Refactored GetSeriesDetail to actually map the names inside the code so the UI just displays. * Put in some basic improvements to OPDS by using Series Detail type layout, but this only reduces one click. * Fixed a bug where offset from scrollbar fix causes readers to be cutoff. * Ensure the hamburger menu icon is aligned with side nav * Disable the image splitting dropdown in webtoon mode * Fixed broken progress/scroll code as we scroll on the body instead of window now * Fixed phone-hidden class not working due to a bad media query * Lots of changes to OPDS to provide a richer text experience. Uses Issues or Books based on library type. Cleans up the experience by providing Storyline from the get-go. * Updated OPDS-SE search description to include collections and reading lists. * Fixed up some title stuff * If a volume only has one file underneath it, flatten it and send a chapter as if it were the volume. * Code cleanup
This commit is contained in:
parent
50306a62ad
commit
fb29d78c3b
6 changed files with 106 additions and 53 deletions
|
@ -472,23 +472,11 @@ public class SeriesService : ISeriesService
|
|||
var specials = new List<ChapterDto>();
|
||||
foreach (var chapter in chapters)
|
||||
{
|
||||
chapter.Title = FormatChapterTitle(chapter, libraryType);
|
||||
if (chapter.IsSpecial)
|
||||
{
|
||||
chapter.Title = Parser.Parser.CleanSpecialTitle(chapter.Title);
|
||||
specials.Add(chapter);
|
||||
}
|
||||
else
|
||||
{
|
||||
var title = libraryType switch
|
||||
{
|
||||
LibraryType.Book => $"Book {chapter.Title}",
|
||||
LibraryType.Comic => $"Issue #{chapter.Title}",
|
||||
LibraryType.Manga => $"Chapter {chapter.Title}",
|
||||
_ => "Chapter "
|
||||
};
|
||||
chapter.Title = title;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -528,4 +516,49 @@ public class SeriesService : ISeriesService
|
|||
{
|
||||
return !c.IsSpecial && !c.Number.Equals(Parser.Parser.DefaultChapter);
|
||||
}
|
||||
|
||||
public static string FormatChapterTitle(ChapterDto chapter, LibraryType libraryType)
|
||||
{
|
||||
if (chapter.IsSpecial)
|
||||
{
|
||||
return Parser.Parser.CleanSpecialTitle(chapter.Title);
|
||||
}
|
||||
return libraryType switch
|
||||
{
|
||||
LibraryType.Book => $"Book {chapter.Title}",
|
||||
LibraryType.Comic => $"Issue #{chapter.Title}",
|
||||
LibraryType.Manga => $"Chapter {chapter.Title}",
|
||||
_ => "Chapter "
|
||||
};
|
||||
}
|
||||
|
||||
public static string FormatChapterTitle(Chapter chapter, LibraryType libraryType)
|
||||
{
|
||||
if (chapter.IsSpecial)
|
||||
{
|
||||
return Parser.Parser.CleanSpecialTitle(chapter.Title);
|
||||
}
|
||||
return libraryType switch
|
||||
{
|
||||
LibraryType.Book => $"Book {chapter.Title}",
|
||||
LibraryType.Comic => $"Issue #{chapter.Title}",
|
||||
LibraryType.Manga => $"Chapter {chapter.Title}",
|
||||
_ => "Chapter "
|
||||
};
|
||||
}
|
||||
|
||||
public static string FormatChapterName(LibraryType libraryType, bool withHash = false)
|
||||
{
|
||||
switch (libraryType)
|
||||
{
|
||||
case LibraryType.Manga:
|
||||
return "Chapter";
|
||||
case LibraryType.Comic:
|
||||
return withHash ? "Issue #" : "Issue";
|
||||
case LibraryType.Book:
|
||||
return "Book";
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException(nameof(libraryType), libraryType, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue