Kavita/API/Helpers/LibraryTypeHelper.cs
2023-11-02 06:35:43 -07:00

21 lines
541 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)
{
return libraryType switch
{
LibraryType.Manga => MediaFormat.Manga,
LibraryType.Comic => MediaFormat.Comic,
LibraryType.Book => MediaFormat.LightNovel,
_ => throw new ArgumentOutOfRangeException(nameof(libraryType), libraryType, null)
};
}
}