From 09dcbf2618a9df453aaa43e914f2bebab1dffb31 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 19 Apr 2023 16:00:05 -0700 Subject: [PATCH] Fixed: Tag filtering on iCal feed Closes #3547 (cherry picked from commit a989c84260923485b4baa81ba47929979cfe9aa5) --- src/Lidarr.Api.V1/Calendar/CalendarFeedController.cs | 10 +++++----- src/NzbDrone.Core/Parser/Model/ParsedAlbumInfo.cs | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Lidarr.Api.V1/Calendar/CalendarFeedController.cs b/src/Lidarr.Api.V1/Calendar/CalendarFeedController.cs index 7c3a03afe..d779ecc51 100644 --- a/src/Lidarr.Api.V1/Calendar/CalendarFeedController.cs +++ b/src/Lidarr.Api.V1/Calendar/CalendarFeedController.cs @@ -28,15 +28,15 @@ namespace Lidarr.Api.V1.Calendar } [HttpGet("Lidarr.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(); + var parsedTags = new List(); - 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 albums = _albumService.AlbumsBetweenDates(start, end, unmonitored); @@ -53,7 +53,7 @@ namespace Lidarr.Api.V1.Calendar { var artist = _artistService.GetArtist(album.ArtistId); // Temp fix TODO: Figure out why Album.Artist is not populated during AlbumsBetweenDates Query - if (tags.Any() && tags.None(artist.Tags.Contains)) + if (parsedTags.Any() && parsedTags.None(artist.Tags.Contains)) { continue; } diff --git a/src/NzbDrone.Core/Parser/Model/ParsedAlbumInfo.cs b/src/NzbDrone.Core/Parser/Model/ParsedAlbumInfo.cs index 0fb1b700e..be30e257f 100644 --- a/src/NzbDrone.Core/Parser/Model/ParsedAlbumInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ParsedAlbumInfo.cs @@ -8,6 +8,7 @@ namespace NzbDrone.Core.Parser.Model { public string AlbumTitle { get; set; } public string ArtistName { get; set; } + public string AlbumType { get; set; } public ArtistTitleInfo ArtistTitleInfo { get; set; } public QualityModel Quality { get; set; } public string ReleaseDate { get; set; }