Kavita/API/Extensions/FilterDtoExtensions.cs
Joseph Milazzo 384ebcef5c
Tachiyomi Enhancements (#845)
* Added a new endpoint to get all Series with Progress info.

* Fixed up some potential NPEs during scan

* Commented out filter code, not ready for it.

* Fixed up a parsing case for european comics

* Refactored FilterDto to allow for specifying multiple formats to return.

* Refactored FilterDto to allow for specifying multiple formats to return.

* Refactored the UI to show OPDS as 3rd Party Clients since Tachiyomi now uses OPDS url scheme for authentication.
2021-12-10 13:04:52 -08:00

23 lines
550 B
C#

using System;
using System.Collections.Generic;
using API.DTOs.Filtering;
using API.Entities.Enums;
namespace API.Extensions
{
public static class FilterDtoExtensions
{
private static readonly IList<MangaFormat> AllFormats = Enum.GetValues<MangaFormat>();
public static IList<MangaFormat> GetSqlFilter(this FilterDto filter)
{
if (filter.Formats == null || filter.Formats.Count == 0)
{
return AllFormats;
}
return filter.Formats;
}
}
}