mirror of
https://github.com/Radarr/Radarr.git
synced 2024-09-11 12:02:35 +02:00
parent
5e63da418e
commit
3fb337e20b
@ -26,15 +26,15 @@ public CalendarFeedController(IMovieService movieService, ITagService tagService
|
||||
}
|
||||
|
||||
[HttpGet("Radarr.ics")]
|
||||
public IActionResult GetCalendarFeed(int pastDays = 7, int futureDays = 28, string tagList = "", bool unmonitored = false)
|
||||
public IActionResult GetCalendarFeed(int pastDays = 7, int futureDays = 28, string tags = "", bool unmonitored = false)
|
||||
{
|
||||
var start = DateTime.Today.AddDays(-pastDays);
|
||||
var end = DateTime.Today.AddDays(futureDays);
|
||||
var tags = new List<int>();
|
||||
var parsedTags = new List<int>();
|
||||
|
||||
if (tagList.IsNotNullOrWhiteSpace())
|
||||
if (tags.IsNotNullOrWhiteSpace())
|
||||
{
|
||||
tags.AddRange(tagList.Split(',').Select(_tagService.GetTag).Select(t => t.Id));
|
||||
parsedTags.AddRange(tags.Split(',').Select(_tagService.GetTag).Select(t => t.Id));
|
||||
}
|
||||
|
||||
var movies = _movieService.GetMoviesBetweenDates(start, end, unmonitored);
|
||||
@ -49,7 +49,7 @@ public IActionResult GetCalendarFeed(int pastDays = 7, int futureDays = 28, stri
|
||||
|
||||
foreach (var movie in movies.OrderBy(v => v.Added))
|
||||
{
|
||||
if (tags.Any() && tags.None(movie.Tags.Contains))
|
||||
if (parsedTags.Any() && parsedTags.None(movie.Tags.Contains))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user