mirror of
https://github.com/Radarr/Radarr
synced 2024-12-27 10:19:41 +00:00
Added: a default name for Radarr.ics (#2163)
This commit is contained in:
parent
a951ad811d
commit
1d8eec42ef
1 changed files with 11 additions and 5 deletions
|
@ -1,9 +1,10 @@
|
||||||
using Nancy;
|
using Nancy;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
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;
|
||||||
|
@ -81,10 +82,13 @@ private Response GetCalendarFeed()
|
||||||
}
|
}
|
||||||
|
|
||||||
var movies = _movieService.GetMoviesBetweenDates(start, end, unmonitored);
|
var movies = _movieService.GetMoviesBetweenDates(start, end, unmonitored);
|
||||||
var calendar = new Ical.Net.Calendar
|
var calendar = new Ical.Net.Calendar();
|
||||||
{
|
|
||||||
ProductId = "-//radarr.video//Radarr//EN"
|
calendar.ProductId = "-//radarr.video//Radarr//EN";
|
||||||
};
|
|
||||||
|
var calendarName = "Radarr Movies Calendar";
|
||||||
|
calendar.AddProperty(new CalendarProperty("NAME", calendarName));
|
||||||
|
calendar.AddProperty(new CalendarProperty("X-WR-CALNAME", calendarName));
|
||||||
|
|
||||||
foreach (var movie in movies.OrderBy(v => v.Added))
|
foreach (var movie in movies.OrderBy(v => v.Added))
|
||||||
{
|
{
|
||||||
|
@ -114,8 +118,10 @@ private Response GetCalendarFeed()
|
||||||
occurrence.End = new CalDateTime(movie.InCinemas.Value.AddMinutes(movie.Runtime)) { HasTime = true };
|
occurrence.End = new CalDateTime(movie.InCinemas.Value.AddMinutes(movie.Runtime)) { HasTime = true };
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MovieStatusType.Announced:
|
case MovieStatusType.Announced:
|
||||||
continue; // no date
|
continue; // no date
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if (movie.PhysicalRelease != null)
|
if (movie.PhysicalRelease != null)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue