1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-03-05 13:21:25 -05:00

Compare commits

...

90 Commits

Author SHA1 Message Date
Keivan Beigi
a34e69b35b Notification API Cleanup 2016-12-27 23:52:20 -08:00
Keivan
03b83ed226 Rename Metadata Dir to fix build in *nix 2016-12-24 12:13:16 -08:00
Keivan
eafe79450e Rename Metadata Dir Step 1 2016-12-24 12:13:15 -08:00
Keivan
f286dba40a Rename QBittorent Dir to fix building in *nix 2016-12-24 12:13:14 -08:00
Keivan
448f579723 Rename QBittorent Dir Step 1 2016-12-24 12:13:13 -08:00
Keivan Beigi
1562081235 Upgraded MediaInfo from 0.7.74 to 0.7.91 2016-12-23 13:51:01 -08:00
Keivan Beigi
0214c8e0f0 Removed unused using statements 2016-12-23 13:45:24 -08:00
Keivan Beigi
f16dd069b5 Upgraded DDay.iCal to Ical.Net 2016-12-21 20:38:37 -08:00
Keivan Beigi
aba613acd1 Because it's 2016! 2016-12-21 20:38:37 -08:00
Keivan Beigi
2e36538dcd Environment variables sometimes lie! 2016-12-21 20:38:35 -08:00
Keivan Beigi
c42e4d682c more kosher regex group names. 2016-12-21 20:38:35 -08:00
Keivan Beigi
327536b684 Added NoOp Performance Counter Manager 2016-12-21 20:38:35 -08:00
Mark McDowall
7dbacf105d Fixed: Parsing of some anime releases that use Episode after the title 2016-12-21 18:08:02 -08:00
margaale
8d776abb48 Fixed: Handle download clients sending invalid content-type header.
DownloadStation incorrectly surrounds charset with double-quotes. whereas the http standard specifies they must be without quotes.

fixes #1586
2016-12-20 20:54:44 +01:00
Mark McDowall
7f8093de92 Fixed: Use Category from qBittorrent when set instead of Label 2016-12-13 23:32:46 -08:00
Mark McDowall
c1de7f26d1 Added test for 4 digit season number and series title with year 2016-12-13 23:32:46 -08:00
Mark McDowall
4a82d30d3d Fixed: Parsing of mini episodes that contain the year in the title 2016-12-13 23:32:46 -08:00
Keivan Beigi
da52e60f36 Upgraded Nlog/RestSharp/Selenium 2016-12-12 11:17:15 -08:00
Keivan Beigi
cf58e52f40 Upgraded Nancy!!!! 2016-12-12 11:17:15 -08:00
Keivan Beigi
2a7ae96906 upgraded nbuilder/automoq 2016-12-12 11:17:15 -08:00
Keivan Beigi
053f6fcaeb Upgrade fluentmigrator 2016-12-12 11:17:15 -08:00
Keivan Beigi
0c75d0bb03 Upgraded nunit/fluentassertion 2016-12-12 11:17:15 -08:00
Thijs Tijsma
0c9b5dc97e Added Visual Studio folder (.vs) to the ignore file. 2016-12-11 15:33:48 -08:00
Mark McDowall
c99e92e6af New: Validate PMS version before performing a library update 2016-12-08 10:23:53 -08:00
Mark McDowall
3f64c01d5b Fixed: Partial library updates for Plex Media Server 1.3 2016-12-07 12:58:23 -08:00
Mark McDowall
f022dae1fa Fixed: Partial library updates for Plex Media Server 1.3 2016-12-06 17:05:00 -08:00
Mark McDowall
52ad8cf37f Fixed: Error handling of valid, empty responses from Plex Media Server 2016-12-06 09:11:50 -08:00
Mark McDowall
3d20fd8f96 Fixed: Error handling of valid, empty responses from Plex Media Server 2016-12-05 09:34:17 -08:00
Lloyd Sparkes
cf662291d5 Fixed: Lingering Socks5 Proxy sockets when proxy is using dynamic ips 2016-12-04 16:43:18 +01:00
Mark McDowall
43d85bf59d Fixed: Parsing of some Plex server responses before 1.3 2016-12-02 10:39:12 -08:00
ARTbird309
4a149c356b New: Telegram notifications
Closes #1355
2016-11-30 19:08:29 -08:00
Chris Allen
740fc9154f Shorten 'MPEG-2 Video' to 'MPEG2'. 2016-11-30 17:54:22 -08:00
Mark McDowall
0a657302f7 New: Support for Plex Media Server 1.3.0's new JSON responses 2016-11-23 16:38:57 -08:00
Mark McDowall
7b09b259a8 Fixed: Don't delete extra files after unlinking an episode file that still exists on disk 2016-11-23 16:38:40 -08:00
Taloth Saldono
b093be3f4e Added additional gdiplus check. 2016-11-05 22:26:30 +01:00
Mark McDowall
3c8b263694 Update CONTRIBUTING.md 2016-11-02 16:56:54 -07:00
Mark McDowall
43c5d03f9a Fix GetAncestorFolders tests under mono 2016-11-02 15:08:39 -07:00
Taloth Saldono
9fbe06ad68 New: Added support to override Copy vs Move import logic for DownloadedEpisodesScan API and Manual Import UI. 2016-11-02 20:28:45 +01:00
Mark McDowall
db899a9bb8 New: Move subtitles/other extra files to Sonarr's Recycle Bin instead of permanently deleting 2016-11-02 11:12:24 -07:00
Mark McDowall
d3890bd712 New: Health check warning for macOS when running from App Translocation folder 2016-11-02 11:12:24 -07:00
Mark McDowall
1a61796092 Fixed: mono 4.4.2 won't trigger mono version error 2016-11-02 11:12:24 -07:00
Taloth Saldono
1251e294cd Saving settings failed if value was null. 2016-11-02 00:02:14 +01:00
Taloth Saldono
0411b82e65 Fixed: Mount handling logic of net namespaces as seen on QNAP.
fixes #1483
2016-11-01 22:53:53 +01:00
Taloth Saldono
9519f3137c Compile error when fixing FileBrowser not displaying drive letters on Windows. 2016-11-01 20:30:58 +01:00
Taloth Saldono
f8d97cac7d Fixed: FileBrowser not displaying drive letters on Windows.
fixes #1535
2016-11-01 20:22:12 +01:00
Mark McDowall
f2ecbe776b Added and fixed qBittorent tests 2016-10-28 13:28:21 -07:00
Mark McDowall
1ac442d0e6 Removed unused disk provider 2016-10-28 13:14:18 -07:00
Mark McDowall
5f2aeb0cea Fixed: Failing database migration of metadata files without extensions 2016-10-28 13:04:22 -07:00
Mark McDowall
2ece05cd1e Fixed: Email connection test reporting success incorrectly
Fixes #1524
2016-10-28 11:02:36 -07:00
Casey Bodley
25a3f83ebc New: Remove completed torrents from qBittorrent
Fixes #1316
2016-10-27 20:07:42 -07:00
Mark McDowall
cdce65a922 Added TODO to remove ToPP SABnzbd status 2016-10-27 18:02:38 -07:00
Mark McDowall
8f73a51522 Fixed: Handling of some really long qBittorrent ETAs 2016-10-27 17:57:18 -07:00
Mark McDowall
bc438a6a63 Fixed: Handle SABnzbd Propagating status 2016-10-26 21:09:53 -07:00
Mark McDowall
4167ffe11a Capture exit code of nunit to avoid using failed tests as exit code 2016-10-25 14:00:27 -07:00
Mark McDowall
6fb1aa85d0 Fixed: Parsing of some poorly named standard episode release names
Closes #1522
2016-10-25 10:16:05 -07:00
Mark McDowall
eb8ef6c337 Fixed: login page being returned instead of unauthorized response 2016-10-24 20:41:19 -07:00
Mark McDowall
c076f1ddb1 Update omgwtfnzbs URL
Closes #1520
2016-10-24 18:49:58 -07:00
karaambaa
eeff79b288 Added Sonarr-icon to Boxcar notification
Now there is a small Sonarr icon next to the Boxcar message.
2016-10-20 09:36:00 -07:00
Mark McDowall
697a62da0a Fixed typo 2016-10-18 13:53:25 -07:00
Mark McDowall
f1a289cc74 Re-added accidentally removed anime parsing Regex 2016-10-18 13:52:15 -07:00
Mark McDowall
c39a26d9e0 Fixed: Parsing of multiple absolute episode number releases 2016-10-17 17:51:55 -07:00
Taloth Saldono
f2ccf94835 Fixed: Updated IPTorrents url validation to changed format.
fixes: #1493
2016-10-10 23:32:03 +02:00
Taloth Saldono
19d625c6c5 Fixed: Changed Quality Parser to avoid matching tags in the Episode title instead of the Quality tags. 2016-10-10 23:32:01 +02:00
Taloth Saldono
cd3b6000a0 Tweaked Nyaa Request Generator to avoid offset=1. 2016-10-10 23:31:58 +02:00
Mark McDowall
ff33f15bac Fixed: Import episodes in season packs in numerical order
Closes #1485
2016-10-04 10:20:48 -07:00
Mark McDowall
50a0e9514e Fixed: Default redirect URL for forms auth will use URL Base if configured 2016-10-01 15:40:04 -07:00
Taloth Saldono
7ef1ca8a00 Fixed: Tweaked ratelimit logic for rarbg api. 2016-09-29 21:42:08 +02:00
Mark McDowall
e0d1e08f94 Upgraded mono version check (3.10 minimum and 4.4.x)
New: Health warning if mono version is less than 3.10
New: Health error if running mono 4.4.x
2016-09-26 18:47:33 -07:00
Taloth Saldono
9fae76015a Fixed: Calendar api again includes series images. (Nzb360)
fixes #1473
2016-09-24 23:08:31 +02:00
Taloth Saldono
17bf438cad New: uTorrent differential api support to handle larger lists of torrents without hogging the api.
Fixes #1109
2016-09-24 23:07:08 +02:00
Chris Heath
c0b0567c23 Join: Device ID entry and better error handling
New: Optionally limit Join notifications to specific devices
Fixes #1455
2016-09-23 16:13:46 -07:00
Taloth Saldono
edc1e0b8d1 Fixed: Filter qbittorrent torrent list on newer versions.
fixes #1470
ref #1347
2016-09-23 21:42:52 +02:00
kaso17
cd79b42f5f add downloadvolumefactor and uploadvolumefactor torznab attributes (#1464)
Using the attributes it's possible to signal states like freeleech/neutral leech/double upload
2016-09-23 21:08:50 +02:00
Taloth Saldono
dc82e66dde Clarified min/max size rejection message by including the episode runtime. 2016-09-23 20:51:37 +02:00
Taloth Saldono
b034d0c1b3 Fixed: Cleanup unused Tags during housekeeping. 2016-09-23 20:51:36 +02:00
Taloth Saldono
36a3e86882 New: Added filter by tag to iCal feed.
closes  #1430
2016-09-23 20:51:34 +02:00
Mark McDowall
e76fb8c90b Fixed: Issue loading settings on some systems 2016-09-20 22:08:04 -07:00
Mark McDowall
e6288148ad Fixed: Suppress warning log messages when unable to parse non-video files 2016-09-20 22:08:04 -07:00
Mark McDowall
bf8d68a873 Fixed: Version check for SABnzbd develop 2016-09-20 22:08:04 -07:00
Taloth Saldono
080e2e9eff New: Added query parameter to ical feed to list premiers only.
fixes #1463
fixes #1442
2016-09-21 00:28:36 +02:00
Taloth Saldono
e3310e590c Fixed: prevents autofill on new password fields in settings. 2016-09-20 22:06:33 +02:00
Taloth Saldono
a0b4d3a38d Removed conflicting criteria from IsProduction check. 2016-09-20 21:30:46 +02:00
Taloth Saldono
a72b856fb8 Fixed: Added config validation to ensure NzbGet KeepHistory isn't set to 0. 2016-09-20 21:30:17 +02:00
Mark McDowall
522ef9d8d5 Don't append the extension when using ParsePath 2016-09-19 21:33:18 -07:00
Mark McDowall
a486bff40b Fixed: Migrations using old SQLite versions (Prior to 3.7.15)
Closes #1466
2016-09-19 16:10:40 -07:00
Mark McDowall
0de1f3f17a Fixed: Ignore extrafanart subfolder when scanning for extra files 2016-09-18 22:24:32 -07:00
Mark McDowall
755fdce227 Fixed: Generating metadata files after importing episode files 2016-09-18 22:19:08 -07:00
Mark McDowall
cd8659e684 Fixed: Store metadata file extensions 2016-09-18 11:30:22 -07:00
Mark McDowall
a621f0d49b Fixed: Prevent duplicate parsing of extra files 2016-09-18 11:04:56 -07:00
Mark McDowall
2e96c4e798 New: Parse existing subtitles and extra files
Towards #459
2016-09-17 01:27:15 -07:00
772 changed files with 5158 additions and 4597 deletions

4
.gitignore vendored
View File

@@ -10,6 +10,7 @@ src/**/[Oo]bj/
*.suo
*.user
*.sln.docstates
.vs/
# Build results
*_i.c
@@ -41,6 +42,9 @@ src/**/[Oo]bj/
_ReSharper*
_dotCover*
# DevExpress CodeRush
src/.cr/
# NCrunch
*.ncrunch*
.*crunch*.local.xml

6
.idea/encodings.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

View File

@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<file url="file://$PROJECT_DIR$" libraries="{Sonarr node_modules}" />
<includedPredefinedLibrary name="ECMAScript 6" />
</component>
</project>

View File

@@ -8,8 +8,8 @@ Setup guides, FAQ, the more information we have on the wiki the better.
## Development ##
### Tools required ###
- Visual Studio 2013
- HTML/Javascript editor of choice (Sublime Text/Webstorm/etc)
- Visual Studio 2015
- HTML/Javascript editor of choice (Sublime Text/Webstorm/Atom/etc)
- npm (node package manager)
- git

View File

@@ -75,6 +75,8 @@
<xs:enumeration value="seedtype" /> <!-- TBD, which criteria must be met. was going for 'ratio,seedtime,both' but afaik it's always 'either' -->
<xs:enumeration value="minimumratio" />
<xs:enumeration value="minimumseedtime" />
<xs:enumeration value="downloadvolumefactor" /> <!-- factor for the download volume, in most cases it should be set to 1, if a torrent is set to freeleech set it to 0, if only 50% is counted set it to 0.5 -->
<xs:enumeration value="uploadvolumefactor" /> <!-- factor for the upload volume, in most cases it should be set to 1, if a torrent is set to neutral leech (upload is not counted) set it to 0, if it's set to double upload set it to 2 -->
</xs:restriction>
</xs:simpleType>
<xs:element name="attr">

View File

@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@@ -52,7 +52,7 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

View File

@@ -1,5 +1,4 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="4.3.4" targetFramework="net40" />
<package id="NLog" version="4.3.11" targetFramework="net40" />
</packages>

View File

@@ -198,7 +198,8 @@ namespace Marr.Data.Mapping
{
return AutoMapPropertiesWhere(m =>
m.MemberType == MemberTypes.Property &&
!DataHelper.IsSimpleType((m as PropertyInfo).PropertyType));
!DataHelper.IsSimpleType((m as PropertyInfo).PropertyType) &&
!MapRepository.Instance.TypeConverters.ContainsKey((m as PropertyInfo).PropertyType));
}
/// <summary>

View File

@@ -1,9 +1,6 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading;
namespace Microsoft.AspNet.SignalR.Infrastructure

View File

@@ -4,7 +4,7 @@ using System.Diagnostics;
namespace Microsoft.AspNet.SignalR.Infrastructure
{
internal class NoOpPerformanceCounter : IPerformanceCounter
public class NoOpPerformanceCounter : IPerformanceCounter
{
public string CounterName
{

View File

@@ -6,7 +6,6 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Configuration;
using Microsoft.AspNet.SignalR.Hosting;

View File

@@ -1,13 +1,9 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Infrastructure;

View File

@@ -3,7 +3,6 @@
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Hosting;
using Microsoft.AspNet.SignalR.Infrastructure;

View File

@@ -7,11 +7,9 @@ using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Owin.Infrastructure;
using Microsoft.AspNet.SignalR.Hosting;
namespace Microsoft.AspNet.SignalR.Owin
{
using WebSocketFunc = Func<IDictionary<string, object>, Task>;
public partial class ServerRequest :
#if NET45
IWebSocketRequest

View File

@@ -38,16 +38,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
<Reference Include="FizzWare.NBuilder, Version=4.0.0.115, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
@@ -57,9 +61,6 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="FizzWare.NBuilder">
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
<package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="3.0.1.1" targetFramework="net40" />
<package id="NUnit" version="3.2.0" targetFramework="net40" />
<package id="NBuilder" version="4.0.0" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" />
</packages>

View File

@@ -43,7 +43,7 @@ namespace NzbDrone.Api.Authentication
expiry = DateTime.UtcNow.AddDays(7);
}
return this.LoginAndRedirect(user.Identifier, expiry);
return this.LoginAndRedirect(user.Identifier, expiry, _configFileProvider.UrlBase + "/");
}
private Response Logout()

View File

@@ -27,7 +27,7 @@ namespace NzbDrone.Api.Authentication
_configFileProvider = configFileProvider;
}
public int Order { get { return 10; } }
public int Order => 10;
public void Register(IPipelines pipelines)
{
@@ -77,7 +77,7 @@ namespace NzbDrone.Api.Authentication
if (context.Request.IsApiRequest())
{
if ((context.Response.StatusCode == HttpStatusCode.SeeOther &&
context.Response.Headers["Location"].StartsWith("/login", StringComparison.InvariantCultureIgnoreCase)) ||
context.Response.Headers["Location"].StartsWith($"{_configFileProvider.UrlBase}/login", StringComparison.InvariantCultureIgnoreCase)) ||
context.Response.StatusCode == HttpStatusCode.Unauthorized)
{
context.Response = new { Error = "Unauthorized" }.AsResponse(HttpStatusCode.Unauthorized);

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Datastore;
namespace NzbDrone.Api.Blacklist

View File

@@ -2,31 +2,42 @@
using System;
using System.Collections.Generic;
using System.Linq;
using DDay.iCal;
using Ical.Net;
using Ical.Net.DataTypes;
using Ical.Net.Interfaces.Serialization;
using Ical.Net.Serialization;
using Ical.Net.Serialization.iCalendar.Factory;
using NzbDrone.Core.Tv;
using Nancy.Responses;
using NzbDrone.Core.Tags;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Api.Calendar
{
public class CalendarFeedModule : NzbDroneFeedModule
{
private readonly IEpisodeService _episodeService;
private readonly ITagService _tagService;
public CalendarFeedModule(IEpisodeService episodeService)
public CalendarFeedModule(IEpisodeService episodeService, ITagService tagService)
: base("calendar")
{
_episodeService = episodeService;
_tagService = tagService;
Get["/NzbDrone.ics"] = options => GetCalendarFeed();
Get["/Sonarr.ics"] = options => GetCalendarFeed();
}
private Response GetCalendarFeed()
{
var pastDays = 7;
var futureDays = 28;
var futureDays = 28;
var start = DateTime.Today.AddDays(-pastDays);
var end = DateTime.Today.AddDays(futureDays);
var unmonitored = false;
var premiersOnly = false;
var tags = new List<int>();
// TODO: Remove start/end parameters in v3, they don't work well for iCal
var queryStart = Request.Query.Start;
@@ -34,6 +45,8 @@ namespace NzbDrone.Api.Calendar
var queryPastDays = Request.Query.PastDays;
var queryFutureDays = Request.Query.FutureDays;
var queryUnmonitored = Request.Query.Unmonitored;
var queryPremiersOnly = Request.Query.PremiersOnly;
var queryTags = Request.Query.Tags;
if (queryStart.HasValue) start = DateTime.Parse(queryStart.Value);
if (queryEnd.HasValue) end = DateTime.Parse(queryEnd.Value);
@@ -55,33 +68,58 @@ namespace NzbDrone.Api.Calendar
unmonitored = bool.Parse(queryUnmonitored.Value);
}
if (queryPremiersOnly.HasValue)
{
premiersOnly = bool.Parse(queryPremiersOnly.Value);
}
if (queryTags.HasValue)
{
var tagInput = (string)queryTags.Value.ToString();
tags.AddRange(tagInput.Split(',').Select(_tagService.GetTag).Select(t => t.Id));
}
var episodes = _episodeService.EpisodesBetweenDates(start, end, unmonitored);
var icalCalendar = new iCalendar();
var calendar = new Ical.Net.Calendar
{
ProductId = "-//sonarr.tv//Sonarr//EN"
};
foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value))
{
var occurrence = icalCalendar.Create<Event>();
occurrence.UID = "NzbDrone_episode_" + episode.Id.ToString();
if (premiersOnly && (episode.SeasonNumber == 0 || episode.EpisodeNumber != 1))
{
continue;
}
if (tags.Any() && tags.None(episode.Series.Tags.Contains))
{
continue;
}
var occurrence = calendar.Create<Event>();
occurrence.Uid = "NzbDrone_episode_" + episode.Id;
occurrence.Status = episode.HasFile ? EventStatus.Confirmed : EventStatus.Tentative;
occurrence.Start = new iCalDateTime(episode.AirDateUtc.Value) { HasTime = true };
occurrence.End = new iCalDateTime(episode.AirDateUtc.Value.AddMinutes(episode.Series.Runtime)) { HasTime = true };
occurrence.Start = new CalDateTime(episode.AirDateUtc.Value) { HasTime = true };
occurrence.End = new CalDateTime(episode.AirDateUtc.Value.AddMinutes(episode.Series.Runtime)) { HasTime = true };
occurrence.Description = episode.Overview;
occurrence.Categories = new List<string>() { episode.Series.Network };
switch (episode.Series.SeriesType)
{
case SeriesTypes.Daily:
occurrence.Summary = string.Format("{0} - {1}", episode.Series.Title, episode.Title);
occurrence.Summary = $"{episode.Series.Title} - {episode.Title}";
break;
default:
occurrence.Summary = string.Format("{0} - {1}x{2:00} - {3}", episode.Series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title);
occurrence.Summary =$"{episode.Series.Title} - {episode.SeasonNumber}x{episode.EpisodeNumber:00} - {episode.Title}";
break;
}
}
var serializer = new DDay.iCal.Serialization.iCalendar.SerializerFactory().Build(icalCalendar.GetType(), new DDay.iCal.Serialization.SerializationContext()) as DDay.iCal.Serialization.IStringSerializer;
var icalendar = serializer.SerializeToString(icalCalendar);
var serializer = (IStringSerializer) new SerializerFactory().Build(calendar.GetType(), new SerializationContext());
var icalendar = serializer.SerializeToString(calendar);
return new TextResponse(icalendar, "text/calendar");
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
namespace NzbDrone.Api.ClientSchema
{

View File

@@ -1,5 +1,4 @@
using System;
using FluentValidation;
using FluentValidation;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Validation.Paths;

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Authentication;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Update;

View File

@@ -1,5 +1,4 @@
using System;
using FluentValidation;
using FluentValidation;
using NzbDrone.Api.Validation;
using NzbDrone.Core.Configuration;

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config

View File

@@ -1,5 +1,4 @@
using System;
using FluentValidation;
using FluentValidation;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Validation.Paths;

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles;
@@ -21,6 +20,7 @@ namespace NzbDrone.Api.Config
public bool SkipFreeSpaceCheckWhenImporting { get; set; }
public bool CopyUsingHardlinks { get; set; }
public string ExtraFileExtensions { get; set; }
public bool EnableMediaInfo { get; set; }
}
@@ -44,7 +44,8 @@ namespace NzbDrone.Api.Config
SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting,
CopyUsingHardlinks = model.CopyUsingHardlinks,
EnableMediaInfo = model.EnableMediaInfo,
ExtraFileExtensions = model.ExtraFileExtensions,
EnableMediaInfo = model.EnableMediaInfo
};
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using FluentValidation;
using FluentValidation.Results;

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Organizer;
namespace NzbDrone.Api.Config

View File

@@ -1,7 +1,4 @@
using System;
using System.Linq;
using System.Reflection;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config
{

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Core.DiskSpace;
namespace NzbDrone.Api.DiskSpace

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Api.REST;
using NzbDrone.Api.REST;
namespace NzbDrone.Api.DiskSpace
{

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Download;
using NzbDrone.Core.Download;
namespace NzbDrone.Api.DownloadClient
{

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.DownloadClient
{

View File

@@ -1,6 +1,5 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Api.REST;
using NzbDrone.Core.Datastore.Events;

View File

@@ -3,6 +3,7 @@ using NzbDrone.Api.REST;
using NzbDrone.Core.Tv;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.SignalR;
using Nancy;
namespace NzbDrone.Api.Episodes
{

View File

@@ -1,10 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Collections.Generic;
using NzbDrone.Common.Extensions;
using NzbDrone.Api.EpisodeFiles;
using NzbDrone.Api.Extensions;
using NzbDrone.Api.Series;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.DecisionEngine;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;

View File

@@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
_cacheableSpecification = cacheableSpecification;
}
public int Order { get { return 0; } }
public int Order => 0;
public void Register(IPipelines pipelines)
{

View File

@@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
{
public class CorsPipeline : IRegisterNancyPipeline
{
public int Order { get { return 0; } }
public int Order => 0;
public void Register(IPipelines pipelines)
{

View File

@@ -13,7 +13,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
{
private readonly Logger _logger;
public int Order { get { return 0; } }
public int Order => 0;
public GzipCompressionPipeline(Logger logger)
{

View File

@@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
_cacheableSpecification = cacheableSpecification;
}
public int Order { get { return 0; } }
public int Order => 0;
public void Register(IPipelines pipelines)
{

View File

@@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
{
public class NzbDroneVersionPipeline : IRegisterNancyPipeline
{
public int Order { get { return 0; } }
public int Order => 0;
public void Register(IPipelines pipelines)
{

View File

@@ -1,5 +1,4 @@
using System;
using System.Linq;
using System.Threading;
using Nancy;
using Nancy.Bootstrapper;
@@ -23,7 +22,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
_errorPipeline = errorPipeline;
}
public int Order { get { return 100; } }
public int Order => 100;
public void Register(IPipelines pipelines)
{

View File

@@ -1,4 +1,3 @@
using System;
using System.IO;
using NLog;
using NzbDrone.Common.Disk;

View File

@@ -1,6 +1,5 @@
using System.IO;
using System.Text.RegularExpressions;
using Nancy;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;

View File

@@ -1,5 +1,4 @@
using System;
using System.IO;
using System.IO;
using NLog;
using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Common.Http;

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Indexers
{

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Indexers
{

View File

@@ -1,8 +1,5 @@
using System.Collections.Generic;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model;
using System.Linq;
namespace NzbDrone.Api.Indexers
{

View File

@@ -8,7 +8,6 @@ using System.Linq;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Api.Extensions;
using NLog;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Indexers
{

View File

@@ -31,13 +31,6 @@ namespace NzbDrone.Api.Logs
return Path.Combine(_appFolderInfo.GetLogFolder(), filename);
}
protected override string DownloadUrlRoot
{
get
{
return "logfile";
}
}
protected override string DownloadUrlRoot => "logfile";
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NzbDrone.Common.Disk;

View File

@@ -1,5 +1,4 @@
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Instrumentation;
using NzbDrone.Core.Instrumentation;
namespace NzbDrone.Api.Logs
{

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
@@ -38,12 +37,6 @@ namespace NzbDrone.Api.Logs
return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename);
}
protected override string DownloadUrlRoot
{
get
{
return "updatelogfile";
}
}
protected override string DownloadUrlRoot => "updatelogfile";
}
}

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Metadata;
using NzbDrone.Core.Extras.Metadata;
namespace NzbDrone.Api.Metadata
{

View File

@@ -1,6 +1,4 @@
using System;
namespace NzbDrone.Api.Metadata
namespace NzbDrone.Api.Metadata
{
public class MetadataResource : ProviderResource
{

View File

@@ -1,10 +1,7 @@
using System;
using System.Linq;
using Nancy;
using System.Linq;
using Nancy.Bootstrapper;
using Nancy.Diagnostics;
using NLog;
using NzbDrone.Api.ErrorManagement;
using NzbDrone.Api.Extensions.Pipelines;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation;
@@ -55,17 +52,8 @@ namespace NzbDrone.Api
return _tinyIoCContainer;
}
protected override DiagnosticsConfiguration DiagnosticsConfiguration
{
get { return new DiagnosticsConfiguration { Password = @"password" }; }
}
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
protected override byte[] FavIcon
{
get
{
return null;
}
}
protected override byte[] FavIcon => null;
}
}

View File

@@ -1,5 +1,4 @@
using System;
using NzbDrone.Core.Notifications;
using NzbDrone.Core.Notifications;
namespace NzbDrone.Api.Notifications
{

View File

@@ -40,36 +40,50 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\antlr.runtime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentValidation, Version=6.2.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\FluentValidation.6.2.1.0\lib\portable-net40+sl50+wp80+win8+wpa81\FluentValidation.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nancy, Version=0.23.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Nancy.0.23.2\lib\net40\Nancy.dll</HintPath>
<Reference Include="Ical.Net, Version=2.1.0.30332, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\Ical.Net.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nancy.Authentication.Basic, Version=0.23.2.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Nancy.Authentication.Basic.0.23.2\lib\net40\Nancy.Authentication.Basic.dll</HintPath>
<Reference Include="Ical.Net.Collections, Version=2.1.0.30331, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\Ical.Net.Collections.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nancy.Authentication.Forms">
<HintPath>..\packages\Nancy.Authentication.Forms.0.23.2\lib\net40\Nancy.Authentication.Forms.dll</HintPath>
<Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nancy.Authentication.Basic, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nancy.Authentication.Basic.1.4.1\lib\net40\Nancy.Authentication.Basic.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Nancy.Authentication.Forms, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nancy.Authentication.Forms.1.4.1\lib\net40\Nancy.Authentication.Forms.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NodaTime, Version=1.3.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\NodaTime.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="DDay.iCal">
<HintPath>..\packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite, Version=1.0.84.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Libraries\Sqlite\System.Data.SQLite.dll</HintPath>

View File

@@ -1,6 +1,4 @@
using System;
using System.Linq;
using System.Collections.Generic;
using NzbDrone.Api.REST;
using NzbDrone.Api.Validation;
using NzbDrone.Core.Datastore;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Api.Episodes;
using NzbDrone.Api.REST;
using NzbDrone.Api.Series;

View File

@@ -1,5 +1,4 @@
using System;
using Newtonsoft.Json;
using Newtonsoft.Json;
using NzbDrone.Api.REST;
namespace NzbDrone.Api.Profiles.Languages
@@ -9,6 +8,6 @@ namespace NzbDrone.Api.Profiles.Languages
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
public new int Id { get; set; }
public string Name { get; set; }
public string NameLower { get { return Name.ToLowerInvariant(); } }
public string NameLower => Name.ToLowerInvariant();
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Text;
using System.Text;
using Nancy;
namespace NzbDrone.Api.Profiles

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using FluentValidation;
using NzbDrone.Core.Profiles;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Validation;
namespace NzbDrone.Api.Profiles

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.Parser;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using FluentValidation;
using FluentValidation.Results;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.Qualities;

View File

@@ -8,12 +8,6 @@ namespace NzbDrone.Api.REST
public int Id { get; set; }
[JsonIgnore]
public virtual string ResourceName
{
get
{
return GetType().Name.ToLower().Replace("resource", "");
}
}
public virtual string ResourceName => GetType().Name.ToLowerInvariant().Replace("resource", "");
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.RemotePathMappings;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using FluentValidation.Results;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Restrictions;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.Restrictions;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.RootFolders;

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using Nancy;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.Tv;

View File

@@ -1,6 +1,4 @@
using System;
namespace NzbDrone.Api.Series
namespace NzbDrone.Api.Series
{
public class AlternateTitleResource
{

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tags;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.Tags;

View File

@@ -1,34 +1,37 @@
using System;
using TinyIoC;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using Nancy;
using Nancy.Bootstrapper;
using Nancy.Diagnostics;
using TinyIoC;
using Nancy.Bootstrapper;
namespace NzbDrone.Api
{
/// <summary>
/// TinyIoC bootstrapper - registers default route resolver and registers itself as
/// INancyModuleCatalog for resolving modules but behaviour can be overridden if required.
/// </summary>
public class TinyIoCNancyBootstrapper : NancyBootstrapperWithRequestContainerBase<TinyIoCContainer>
{
// <summary>
/// <summary>
/// Default assemblies that are ignored for autoregister
/// </summary>
private static readonly IEnumerable<Func<Assembly, bool>> DefaultAutoRegisterIgnoredAssemblies = new Func<Assembly, bool>[]
public static IEnumerable<Func<Assembly, bool>> DefaultAutoRegisterIgnoredAssemblies = new Func<Assembly, bool>[]
{
asm => !asm.FullName.StartsWith("Nancy.", StringComparison.InvariantCulture),
};
/// <summary>
/// Gets the assemblies to ignore when autoregistering the application container
/// Return true from the delegate to ignore that particular assembly, returning true
/// does not mean the assembly *will* be included, a false from another delegate will
/// Return true from the delegate to ignore that particular assembly, returning false
/// does not mean the assembly *will* be included, a true from another delegate will
/// take precedence.
/// </summary>
protected virtual IEnumerable<Func<Assembly, bool>> AutoRegisterIgnoredAssemblies
{
get { return DefaultAutoRegisterIgnoredAssemblies; }
}
protected virtual IEnumerable<Func<Assembly, bool>> AutoRegisterIgnoredAssemblies => DefaultAutoRegisterIgnoredAssemblies;
/// <summary>
/// Configures the container using AutoRegister followed by registration
@@ -49,11 +52,6 @@ namespace NzbDrone.Api
return this.ApplicationContainer.Resolve<INancyEngine>();
}
/* protected override IModuleKeyGenerator GetModuleKeyGenerator()
{
return ApplicationContainer.Resolve<IModuleKeyGenerator>();
}*/
/// <summary>
/// Create a default, unconfigured, container
/// </summary>
@@ -93,6 +91,7 @@ namespace NzbDrone.Api
break;
case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default:
throw new ArgumentOutOfRangeException();
}
@@ -104,10 +103,10 @@ namespace NzbDrone.Api
/// by IEnumerable{Type} constructor dependencies.
/// </summary>
/// <param name="container">Container to register into</param>
/// <param name="collectionTypeRegistrationsn">Collection type registrations to register</param>
protected override sealed void RegisterCollectionTypes(TinyIoCContainer container, IEnumerable<CollectionTypeRegistration> collectionTypeRegistrationsn)
/// <param name="collectionTypeRegistrations">Collection type registrations to register</param>
protected override sealed void RegisterCollectionTypes(TinyIoCContainer container, IEnumerable<CollectionTypeRegistration> collectionTypeRegistrations)
{
foreach (var collectionTypeRegistration in collectionTypeRegistrationsn)
foreach (var collectionTypeRegistration in collectionTypeRegistrations)
{
switch (collectionTypeRegistration.Lifetime)
{
@@ -119,6 +118,7 @@ namespace NzbDrone.Api
break;
case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default:
throw new ArgumentOutOfRangeException();
}
@@ -160,8 +160,9 @@ namespace NzbDrone.Api
/// <summary>
/// Creates a per request child/nested container
/// </summary>
/// <param name="context">Current context</param>
/// <returns>Request container instance</returns>
protected override sealed TinyIoCContainer CreateRequestContainer()
protected override TinyIoCContainer CreateRequestContainer(NancyContext context)
{
return this.ApplicationContainer.GetChildContainer();
}
@@ -216,7 +217,7 @@ namespace NzbDrone.Api
}
/// <summary>
/// Retreive a specific module instance from the container
/// Retrieve a specific module instance from the container
/// </summary>
/// <param name="container">Container to use</param>
/// <param name="moduleType">Type of the module</param>
@@ -239,4 +240,4 @@ namespace NzbDrone.Api
container.AutoRegister(AppDomain.CurrentDomain.GetAssemblies().Where(a => !ignoredAssemblies.Any(ia => ia(a))), DuplicateImplementationActions.RegisterMultiple, t => t.Assembly != assembly);
}
}
}
}

View File

@@ -1,5 +1,4 @@
using System;
using System.Text;
using System.Text;
using Nancy;
namespace NzbDrone.Api.Wanted

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DDay.iCal" version="1.0.2.575" targetFramework="net40" />
<package id="FluentValidation" version="6.2.1.0" targetFramework="net40" />
<package id="Nancy" version="0.23.2" targetFramework="net40" />
<package id="Nancy.Authentication.Basic" version="0.23.2" targetFramework="net40" />
<package id="Nancy.Authentication.Forms" version="0.23.2" targetFramework="net40" />
<package id="Ical.Net" version="2.2.25" targetFramework="net40" />
<package id="Nancy" version="1.4.3" targetFramework="net40" />
<package id="Nancy.Authentication.Basic" version="1.4.1" targetFramework="net40" />
<package id="Nancy.Authentication.Forms" version="1.4.1" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="4.3.4" targetFramework="net40" />
<package id="NLog" version="4.3.11" targetFramework="net40" />
</packages>

View File

@@ -37,20 +37,24 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
<Reference Include="FizzWare.NBuilder, Version=4.0.0.115, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
@@ -58,9 +62,6 @@
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="FizzWare.NBuilder, Version=3.0.1.0, Culture=neutral, PublicKeyToken=5651b03e12e42c12">
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference>
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Model;

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
<package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="3.0.1.1" />
<package id="NLog" version="4.3.4" targetFramework="net40" />
<package id="NUnit" version="3.2.0" targetFramework="net40" />
<package id="NBuilder" version="4.0.0" targetFramework="net40" />
<package id="NLog" version="4.3.11" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" />
</packages>

View File

@@ -28,7 +28,7 @@ namespace NzbDrone.Automation.Test
LogManager.Configuration = new LoggingConfiguration();
var consoleTarget = new ConsoleTarget { Layout = "${level}: ${message} ${exception}" };
LogManager.Configuration.AddTarget(consoleTarget.GetType().Name, consoleTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, consoleTarget));
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Trace, consoleTarget));
}
[TestFixtureSetUp]

View File

@@ -38,20 +38,20 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Reference Include="FluentAssertions.Core, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.dll</HintPath>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
@@ -62,13 +62,13 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="WebDriver, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Selenium.WebDriver.2.48.0\lib\net40\WebDriver.dll</HintPath>
<Reference Include="WebDriver, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.0.1\lib\net40\WebDriver.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="WebDriver.Support, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Selenium.Support.2.48.0\lib\net40\WebDriver.Support.dll</HintPath>
<Reference Include="WebDriver.Support, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@@ -47,52 +47,16 @@ namespace NzbDrone.Automation.Test.PageModel
});
}
public IWebElement SeriesNavIcon
{
get
{
return FindByClass("x-series-nav");
}
}
public IWebElement SeriesNavIcon => FindByClass("x-series-nav");
public IWebElement CalendarNavIcon
{
get
{
return FindByClass("x-calendar-nav");
}
}
public IWebElement CalendarNavIcon => FindByClass("x-calendar-nav");
public IWebElement ActivityNavIcon
{
get
{
return FindByClass("x-activity-nav");
}
}
public IWebElement ActivityNavIcon => FindByClass("x-activity-nav");
public IWebElement WantedNavIcon
{
get
{
return FindByClass("x-wanted-nav");
}
}
public IWebElement WantedNavIcon => FindByClass("x-wanted-nav");
public IWebElement SettingNavIcon
{
get
{
return FindByClass("x-settings-nav");
}
}
public IWebElement SettingNavIcon => FindByClass("x-settings-nav");
public IWebElement SystemNavIcon
{
get
{
return FindByClass("x-system-nav");
}
}
public IWebElement SystemNavIcon => FindByClass("x-system-nav");
}
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="NLog" version="4.3.4" targetFramework="net40" />
<package id="NUnit" version="3.2.0" targetFramework="net40" />
<package id="Selenium.Support" version="2.48.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.48.0" targetFramework="net40" />
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
<package id="NLog" version="4.3.11" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" />
<package id="Selenium.Support" version="3.0.1" targetFramework="net40" />
<package id="Selenium.WebDriver" version="3.0.1" targetFramework="net40" />
</packages>

View File

@@ -1,5 +1,4 @@
using System.Collections.Generic;
using System.IO;
using FluentAssertions;
using Moq;
using NUnit.Framework;

View File

@@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using FluentAssertions;

View File

@@ -1,6 +1,5 @@
using System;
using System.IO;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Disk;

View File

@@ -1,8 +1,6 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Disk;

View File

@@ -0,0 +1,63 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Common.Test.ExtensionTests.IEnumerableExtensionTests
{
[TestFixture]
public class ExceptByFixture
{
public class Object1
{
public string Prop1 { get; set; }
}
public class Object2
{
public string Prop1 { get; set; }
}
[Test]
public void should_return_empty_when_object_with_property_exists_in_both_lists()
{
var first = new List<Object1>
{
new Object1 { Prop1 = "one" },
new Object1 { Prop1 = "two" }
};
var second = new List<Object1>
{
new Object1 { Prop1 = "two" },
new Object1 { Prop1 = "one" }
};
first.ExceptBy(o => o.Prop1, second, o => o.Prop1, StringComparer.InvariantCultureIgnoreCase).Should().BeEmpty();
}
[Test]
public void should_return_objects_that_do_not_have_a_match_in_the_second_list()
{
var first = new List<Object1>
{
new Object1 { Prop1 = "one" },
new Object1 { Prop1 = "two" }
};
var second = new List<Object1>
{
new Object1 { Prop1 = "one" },
new Object1 { Prop1 = "four" }
};
var result = first.ExceptBy(o => o.Prop1, second, o => o.Prop1, StringComparer.InvariantCultureIgnoreCase).ToList();
result.Should().HaveCount(1);
result.First().GetType().Should().Be(typeof (Object1));
result.First().Prop1.Should().Be("two");
}
}
}

View File

@@ -0,0 +1,62 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Common.Test.ExtensionTests.IEnumerableExtensionTests
{
[TestFixture]
public class IntersectByFixture
{
public class Object1
{
public string Prop1 { get; set; }
}
public class Object2
{
public string Prop1 { get; set; }
}
[Test]
public void should_return_empty_when_no_intersections()
{
var first = new List<Object1>
{
new Object1 { Prop1 = "one" },
new Object1 { Prop1 = "two" }
};
var second = new List<Object1>
{
new Object1 { Prop1 = "three" },
new Object1 { Prop1 = "four" }
};
first.IntersectBy(o => o.Prop1, second, o => o.Prop1, StringComparer.InvariantCultureIgnoreCase).Should().BeEmpty();
}
[Test]
public void should_return_objects_with_intersecting_values()
{
var first = new List<Object1>
{
new Object1 { Prop1 = "one" },
new Object1 { Prop1 = "two" }
};
var second = new List<Object1>
{
new Object1 { Prop1 = "one" },
new Object1 { Prop1 = "four" }
};
var result = first.IntersectBy(o => o.Prop1, second, o => o.Prop1, StringComparer.InvariantCultureIgnoreCase).ToList();
result.Should().HaveCount(1);
result.First().Prop1.Should().Be("one");
}
}
}

Some files were not shown because too many files have changed in this diff Show More