mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-05-24 00:52:23 -04:00
25 lines
773 B
C#
25 lines
773 B
C#
using System;
|
|
using API.DTOs.Scrobbling;
|
|
using API.Entities.Enums;
|
|
|
|
namespace API.Helpers;
|
|
#nullable enable
|
|
|
|
public static class LibraryTypeHelper
|
|
{
|
|
public static MediaFormat GetFormat(LibraryType libraryType)
|
|
{
|
|
// TODO: Refactor this to an extension on LibraryType
|
|
return libraryType switch
|
|
{
|
|
LibraryType.Manga => MediaFormat.Manga,
|
|
LibraryType.Comic => MediaFormat.Comic,
|
|
LibraryType.LightNovel => MediaFormat.LightNovel,
|
|
LibraryType.Book => MediaFormat.LightNovel,
|
|
LibraryType.Image => MediaFormat.Manga,
|
|
LibraryType.ComicVine => MediaFormat.Comic,
|
|
_ => throw new ArgumentOutOfRangeException(nameof(libraryType), libraryType, null)
|
|
};
|
|
}
|
|
}
|