|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|
|
|
using System.Linq;
|
|
|
|
using System.Linq;
|
|
|
|
using Ical.Net;
|
|
|
|
using Ical.Net;
|
|
|
|
using Ical.Net.DataTypes;
|
|
|
|
using Ical.Net.DataTypes;
|
|
|
|
|
|
|
|
using Ical.Net.General;
|
|
|
|
using Ical.Net.Interfaces.Serialization;
|
|
|
|
using Ical.Net.Interfaces.Serialization;
|
|
|
|
using Ical.Net.Serialization;
|
|
|
|
using Ical.Net.Serialization;
|
|
|
|
using Ical.Net.Serialization.iCalendar.Factory;
|
|
|
|
using Ical.Net.Serialization.iCalendar.Factory;
|
|
|
@ -92,6 +93,10 @@ namespace NzbDrone.Api.Calendar
|
|
|
|
ProductId = "-//sonarr.tv//Sonarr//EN"
|
|
|
|
ProductId = "-//sonarr.tv//Sonarr//EN"
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var calendarName = "Sonarr TV Schedule";
|
|
|
|
|
|
|
|
calendar.AddProperty(new CalendarProperty("NAME", calendarName));
|
|
|
|
|
|
|
|
calendar.AddProperty(new CalendarProperty("X-WR-CALNAME", calendarName));
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value))
|
|
|
|
foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (premiersOnly && (episode.SeasonNumber == 0 || episode.EpisodeNumber != 1))
|
|
|
|
if (premiersOnly && (episode.SeasonNumber == 0 || episode.EpisodeNumber != 1))
|
|
|
|