mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Fixed: Tag filtering on iCal feed
Closes #3547 (cherry picked from commit a989c84260923485b4baa81ba47929979cfe9aa5)
This commit is contained in:
parent
3d7d43bb46
commit
09dcbf2618
2 changed files with 6 additions and 5 deletions
|
@ -28,15 +28,15 @@ namespace Lidarr.Api.V1.Calendar
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("Lidarr.ics")]
|
[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 start = DateTime.Today.AddDays(-pastDays);
|
||||||
var end = DateTime.Today.AddDays(futureDays);
|
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 albums = _albumService.AlbumsBetweenDates(start, end, unmonitored);
|
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
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace NzbDrone.Core.Parser.Model
|
||||||
{
|
{
|
||||||
public string AlbumTitle { get; set; }
|
public string AlbumTitle { get; set; }
|
||||||
public string ArtistName { get; set; }
|
public string ArtistName { get; set; }
|
||||||
|
public string AlbumType { get; set; }
|
||||||
public ArtistTitleInfo ArtistTitleInfo { get; set; }
|
public ArtistTitleInfo ArtistTitleInfo { get; set; }
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
public string ReleaseDate { get; set; }
|
public string ReleaseDate { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue