mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-05-24 02:02:36 -04:00
Fix dateonly parsing of filters
This commit is contained in:
parent
fec468401f
commit
abffdedf3e
@ -215,14 +215,16 @@ public abstract record Filter<T> : Filter
|
||||
});
|
||||
}
|
||||
|
||||
if (type == typeof(DateTime))
|
||||
if (type == typeof(DateTime) || type == typeof(DateOnly))
|
||||
{
|
||||
return from year in Parse.Digit.Repeat(4).Text().Select(int.Parse)
|
||||
from yd in Parse.Char('-')
|
||||
from mouth in Parse.Digit.Repeat(2).Text().Select(int.Parse)
|
||||
from month in Parse.Digit.Repeat(2).Text().Select(int.Parse)
|
||||
from md in Parse.Char('-')
|
||||
from day in Parse.Digit.Repeat(2).Text().Select(int.Parse)
|
||||
select new DateTime(year, mouth, day) as object;
|
||||
select type == typeof(DateTime)
|
||||
? new DateTime(year, month, day) as object
|
||||
: new DateOnly(year, month, day) as object;
|
||||
}
|
||||
|
||||
if (typeof(IEnumerable).IsAssignableFrom(type))
|
||||
|
@ -49,6 +49,8 @@ public static class MeilisearchModule
|
||||
CamelCase.ConvertName(nameof(Movie.Genres)),
|
||||
CamelCase.ConvertName(nameof(Movie.Status)),
|
||||
CamelCase.ConvertName(nameof(Movie.AirDate)),
|
||||
CamelCase.ConvertName(nameof(Show.StartAir)),
|
||||
CamelCase.ConvertName(nameof(Show.EndAir)),
|
||||
CamelCase.ConvertName(nameof(Movie.StudioId)),
|
||||
"kind"
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user