1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-18 21:35:51 -04:00

Compare commits

..

1 Commits

Author SHA1 Message Date
Mark McDowall aaf2efb45d Fixed: Failing database migration of metadata files without extensions 2016-10-28 13:11:21 -07:00
928 changed files with 3650 additions and 11142 deletions
Vendored
BIN
View File
Binary file not shown.
-5
View File
@@ -10,7 +10,6 @@ src/**/[Oo]bj/
*.suo *.suo
*.user *.user
*.sln.docstates *.sln.docstates
.vs/
# Build results # Build results
*_i.c *_i.c
@@ -127,13 +126,9 @@ bin
obj obj
output/* output/*
#Packages
Radarr_*/
Radarr_*.zip
#OS X metadata files #OS X metadata files
._* ._*
.DS_Store
_start _start
_temp_*/**/* _temp_*/**/*
-12
View File
@@ -1,12 +0,0 @@
language: csharp
solution: src/NzbDrone.sln
script: # the following commands are just examples, use whatever your build process requires
- ./build.sh
- chmod +x test.sh
# - ./test.sh Linux Unit Takes far too long, maybe even crashes travis :/
install:
- sudo apt-get install nodejs
- sudo apt-get install npm
after_success:
- chmod +x package.sh
- ./package.sh
+2 -2
View File
@@ -8,8 +8,8 @@ Setup guides, FAQ, the more information we have on the wiki the better.
## Development ## ## Development ##
### Tools required ### ### Tools required ###
- Visual Studio 2015 - Visual Studio 2013
- HTML/Javascript editor of choice (Sublime Text/Webstorm/Atom/etc) - HTML/Javascript editor of choice (Sublime Text/Webstorm/etc)
- npm (node package manager) - npm (node package manager)
- git - git
+1 -4
View File
@@ -19,16 +19,13 @@ gulp.task('less', function() {
paths.src.root + 'Series/series.less', paths.src.root + 'Series/series.less',
paths.src.root + 'Activity/activity.less', paths.src.root + 'Activity/activity.less',
paths.src.root + 'AddSeries/addSeries.less', paths.src.root + 'AddSeries/addSeries.less',
paths.src.root + 'AddMovies/addMovies.less',
paths.src.root + 'Calendar/calendar.less', paths.src.root + 'Calendar/calendar.less',
paths.src.root + 'Cells/cells.less', paths.src.root + 'Cells/cells.less',
paths.src.root + 'ManualImport/manualimport.less', paths.src.root + 'ManualImport/manualimport.less',
paths.src.root + 'Settings/settings.less', paths.src.root + 'Settings/settings.less',
paths.src.root + 'System/Logs/logs.less', paths.src.root + 'System/Logs/logs.less',
paths.src.root + 'System/Update/update.less', paths.src.root + 'System/Update/update.less',
paths.src.root + 'System/Info/info.less', paths.src.root + 'System/Info/info.less'
paths.src.root + 'Movies/movies.less',
]; ];
return gulp.src(src) return gulp.src(src)
-50
View File
@@ -1,50 +0,0 @@
if [ $# -eq 0 ]; then
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
echo "Need to supply version argument" && exit;
fi
fi
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
VERSION="`date +%H:%M:%S`"
YEAR="`date +%Y`"
MONTH="`date +%m`"
DAY="`date +%d`"
else
VERSION=$1
fi
outputFolder='./_output'
outputFolderMono='./_output_mono'
outputFolderOsx='./_output_osx'
outputFolderOsxApp='./_output_osx_app'
tr -d "\r" < $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr > $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr2
rm $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr
chmod +x $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr2
mv $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr2 $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr >& error.log
cp -r $outputFolder/ Radarr_Windows_$VERSION
cp -r $outputFolderMono/ Radarr_Mono_$VERSION
cp -r $outputFolderOsxApp/ Radarr_OSX_$VERSION
zip -r Radarr_Windows_$VERSION.zip Radarr_Windows_$VERSION >& /dev/null
zip -r Radarr_Mono_$VERSION.zip Radarr_Mono_$VERSION >& /dev/null
zip -r Radarr_OSX_$VERSION.zip Radarr_OSX_$VERSION >& /dev/null
ftp -n ftp.leonardogalli.ch << END_SCRIPT
passive
quote USER $FTP_USER
quote PASS $FTP_PASS
mkdir builds
cd builds
mkdir $YEAR
cd $YEAR
mkdir $MONTH
cd $MONTH
mkdir $DAY
cd $DAY
binary
put Radarr_Windows_$VERSION.zip
put Radarr_Mono_$VERSION.zip
put Radarr_OSX_$VERSION.zip
quit
END_SCRIPT
+2 -17
View File
@@ -1,20 +1,7 @@
# Radarr [![Build Status](https://travis-ci.org/galli-leo/Radarr.svg?branch=develop)](https://travis-ci.org/galli-leo/Radarr)# # Sonarr #
This fork of Sonarr aims to turn it into something like Couchpotato.
## Currently working: Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.
* Adding new movies (Note: Movies are currently added as one series with one season and one episode. This will change in the future)
* Manually searching for releases of movies.
* Automatically searching for releases.
* Rarbg.to indexer (Other indexers are coming, I just need to find the right categories)
* Everything that has nothing to do with series from Sonarr should be working as well.
## Planned Features:
* Scanning PreDB to know when a new release is available.
* Fixing the other Indexers.
* Fixing how movies are stored and displayed.
* Importing of Sonarr config.
* New TorrentPotato Indexer.
## Major Features Include: ## ## Major Features Include: ##
@@ -30,8 +17,6 @@ This fork of Sonarr aims to turn it into something like Couchpotato.
* Full support for specials and multi-episode releases * Full support for specials and multi-episode releases
* And a beautiful UI * And a beautiful UI
## Download
The latest precompiled binary versions can be found here: https://github.com/galli-leo/Radarr/releases.
## Configuring Development Environment: ## ## Configuring Development Environment: ##
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
+1 -1
View File
@@ -52,7 +52,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@@ -1,4 +1,5 @@
using System.Reflection; using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
+1 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="NLog" version="4.3.11" targetFramework="net40" /> <package id="NLog" version="4.3.4" targetFramework="net40" />
</packages> </packages>
@@ -1,6 +1,9 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System; using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq.Expressions;
using System.Reflection;
using System.Threading; using System.Threading;
namespace Microsoft.AspNet.SignalR.Infrastructure namespace Microsoft.AspNet.SignalR.Infrastructure
@@ -4,7 +4,7 @@ using System.Diagnostics;
namespace Microsoft.AspNet.SignalR.Infrastructure namespace Microsoft.AspNet.SignalR.Infrastructure
{ {
public class NoOpPerformanceCounter : IPerformanceCounter internal class NoOpPerformanceCounter : IPerformanceCounter
{ {
public string CounterName public string CounterName
{ {
@@ -6,6 +6,7 @@ using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization; using System.Globalization;
using System.Linq; using System.Linq;
using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Configuration; using Microsoft.AspNet.SignalR.Configuration;
using Microsoft.AspNet.SignalR.Hosting; using Microsoft.AspNet.SignalR.Hosting;
@@ -1,9 +1,13 @@
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
using System; using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq; using System.Linq;
using System.Reflection;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Infrastructure; using Microsoft.AspNet.SignalR.Infrastructure;
@@ -3,6 +3,7 @@
using System; using System;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Hosting; using Microsoft.AspNet.SignalR.Hosting;
using Microsoft.AspNet.SignalR.Infrastructure; using Microsoft.AspNet.SignalR.Infrastructure;
@@ -7,9 +7,11 @@ using System.Security.Principal;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNet.SignalR.Owin.Infrastructure; using Microsoft.AspNet.SignalR.Owin.Infrastructure;
using Microsoft.AspNet.SignalR.Hosting;
namespace Microsoft.AspNet.SignalR.Owin namespace Microsoft.AspNet.SignalR.Owin
{ {
using WebSocketFunc = Func<IDictionary<string, object>, Task>;
public partial class ServerRequest : public partial class ServerRequest :
#if NET45 #if NET45
IWebSocketRequest IWebSocketRequest
+9 -10
View File
@@ -38,20 +38,16 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="FizzWare.NBuilder, Version=4.0.0.115, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL"> <Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="FluentAssertions.Core, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.Core.dll</HintPath> <HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.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> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@@ -61,6 +57,9 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="FizzWare.NBuilder">
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
</Reference>
<Reference Include="Moq"> <Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference> </Reference>
+3 -3
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" /> <package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="4.0.0" targetFramework="net40" /> <package id="NBuilder" version="3.0.1.1" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" /> <package id="NUnit" version="3.2.0" targetFramework="net40" />
</packages> </packages>
@@ -27,7 +27,7 @@ namespace NzbDrone.Api.Authentication
_configFileProvider = configFileProvider; _configFileProvider = configFileProvider;
} }
public int Order => 10; public int Order { get { return 10; } }
public void Register(IPipelines pipelines) public void Register(IPipelines pipelines)
{ {
@@ -1,4 +1,5 @@
using NzbDrone.Core.Blacklisting; using System;
using NzbDrone.Core.Blacklisting;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
namespace NzbDrone.Api.Blacklist namespace NzbDrone.Api.Blacklist
+11 -20
View File
@@ -2,11 +2,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using Ical.Net; using DDay.iCal;
using Ical.Net.DataTypes;
using Ical.Net.Interfaces.Serialization;
using Ical.Net.Serialization;
using Ical.Net.Serialization.iCalendar.Factory;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using Nancy.Responses; using Nancy.Responses;
using NzbDrone.Core.Tags; using NzbDrone.Core.Tags;
@@ -26,7 +22,6 @@ namespace NzbDrone.Api.Calendar
_tagService = tagService; _tagService = tagService;
Get["/NzbDrone.ics"] = options => GetCalendarFeed(); Get["/NzbDrone.ics"] = options => GetCalendarFeed();
Get["/Sonarr.ics"] = options => GetCalendarFeed();
} }
private Response GetCalendarFeed() private Response GetCalendarFeed()
@@ -80,12 +75,7 @@ namespace NzbDrone.Api.Calendar
} }
var episodes = _episodeService.EpisodesBetweenDates(start, end, unmonitored); var episodes = _episodeService.EpisodesBetweenDates(start, end, unmonitored);
var calendar = new Ical.Net.Calendar var icalCalendar = new iCalendar();
{
ProductId = "-//sonarr.tv//Sonarr//EN"
};
foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value)) foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value))
{ {
@@ -99,27 +89,28 @@ namespace NzbDrone.Api.Calendar
continue; continue;
} }
var occurrence = calendar.Create<Event>(); var occurrence = icalCalendar.Create<Event>();
occurrence.Uid = "NzbDrone_episode_" + episode.Id; occurrence.UID = "NzbDrone_episode_" + episode.Id.ToString();
occurrence.Status = episode.HasFile ? EventStatus.Confirmed : EventStatus.Tentative; occurrence.Status = episode.HasFile ? EventStatus.Confirmed : EventStatus.Tentative;
occurrence.Start = new CalDateTime(episode.AirDateUtc.Value) { HasTime = true }; occurrence.Start = new iCalDateTime(episode.AirDateUtc.Value) { HasTime = true };
occurrence.End = new CalDateTime(episode.AirDateUtc.Value.AddMinutes(episode.Series.Runtime)) { HasTime = true }; occurrence.End = new iCalDateTime(episode.AirDateUtc.Value.AddMinutes(episode.Series.Runtime)) { HasTime = true };
occurrence.Description = episode.Overview; occurrence.Description = episode.Overview;
occurrence.Categories = new List<string>() { episode.Series.Network }; occurrence.Categories = new List<string>() { episode.Series.Network };
switch (episode.Series.SeriesType) switch (episode.Series.SeriesType)
{ {
case SeriesTypes.Daily: case SeriesTypes.Daily:
occurrence.Summary = $"{episode.Series.Title} - {episode.Title}"; occurrence.Summary = string.Format("{0} - {1}", episode.Series.Title, episode.Title);
break; break;
default: default:
occurrence.Summary =$"{episode.Series.Title} - {episode.SeasonNumber}x{episode.EpisodeNumber:00} - {episode.Title}"; occurrence.Summary = string.Format("{0} - {1}x{2:00} - {3}", episode.Series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title);
break; break;
} }
} }
var serializer = (IStringSerializer) new SerializerFactory().Build(calendar.GetType(), new SerializationContext()); 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(calendar); var icalendar = serializer.SerializeToString(icalCalendar);
return new TextResponse(icalendar, "text/calendar"); return new TextResponse(icalendar, "text/calendar");
} }
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
namespace NzbDrone.Api.ClientSchema namespace NzbDrone.Api.ClientSchema
{ {
@@ -1,4 +1,5 @@
using FluentValidation; using System;
using FluentValidation;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Validation.Paths; using NzbDrone.Core.Validation.Paths;
@@ -1,4 +1,5 @@
using NzbDrone.Api.REST; using System;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
@@ -1,4 +1,5 @@
using NzbDrone.Api.REST; using System;
using NzbDrone.Api.REST;
using NzbDrone.Core.Authentication; using NzbDrone.Core.Authentication;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
using NzbDrone.Core.Update; using NzbDrone.Core.Update;
@@ -1,4 +1,5 @@
using FluentValidation; using System;
using FluentValidation;
using NzbDrone.Api.Validation; using NzbDrone.Api.Validation;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
@@ -1,4 +1,5 @@
using NzbDrone.Api.REST; using System;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
@@ -44,8 +44,7 @@ namespace NzbDrone.Api.Config
SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting, SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting,
CopyUsingHardlinks = model.CopyUsingHardlinks, CopyUsingHardlinks = model.CopyUsingHardlinks,
ExtraFileExtensions = model.ExtraFileExtensions, EnableMediaInfo = model.EnableMediaInfo,
EnableMediaInfo = model.EnableMediaInfo
}; };
} }
} }
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentValidation; using FluentValidation;
using FluentValidation.Results; using FluentValidation.Results;
@@ -1,4 +1,5 @@
using NzbDrone.Api.REST; using System;
using NzbDrone.Api.REST;
using NzbDrone.Core.Organizer; using NzbDrone.Core.Organizer;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
+4 -1
View File
@@ -1,4 +1,7 @@
using NzbDrone.Core.Configuration; using System;
using System.Linq;
using System.Reflection;
using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
{ {
+2 -1
View File
@@ -1,4 +1,5 @@
using NzbDrone.Api.REST; using System;
using NzbDrone.Api.REST;
using NzbDrone.Core.Configuration; using NzbDrone.Core.Configuration;
namespace NzbDrone.Api.Config namespace NzbDrone.Api.Config
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using NzbDrone.Core.DiskSpace; using NzbDrone.Core.DiskSpace;
namespace NzbDrone.Api.DiskSpace namespace NzbDrone.Api.DiskSpace
@@ -1,4 +1,5 @@
using NzbDrone.Api.REST; using System;
using NzbDrone.Api.REST;
namespace NzbDrone.Api.DiskSpace namespace NzbDrone.Api.DiskSpace
{ {
@@ -1,4 +1,5 @@
using NzbDrone.Core.Download; using System;
using NzbDrone.Core.Download;
namespace NzbDrone.Api.DownloadClient namespace NzbDrone.Api.DownloadClient
{ {
@@ -1,4 +1,5 @@
using NzbDrone.Core.Indexers; using System;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.DownloadClient namespace NzbDrone.Api.DownloadClient
{ {
@@ -1,5 +1,6 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq;
using NLog; using NLog;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
@@ -3,7 +3,6 @@ using NzbDrone.Api.REST;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.SignalR; using NzbDrone.SignalR;
using Nancy;
namespace NzbDrone.Api.Episodes namespace NzbDrone.Api.Episodes
{ {
@@ -1,6 +1,10 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Api.EpisodeFiles; using NzbDrone.Api.EpisodeFiles;
using NzbDrone.Api.Extensions;
using NzbDrone.Api.Series; using NzbDrone.Api.Series;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
@@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
_cacheableSpecification = cacheableSpecification; _cacheableSpecification = cacheableSpecification;
} }
public int Order => 0; public int Order { get { return 0; } }
public void Register(IPipelines pipelines) public void Register(IPipelines pipelines)
{ {
@@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
{ {
public class CorsPipeline : IRegisterNancyPipeline public class CorsPipeline : IRegisterNancyPipeline
{ {
public int Order => 0; public int Order { get { return 0; } }
public void Register(IPipelines pipelines) public void Register(IPipelines pipelines)
{ {
@@ -13,7 +13,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
{ {
private readonly Logger _logger; private readonly Logger _logger;
public int Order => 0; public int Order { get { return 0; } }
public GzipCompressionPipeline(Logger logger) public GzipCompressionPipeline(Logger logger)
{ {
@@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
_cacheableSpecification = cacheableSpecification; _cacheableSpecification = cacheableSpecification;
} }
public int Order => 0; public int Order { get { return 0; } }
public void Register(IPipelines pipelines) public void Register(IPipelines pipelines)
{ {
@@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
{ {
public class NzbDroneVersionPipeline : IRegisterNancyPipeline public class NzbDroneVersionPipeline : IRegisterNancyPipeline
{ {
public int Order => 0; public int Order { get { return 0; } }
public void Register(IPipelines pipelines) public void Register(IPipelines pipelines)
{ {
@@ -1,4 +1,5 @@
using System; using System;
using System.Linq;
using System.Threading; using System.Threading;
using Nancy; using Nancy;
using Nancy.Bootstrapper; using Nancy.Bootstrapper;
@@ -22,7 +23,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
_errorPipeline = errorPipeline; _errorPipeline = errorPipeline;
} }
public int Order => 100; public int Order { get { return 100; } }
public void Register(IPipelines pipelines) public void Register(IPipelines pipelines)
{ {
@@ -1,3 +1,4 @@
using System;
using System.IO; using System.IO;
using NLog; using NLog;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
@@ -1,5 +1,6 @@
using System.IO; using System.IO;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using Nancy;
using NLog; using NLog;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
@@ -1,4 +1,5 @@
using System.IO; using System;
using System.IO;
using NLog; using NLog;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Common.Http; using NzbDrone.Common.Http;
-15
View File
@@ -3,7 +3,6 @@ using Nancy;
using NzbDrone.Api.Episodes; using NzbDrone.Api.Episodes;
using NzbDrone.Api.Extensions; using NzbDrone.Api.Extensions;
using NzbDrone.Api.Series; using NzbDrone.Api.Series;
using NzbDrone.Api.Movie;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Download; using NzbDrone.Core.Download;
@@ -35,18 +34,12 @@ namespace NzbDrone.Api.History
resource.Series = model.Series.ToResource(); resource.Series = model.Series.ToResource();
resource.Episode = model.Episode.ToResource(); resource.Episode = model.Episode.ToResource();
resource.Movie = model.Movie.ToResource();
if (model.Series != null) if (model.Series != null)
{ {
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Series.Profile.Value, model.Quality); resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Series.Profile.Value, model.Quality);
} }
if (model.Movie != null)
{
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Movie.Profile.Value, model.Quality);
}
return resource; return resource;
} }
@@ -54,8 +47,6 @@ namespace NzbDrone.Api.History
{ {
var episodeId = Request.Query.EpisodeId; var episodeId = Request.Query.EpisodeId;
var movieId = Request.Query.MovieId;
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending); var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending);
if (pagingResource.FilterKey == "eventType") if (pagingResource.FilterKey == "eventType")
@@ -70,12 +61,6 @@ namespace NzbDrone.Api.History
pagingSpec.FilterExpression = h => h.EpisodeId == i; pagingSpec.FilterExpression = h => h.EpisodeId == i;
} }
if (movieId.HasValue)
{
int i = (int)movieId;
pagingSpec.FilterExpression = h => h.MovieId == i;
}
return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource); return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource);
} }
+1 -4
View File
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using NzbDrone.Api.Episodes; using NzbDrone.Api.Episodes;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Api.Series; using NzbDrone.Api.Series;
using NzbDrone.Api.Movie;
using NzbDrone.Core.History; using NzbDrone.Core.History;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
@@ -13,7 +12,6 @@ namespace NzbDrone.Api.History
public class HistoryResource : RestResource public class HistoryResource : RestResource
{ {
public int EpisodeId { get; set; } public int EpisodeId { get; set; }
public int MovieId { get; set; }
public int SeriesId { get; set; } public int SeriesId { get; set; }
public string SourceTitle { get; set; } public string SourceTitle { get; set; }
public QualityModel Quality { get; set; } public QualityModel Quality { get; set; }
@@ -24,7 +22,7 @@ namespace NzbDrone.Api.History
public HistoryEventType EventType { get; set; } public HistoryEventType EventType { get; set; }
public Dictionary<string, string> Data { get; set; } public Dictionary<string, string> Data { get; set; }
public MovieResource Movie { get; set; }
public EpisodeResource Episode { get; set; } public EpisodeResource Episode { get; set; }
public SeriesResource Series { get; set; } public SeriesResource Series { get; set; }
} }
@@ -41,7 +39,6 @@ namespace NzbDrone.Api.History
EpisodeId = model.EpisodeId, EpisodeId = model.EpisodeId,
SeriesId = model.SeriesId, SeriesId = model.SeriesId,
MovieId = model.MovieId,
SourceTitle = model.SourceTitle, SourceTitle = model.SourceTitle,
Quality = model.Quality, Quality = model.Quality,
//QualityCutoffNotMet //QualityCutoffNotMet
+2 -1
View File
@@ -1,4 +1,5 @@
using NzbDrone.Core.Indexers; using System;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Indexers namespace NzbDrone.Api.Indexers
{ {
+2 -1
View File
@@ -1,4 +1,5 @@
using NzbDrone.Core.Indexers; using System;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Indexers namespace NzbDrone.Api.Indexers
{ {
+2 -57
View File
@@ -26,7 +26,6 @@ namespace NzbDrone.Api.Indexers
private readonly Logger _logger; private readonly Logger _logger;
private readonly ICached<RemoteEpisode> _remoteEpisodeCache; private readonly ICached<RemoteEpisode> _remoteEpisodeCache;
private readonly ICached<RemoteMovie> _remoteMovieCache;
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser, public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
ISearchForNzb nzbSearchService, ISearchForNzb nzbSearchService,
@@ -50,7 +49,6 @@ namespace NzbDrone.Api.Indexers
PostValidator.RuleFor(s => s.Guid).NotEmpty(); PostValidator.RuleFor(s => s.Guid).NotEmpty();
_remoteEpisodeCache = cacheManager.GetCache<RemoteEpisode>(GetType(), "remoteEpisodes"); _remoteEpisodeCache = cacheManager.GetCache<RemoteEpisode>(GetType(), "remoteEpisodes");
_remoteMovieCache = cacheManager.GetCache<RemoteMovie>(GetType(), "remoteMovies");
} }
private Response DownloadRelease(ReleaseResource release) private Response DownloadRelease(ReleaseResource release)
@@ -61,26 +59,7 @@ namespace NzbDrone.Api.Indexers
{ {
_logger.Debug("Couldn't find requested release in cache, cache timeout probably expired."); _logger.Debug("Couldn't find requested release in cache, cache timeout probably expired.");
var remoteMovie = _remoteMovieCache.Find(release.Guid); return new NotFoundResponse();
if (remoteMovie == null)
{
return new NotFoundResponse();
}
try
{
_downloadService.DownloadReport(remoteMovie);
}
catch (ReleaseDownloadException ex)
{
_logger.Error(ex, ex.Message);
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
}
return release.AsResponse();
} }
try try
@@ -103,11 +82,6 @@ namespace NzbDrone.Api.Indexers
return GetEpisodeReleases(Request.Query.episodeId); return GetEpisodeReleases(Request.Query.episodeId);
} }
if (Request.Query.movieId != null)
{
return GetMovieReleases(Request.Query.movieId);
}
return GetRss(); return GetRss();
} }
@@ -128,27 +102,6 @@ namespace NzbDrone.Api.Indexers
return new List<ReleaseResource>(); return new List<ReleaseResource>();
} }
private List<ReleaseResource> GetMovieReleases(int movieId)
{
try
{
var decisions = _nzbSearchService.MovieSearch(movieId, true);
var prioritizedDecisions = _prioritizeDownloadDecision.PrioritizeDecisionsForMovies(decisions);
return MapDecisions(prioritizedDecisions);
}
catch (NotImplementedException ex)
{
_logger.Error(ex, "One or more indexer you selected does not support movie search yet: " + ex.Message);
}
catch (Exception ex)
{
_logger.Error(ex, "Movie search failed: " + ex.Message);
}
return new List<ReleaseResource>();
}
private List<ReleaseResource> GetRss() private List<ReleaseResource> GetRss()
{ {
var reports = _rssFetcherAndParser.Fetch(); var reports = _rssFetcherAndParser.Fetch();
@@ -160,15 +113,7 @@ namespace NzbDrone.Api.Indexers
protected override ReleaseResource MapDecision(DownloadDecision decision, int initialWeight) protected override ReleaseResource MapDecision(DownloadDecision decision, int initialWeight)
{ {
if (decision.IsForMovie) _remoteEpisodeCache.Set(decision.RemoteEpisode.Release.Guid, decision.RemoteEpisode, TimeSpan.FromMinutes(30));
{
_remoteMovieCache.Set(decision.RemoteMovie.Release.Guid, decision.RemoteMovie, TimeSpan.FromMinutes(30));
}
else
{
_remoteEpisodeCache.Set(decision.RemoteEpisode.Release.Guid, decision.RemoteEpisode, TimeSpan.FromMinutes(30));
}
return base.MapDecision(decision, initialWeight); return base.MapDecision(decision, initialWeight);
} }
} }
@@ -1,5 +1,8 @@
using System.Collections.Generic; using System.Collections.Generic;
using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Parser.Model;
using System.Linq;
namespace NzbDrone.Api.Indexers namespace NzbDrone.Api.Indexers
{ {
@@ -8,6 +8,7 @@ using System.Linq;
using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Parser.Model;
using NzbDrone.Api.Extensions; using NzbDrone.Api.Extensions;
using NLog; using NLog;
using NzbDrone.Core.Indexers;
namespace NzbDrone.Api.Indexers namespace NzbDrone.Api.Indexers
{ {
+1 -6
View File
@@ -86,11 +86,6 @@ namespace NzbDrone.Api.Indexers
var parsedEpisodeInfo = model.RemoteEpisode.ParsedEpisodeInfo; var parsedEpisodeInfo = model.RemoteEpisode.ParsedEpisodeInfo;
var remoteEpisode = model.RemoteEpisode; var remoteEpisode = model.RemoteEpisode;
var torrentInfo = (model.RemoteEpisode.Release as TorrentInfo) ?? new TorrentInfo(); var torrentInfo = (model.RemoteEpisode.Release as TorrentInfo) ?? new TorrentInfo();
var downloadAllowed = model.RemoteEpisode.DownloadAllowed;
if (model.IsForMovie)
{
downloadAllowed = model.RemoteMovie.DownloadAllowed;
}
// TODO: Clean this mess up. don't mix data from multiple classes, use sub-resources instead? (Got a huge Deja Vu, didn't we talk about this already once?) // TODO: Clean this mess up. don't mix data from multiple classes, use sub-resources instead? (Got a huge Deja Vu, didn't we talk about this already once?)
return new ReleaseResource return new ReleaseResource
@@ -124,7 +119,7 @@ namespace NzbDrone.Api.Indexers
CommentUrl = releaseInfo.CommentUrl, CommentUrl = releaseInfo.CommentUrl,
DownloadUrl = releaseInfo.DownloadUrl, DownloadUrl = releaseInfo.DownloadUrl,
InfoUrl = releaseInfo.InfoUrl, InfoUrl = releaseInfo.InfoUrl,
DownloadAllowed = downloadAllowed, DownloadAllowed = remoteEpisode.DownloadAllowed,
//ReleaseWeight //ReleaseWeight
MagnetUrl = torrentInfo.MagnetUrl, MagnetUrl = torrentInfo.MagnetUrl,
+8 -1
View File
@@ -31,6 +31,13 @@ namespace NzbDrone.Api.Logs
return Path.Combine(_appFolderInfo.GetLogFolder(), filename); return Path.Combine(_appFolderInfo.GetLogFolder(), filename);
} }
protected override string DownloadUrlRoot => "logfile"; protected override string DownloadUrlRoot
{
get
{
return "logfile";
}
}
} }
} }
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using NzbDrone.Common.Disk; using NzbDrone.Common.Disk;
+2 -1
View File
@@ -1,4 +1,5 @@
using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Datastore;
using NzbDrone.Core.Instrumentation;
namespace NzbDrone.Api.Logs namespace NzbDrone.Api.Logs
{ {
+9 -2
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
@@ -37,6 +38,12 @@ namespace NzbDrone.Api.Logs
return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename); return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename);
} }
protected override string DownloadUrlRoot => "updatelogfile"; protected override string DownloadUrlRoot
{
get
{
return "updatelogfile";
}
}
} }
} }
+2 -1
View File
@@ -1,4 +1,5 @@
using NzbDrone.Core.Extras.Metadata; using System;
using NzbDrone.Core.Extras.Metadata;
namespace NzbDrone.Api.Metadata namespace NzbDrone.Api.Metadata
{ {
@@ -1,4 +1,6 @@
namespace NzbDrone.Api.Metadata using System;
namespace NzbDrone.Api.Metadata
{ {
public class MetadataResource : ProviderResource public class MetadataResource : ProviderResource
{ {
+15 -3
View File
@@ -1,7 +1,10 @@
using System.Linq; using System;
using System.Linq;
using Nancy;
using Nancy.Bootstrapper; using Nancy.Bootstrapper;
using Nancy.Diagnostics; using Nancy.Diagnostics;
using NLog; using NLog;
using NzbDrone.Api.ErrorManagement;
using NzbDrone.Api.Extensions.Pipelines; using NzbDrone.Api.Extensions.Pipelines;
using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Instrumentation; using NzbDrone.Common.Instrumentation;
@@ -52,8 +55,17 @@ namespace NzbDrone.Api
return _tinyIoCContainer; return _tinyIoCContainer;
} }
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" }; protected override DiagnosticsConfiguration DiagnosticsConfiguration
{
get { return new DiagnosticsConfiguration { Password = @"password" }; }
}
protected override byte[] FavIcon => null; protected override byte[] FavIcon
{
get
{
return null;
}
}
} }
} }
@@ -1,4 +1,5 @@
using NzbDrone.Core.Notifications; using System;
using NzbDrone.Core.Notifications;
namespace NzbDrone.Api.Notifications namespace NzbDrone.Api.Notifications
{ {
+12 -29
View File
@@ -40,50 +40,36 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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"> <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> <HintPath>..\packages\FluentValidation.6.2.1.0\lib\portable-net40+sl50+wp80+win8+wpa81\FluentValidation.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="Ical.Net, Version=2.1.0.30332, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Nancy, Version=0.23.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\Ical.Net.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>True</Private> <HintPath>..\packages\Nancy.0.23.2\lib\net40\Nancy.dll</HintPath>
</Reference> </Reference>
<Reference Include="Ical.Net.Collections, Version=2.1.0.30331, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Nancy.Authentication.Basic, Version=0.23.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\Ical.Net.Collections.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>True</Private> <HintPath>..\packages\Nancy.Authentication.Basic.0.23.2\lib\net40\Nancy.Authentication.Basic.dll</HintPath>
</Reference> </Reference>
<Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="Nancy.Authentication.Forms">
<HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath> <HintPath>..\packages\Nancy.Authentication.Forms.0.23.2\lib\net40\Nancy.Authentication.Forms.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>
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> <HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.3.4\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> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="Microsoft.CSharp" /> <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"> <Reference Include="System.Data.SQLite, Version=1.0.84.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\Libraries\Sqlite\System.Data.SQLite.dll</HintPath> <HintPath>..\Libraries\Sqlite\System.Data.SQLite.dll</HintPath>
@@ -231,11 +217,8 @@
<Compile Include="Series\SeasonResource.cs" /> <Compile Include="Series\SeasonResource.cs" />
<Compile Include="SeasonPass\SeasonPassModule.cs" /> <Compile Include="SeasonPass\SeasonPassModule.cs" />
<Compile Include="Series\SeriesEditorModule.cs" /> <Compile Include="Series\SeriesEditorModule.cs" />
<Compile Include="Series\MovieLookupModule.cs" />
<Compile Include="Series\SeriesLookupModule.cs" /> <Compile Include="Series\SeriesLookupModule.cs" />
<Compile Include="Series\MovieModule.cs" />
<Compile Include="Series\SeriesModule.cs" /> <Compile Include="Series\SeriesModule.cs" />
<Compile Include="Series\MovieResource.cs" />
<Compile Include="Series\SeriesResource.cs" /> <Compile Include="Series\SeriesResource.cs" />
<Compile Include="Series\SeasonStatisticsResource.cs" /> <Compile Include="Series\SeasonStatisticsResource.cs" />
<Compile Include="System\Backup\BackupModule.cs" /> <Compile Include="System\Backup\BackupModule.cs" />
+2
View File
@@ -1,4 +1,6 @@
using System; using System;
using System.Linq;
using System.Collections.Generic;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Api.Validation; using NzbDrone.Api.Validation;
using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore;
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using NzbDrone.Api.Episodes; using NzbDrone.Api.Episodes;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Api.Series; using NzbDrone.Api.Series;
@@ -1,4 +1,5 @@
using Newtonsoft.Json; using System;
using Newtonsoft.Json;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
namespace NzbDrone.Api.Profiles.Languages namespace NzbDrone.Api.Profiles.Languages
@@ -8,6 +9,6 @@ namespace NzbDrone.Api.Profiles.Languages
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)] [JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
public new int Id { get; set; } public new int Id { get; set; }
public string Name { get; set; } public string Name { get; set; }
public string NameLower => Name.ToLowerInvariant(); public string NameLower { get { return Name.ToLowerInvariant(); } }
} }
} }
@@ -1,4 +1,5 @@
using System.Text; using System;
using System.Text;
using Nancy; using Nancy;
namespace NzbDrone.Api.Profiles namespace NzbDrone.Api.Profiles
@@ -1,6 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using FluentValidation; using FluentValidation;
using NzbDrone.Core.Profiles; using NzbDrone.Core.Profiles;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Validation; using NzbDrone.Core.Validation;
namespace NzbDrone.Api.Profiles namespace NzbDrone.Api.Profiles
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.Parser; using NzbDrone.Core.Parser;
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using FluentValidation; using FluentValidation;
using FluentValidation.Results; using FluentValidation.Results;
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
+1 -4
View File
@@ -4,7 +4,6 @@ using NzbDrone.Api.REST;
using NzbDrone.Core.Qualities; using NzbDrone.Core.Qualities;
using NzbDrone.Api.Series; using NzbDrone.Api.Series;
using NzbDrone.Api.Episodes; using NzbDrone.Api.Episodes;
using NzbDrone.Api.Movie;
using NzbDrone.Core.Download.TrackedDownloads; using NzbDrone.Core.Download.TrackedDownloads;
using NzbDrone.Core.Indexers; using NzbDrone.Core.Indexers;
using System.Linq; using System.Linq;
@@ -15,7 +14,6 @@ namespace NzbDrone.Api.Queue
{ {
public SeriesResource Series { get; set; } public SeriesResource Series { get; set; }
public EpisodeResource Episode { get; set; } public EpisodeResource Episode { get; set; }
public MovieResource Movie { get; set; }
public QualityModel Quality { get; set; } public QualityModel Quality { get; set; }
public decimal Size { get; set; } public decimal Size { get; set; }
public string Title { get; set; } public string Title { get; set; }
@@ -51,8 +49,7 @@ namespace NzbDrone.Api.Queue
TrackedDownloadStatus = model.TrackedDownloadStatus, TrackedDownloadStatus = model.TrackedDownloadStatus,
StatusMessages = model.StatusMessages, StatusMessages = model.StatusMessages,
DownloadId = model.DownloadId, DownloadId = model.DownloadId,
Protocol = model.Protocol, Protocol = model.Protocol
Movie = model.Movie.ToResource()
}; };
} }
+7 -1
View File
@@ -8,6 +8,12 @@ namespace NzbDrone.Api.REST
public int Id { get; set; } public int Id { get; set; }
[JsonIgnore] [JsonIgnore]
public virtual string ResourceName => GetType().Name.ToLowerInvariant().Replace("resource", ""); public virtual string ResourceName
{
get
{
return GetType().Name.ToLowerInvariant().Replace("resource", "");
}
}
} }
} }
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.RemotePathMappings; using NzbDrone.Core.RemotePathMappings;
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using FluentValidation.Results; using FluentValidation.Results;
using NzbDrone.Common.Extensions; using NzbDrone.Common.Extensions;
using NzbDrone.Core.Restrictions; using NzbDrone.Core.Restrictions;
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.Restrictions; using NzbDrone.Core.Restrictions;
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.RootFolders; using NzbDrone.Core.RootFolders;
@@ -1,4 +1,5 @@
using Nancy; using System.Collections.Generic;
using Nancy;
using NzbDrone.Api.Extensions; using NzbDrone.Api.Extensions;
using NzbDrone.Core.Tv; using NzbDrone.Core.Tv;
@@ -1,4 +1,6 @@
namespace NzbDrone.Api.Series using System;
namespace NzbDrone.Api.Series
{ {
public class AlternateTitleResource public class AlternateTitleResource
{ {
@@ -1,44 +0,0 @@
using System.Collections.Generic;
using Nancy;
using NzbDrone.Api.Extensions;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MetadataSource;
using System.Linq;
namespace NzbDrone.Api.Movie
{
public class MovieLookupModule : NzbDroneRestModule<MovieResource>
{
private readonly ISearchForNewMovie _searchProxy;
public MovieLookupModule(ISearchForNewMovie searchProxy)
: base("/movies/lookup")
{
_searchProxy = searchProxy;
Get["/"] = x => Search();
}
private Response Search()
{
var imdbResults = _searchProxy.SearchForNewMovie((string)Request.Query.term);
return MapToResource(imdbResults).AsResponse();
}
private static IEnumerable<MovieResource> MapToResource(IEnumerable<Core.Tv.Movie> movies)
{
foreach (var currentSeries in movies)
{
var resource = currentSeries.ToResource();
var poster = currentSeries.Images.FirstOrDefault(c => c.CoverType == MediaCoverTypes.Poster);
if (poster != null)
{
resource.RemotePoster = poster.Url;
}
yield return resource;
}
}
}
}
-225
View File
@@ -1,225 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using FluentValidation;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events;
using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.MovieStats;
using NzbDrone.Core.Tv;
using NzbDrone.Core.Tv.Events;
using NzbDrone.Core.Validation.Paths;
using NzbDrone.Core.DataAugmentation.Scene;
using NzbDrone.Core.Validation;
using NzbDrone.SignalR;
namespace NzbDrone.Api.Movie
{
public class MovieModule : NzbDroneRestModuleWithSignalR<MovieResource, Core.Tv.Movie>,
IHandle<EpisodeImportedEvent>,
IHandle<EpisodeFileDeletedEvent>,
IHandle<MovieUpdatedEvent>,
IHandle<MovieEditedEvent>,
IHandle<MovieDeletedEvent>,
IHandle<MovieRenamedEvent>,
IHandle<MediaCoversUpdatedEvent>
{
private readonly IMovieService _moviesService;
private readonly IMovieStatisticsService _moviesStatisticsService;
private readonly IMapCoversToLocal _coverMapper;
public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
IMovieService moviesService,
IMovieStatisticsService moviesStatisticsService,
ISceneMappingService sceneMappingService,
IMapCoversToLocal coverMapper,
RootFolderValidator rootFolderValidator,
MoviePathValidator moviesPathValidator,
MovieExistsValidator moviesExistsValidator,
DroneFactoryValidator droneFactoryValidator,
MovieAncestorValidator moviesAncestorValidator,
ProfileExistsValidator profileExistsValidator
)
: base(signalRBroadcaster)
{
_moviesService = moviesService;
_moviesStatisticsService = moviesStatisticsService;
_coverMapper = coverMapper;
GetResourceAll = AllMovie;
GetResourceById = GetMovie;
CreateResource = AddMovie;
UpdateResource = UpdateMovie;
DeleteResource = DeleteMovie;
Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.ProfileId));
SharedValidator.RuleFor(s => s.Path)
.Cascade(CascadeMode.StopOnFirstFailure)
.IsValidPath()
.SetValidator(rootFolderValidator)
.SetValidator(moviesPathValidator)
.SetValidator(droneFactoryValidator)
.SetValidator(moviesAncestorValidator)
.When(s => !s.Path.IsNullOrWhiteSpace());
SharedValidator.RuleFor(s => s.ProfileId).SetValidator(profileExistsValidator);
PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
PostValidator.RuleFor(s => s.RootFolderPath).IsValidPath().When(s => s.Path.IsNullOrWhiteSpace());
PostValidator.RuleFor(s => s.Title).NotEmpty();
PostValidator.RuleFor(s => s.ImdbId).NotNull().NotEmpty().SetValidator(moviesExistsValidator);
PutValidator.RuleFor(s => s.Path).IsValidPath();
}
private MovieResource GetMovie(int id)
{
var movies = _moviesService.GetMovie(id);
return MapToResource(movies);
}
private MovieResource MapToResource(Core.Tv.Movie movies)
{
if (movies == null) return null;
var resource = movies.ToResource();
MapCoversToLocal(resource);
FetchAndLinkMovieStatistics(resource);
PopulateAlternateTitles(resource);
return resource;
}
private List<MovieResource> AllMovie()
{
var moviesStats = _moviesStatisticsService.MovieStatistics();
var moviesResources = _moviesService.GetAllMovies().ToResource();
MapCoversToLocal(moviesResources.ToArray());
LinkMovieStatistics(moviesResources, moviesStats);
PopulateAlternateTitles(moviesResources);
return moviesResources;
}
private int AddMovie(MovieResource moviesResource)
{
var model = moviesResource.ToModel();
return _moviesService.AddMovie(model).Id;
}
private void UpdateMovie(MovieResource moviesResource)
{
var model = moviesResource.ToModel(_moviesService.GetMovie(moviesResource.Id));
_moviesService.UpdateMovie(model);
BroadcastResourceChange(ModelAction.Updated, moviesResource);
}
private void DeleteMovie(int id)
{
var deleteFiles = false;
var deleteFilesQuery = Request.Query.deleteFiles;
if (deleteFilesQuery.HasValue)
{
deleteFiles = Convert.ToBoolean(deleteFilesQuery.Value);
}
_moviesService.DeleteMovie(id, deleteFiles);
}
private void MapCoversToLocal(params MovieResource[] movies)
{
foreach (var moviesResource in movies)
{
_coverMapper.ConvertToLocalUrls(moviesResource.Id, moviesResource.Images);
}
}
private void FetchAndLinkMovieStatistics(MovieResource resource)
{
LinkMovieStatistics(resource, _moviesStatisticsService.MovieStatistics(resource.Id));
}
private void LinkMovieStatistics(List<MovieResource> resources, List<MovieStatistics> moviesStatistics)
{
var dictMovieStats = moviesStatistics.ToDictionary(v => v.MovieId);
foreach (var movies in resources)
{
var stats = dictMovieStats.GetValueOrDefault(movies.Id);
if (stats == null) continue;
LinkMovieStatistics(movies, stats);
}
}
private void LinkMovieStatistics(MovieResource resource, MovieStatistics moviesStatistics)
{
resource.SizeOnDisk = moviesStatistics.SizeOnDisk;
}
private void PopulateAlternateTitles(List<MovieResource> resources)
{
foreach (var resource in resources)
{
PopulateAlternateTitles(resource);
}
}
private void PopulateAlternateTitles(MovieResource resource)
{
//var mappings = null;//_sceneMappingService.FindByTvdbId(resource.TvdbId);
//if (mappings == null) return;
//resource.AlternateTitles = mappings.Select(v => new AlternateTitleResource { Title = v.Title, SeasonNumber = v.SeasonNumber, SceneSeasonNumber = v.SceneSeasonNumber }).ToList();
}
public void Handle(EpisodeImportedEvent message)
{
//BroadcastResourceChange(ModelAction.Updated, message.ImportedEpisode.MovieId);
}
public void Handle(EpisodeFileDeletedEvent message)
{
if (message.Reason == DeleteMediaFileReason.Upgrade) return;
//BroadcastResourceChange(ModelAction.Updated, message.EpisodeFile.MovieId);
}
public void Handle(MovieUpdatedEvent message)
{
BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
}
public void Handle(MovieEditedEvent message)
{
BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
}
public void Handle(MovieDeletedEvent message)
{
BroadcastResourceChange(ModelAction.Deleted, message.Movie.ToResource());
}
public void Handle(MovieRenamedEvent message)
{
BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
}
public void Handle(MediaCoversUpdatedEvent message)
{
//BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
}
}
}
-183
View File
@@ -1,183 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using NzbDrone.Api.REST;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.Tv;
using NzbDrone.Api.Series;
namespace NzbDrone.Api.Movie
{
public class MovieResource : RestResource
{
public MovieResource()
{
Monitored = true;
}
//Todo: Sorters should be done completely on the client
//Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing?
//Todo: We should get the entire Profile instead of ID and Name separately
//View Only
public string Title { get; set; }
public List<AlternateTitleResource> AlternateTitles { get; set; }
public string SortTitle { get; set; }
public long? SizeOnDisk { get; set; }
public MovieStatusType Status { get; set; }
public string Overview { get; set; }
public DateTime? InCinemas { get; set; }
public List<MediaCover> Images { get; set; }
public string RemotePoster { get; set; }
public int Year { get; set; }
//View & Edit
public string Path { get; set; }
public int ProfileId { get; set; }
//Editing Only
public bool Monitored { get; set; }
public int Runtime { get; set; }
public DateTime? LastInfoSync { get; set; }
public string CleanTitle { get; set; }
public string ImdbId { get; set; }
public string TitleSlug { get; set; }
public string RootFolderPath { get; set; }
public string Certification { get; set; }
public List<string> Genres { get; set; }
public HashSet<int> Tags { get; set; }
public DateTime Added { get; set; }
public AddMovieOptions AddOptions { get; set; }
public Ratings Ratings { get; set; }
//TODO: Add series statistics as a property of the series (instead of individual properties)
//Used to support legacy consumers
public int QualityProfileId
{
get
{
return ProfileId;
}
set
{
if (value > 0 && ProfileId == 0)
{
ProfileId = value;
}
}
}
}
public static class MovieResourceMapper
{
public static MovieResource ToResource(this Core.Tv.Movie model)
{
if (model == null) return null;
return new MovieResource
{
Id = model.Id,
Title = model.Title,
//AlternateTitles
SortTitle = model.SortTitle,
InCinemas = model.InCinemas,
//TotalEpisodeCount
//EpisodeCount
//EpisodeFileCount
//SizeOnDisk
Status = model.Status,
Overview = model.Overview,
//NextAiring
//PreviousAiring
Images = model.Images,
Year = model.Year,
Path = model.Path,
ProfileId = model.ProfileId,
Monitored = model.Monitored,
Runtime = model.Runtime,
LastInfoSync = model.LastInfoSync,
CleanTitle = model.CleanTitle,
ImdbId = model.ImdbId,
TitleSlug = model.TitleSlug,
RootFolderPath = model.RootFolderPath,
Certification = model.Certification,
Genres = model.Genres,
Tags = model.Tags,
Added = model.Added,
AddOptions = model.AddOptions,
Ratings = model.Ratings
};
}
public static Core.Tv.Movie ToModel(this MovieResource resource)
{
if (resource == null) return null;
return new Core.Tv.Movie
{
Id = resource.Id,
Title = resource.Title,
//AlternateTitles
SortTitle = resource.SortTitle,
InCinemas = resource.InCinemas,
//TotalEpisodeCount
//EpisodeCount
//EpisodeFileCount
//SizeOnDisk
Overview = resource.Overview,
//NextAiring
//PreviousAiring
Images = resource.Images,
Year = resource.Year,
Path = resource.Path,
ProfileId = resource.ProfileId,
Monitored = resource.Monitored,
Runtime = resource.Runtime,
LastInfoSync = resource.LastInfoSync,
CleanTitle = resource.CleanTitle,
ImdbId = resource.ImdbId,
TitleSlug = resource.TitleSlug,
RootFolderPath = resource.RootFolderPath,
Certification = resource.Certification,
Genres = resource.Genres,
Tags = resource.Tags,
Added = resource.Added,
AddOptions = resource.AddOptions,
Ratings = resource.Ratings
};
}
public static Core.Tv.Movie ToModel(this MovieResource resource, Core.Tv.Movie movie)
{
movie.ImdbId = resource.ImdbId;
movie.Path = resource.Path;
movie.ProfileId = resource.ProfileId;
movie.Monitored = resource.Monitored;
movie.RootFolderPath = resource.RootFolderPath;
movie.Tags = resource.Tags;
movie.AddOptions = resource.AddOptions;
return movie;
}
public static List<MovieResource> ToResource(this IEnumerable<Core.Tv.Movie> movies)
{
return movies.Select(ToResource).ToList();
}
}
}
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using NzbDrone.Core.Datastore.Events; using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Messaging.Events;
using NzbDrone.Core.Tags; using NzbDrone.Core.Tags;
+2 -1
View File
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using System.Linq; using System.Linq;
using NzbDrone.Api.REST; using NzbDrone.Api.REST;
using NzbDrone.Core.Tags; using NzbDrone.Core.Tags;
+22 -23
View File
@@ -1,37 +1,34 @@
using TinyIoC; using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using Nancy; using Nancy;
using Nancy.Diagnostics;
using Nancy.Bootstrapper; using Nancy.Bootstrapper;
using Nancy.Diagnostics;
using TinyIoC;
namespace NzbDrone.Api 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> public class TinyIoCNancyBootstrapper : NancyBootstrapperWithRequestContainerBase<TinyIoCContainer>
{ {
/// <summary> // <summary>
/// Default assemblies that are ignored for autoregister /// Default assemblies that are ignored for autoregister
/// </summary> /// </summary>
public static IEnumerable<Func<Assembly, bool>> DefaultAutoRegisterIgnoredAssemblies = new Func<Assembly, bool>[] private static readonly IEnumerable<Func<Assembly, bool>> DefaultAutoRegisterIgnoredAssemblies = new Func<Assembly, bool>[]
{ {
asm => !asm.FullName.StartsWith("Nancy.", StringComparison.InvariantCulture), asm => !asm.FullName.StartsWith("Nancy.", StringComparison.InvariantCulture),
}; };
/// <summary> /// <summary>
/// Gets the assemblies to ignore when autoregistering the application container /// Gets the assemblies to ignore when autoregistering the application container
/// Return true from the delegate to ignore that particular assembly, returning false /// Return true from the delegate to ignore that particular assembly, returning true
/// does not mean the assembly *will* be included, a true from another delegate will /// does not mean the assembly *will* be included, a false from another delegate will
/// take precedence. /// take precedence.
/// </summary> /// </summary>
protected virtual IEnumerable<Func<Assembly, bool>> AutoRegisterIgnoredAssemblies => DefaultAutoRegisterIgnoredAssemblies; protected virtual IEnumerable<Func<Assembly, bool>> AutoRegisterIgnoredAssemblies
{
get { return DefaultAutoRegisterIgnoredAssemblies; }
}
/// <summary> /// <summary>
/// Configures the container using AutoRegister followed by registration /// Configures the container using AutoRegister followed by registration
@@ -52,6 +49,11 @@ namespace NzbDrone.Api
return this.ApplicationContainer.Resolve<INancyEngine>(); return this.ApplicationContainer.Resolve<INancyEngine>();
} }
/* protected override IModuleKeyGenerator GetModuleKeyGenerator()
{
return ApplicationContainer.Resolve<IModuleKeyGenerator>();
}*/
/// <summary> /// <summary>
/// Create a default, unconfigured, container /// Create a default, unconfigured, container
/// </summary> /// </summary>
@@ -91,7 +93,6 @@ namespace NzbDrone.Api
break; break;
case Lifetime.PerRequest: case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime."); throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
@@ -103,10 +104,10 @@ namespace NzbDrone.Api
/// by IEnumerable{Type} constructor dependencies. /// by IEnumerable{Type} constructor dependencies.
/// </summary> /// </summary>
/// <param name="container">Container to register into</param> /// <param name="container">Container to register into</param>
/// <param name="collectionTypeRegistrations">Collection type registrations to register</param> /// <param name="collectionTypeRegistrationsn">Collection type registrations to register</param>
protected override sealed void RegisterCollectionTypes(TinyIoCContainer container, IEnumerable<CollectionTypeRegistration> collectionTypeRegistrations) protected override sealed void RegisterCollectionTypes(TinyIoCContainer container, IEnumerable<CollectionTypeRegistration> collectionTypeRegistrationsn)
{ {
foreach (var collectionTypeRegistration in collectionTypeRegistrations) foreach (var collectionTypeRegistration in collectionTypeRegistrationsn)
{ {
switch (collectionTypeRegistration.Lifetime) switch (collectionTypeRegistration.Lifetime)
{ {
@@ -118,7 +119,6 @@ namespace NzbDrone.Api
break; break;
case Lifetime.PerRequest: case Lifetime.PerRequest:
throw new InvalidOperationException("Unable to directly register a per request lifetime."); throw new InvalidOperationException("Unable to directly register a per request lifetime.");
break;
default: default:
throw new ArgumentOutOfRangeException(); throw new ArgumentOutOfRangeException();
} }
@@ -160,9 +160,8 @@ namespace NzbDrone.Api
/// <summary> /// <summary>
/// Creates a per request child/nested container /// Creates a per request child/nested container
/// </summary> /// </summary>
/// <param name="context">Current context</param>
/// <returns>Request container instance</returns> /// <returns>Request container instance</returns>
protected override TinyIoCContainer CreateRequestContainer(NancyContext context) protected override sealed TinyIoCContainer CreateRequestContainer()
{ {
return this.ApplicationContainer.GetChildContainer(); return this.ApplicationContainer.GetChildContainer();
} }
@@ -217,7 +216,7 @@ namespace NzbDrone.Api
} }
/// <summary> /// <summary>
/// Retrieve a specific module instance from the container /// Retreive a specific module instance from the container
/// </summary> /// </summary>
/// <param name="container">Container to use</param> /// <param name="container">Container to use</param>
/// <param name="moduleType">Type of the module</param> /// <param name="moduleType">Type of the module</param>
@@ -240,4 +239,4 @@ namespace NzbDrone.Api
container.AutoRegister(AppDomain.CurrentDomain.GetAssemblies().Where(a => !ignoredAssemblies.Any(ia => ia(a))), DuplicateImplementationActions.RegisterMultiple, t => t.Assembly != assembly); container.AutoRegister(AppDomain.CurrentDomain.GetAssemblies().Where(a => !ignoredAssemblies.Any(ia => ia(a))), DuplicateImplementationActions.RegisterMultiple, t => t.Assembly != assembly);
} }
} }
} }
@@ -1,4 +1,5 @@
using System.Text; using System;
using System.Text;
using Nancy; using Nancy;
namespace NzbDrone.Api.Wanted namespace NzbDrone.Api.Wanted
+5 -5
View File
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="DDay.iCal" version="1.0.2.575" targetFramework="net40" />
<package id="FluentValidation" version="6.2.1.0" targetFramework="net40" /> <package id="FluentValidation" version="6.2.1.0" targetFramework="net40" />
<package id="Ical.Net" version="2.2.25" targetFramework="net40" /> <package id="Nancy" version="0.23.2" targetFramework="net40" />
<package id="Nancy" version="1.4.3" targetFramework="net40" /> <package id="Nancy.Authentication.Basic" version="0.23.2" targetFramework="net40" />
<package id="Nancy.Authentication.Basic" version="1.4.1" targetFramework="net40" /> <package id="Nancy.Authentication.Forms" version="0.23.2" 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="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="4.3.11" targetFramework="net40" /> <package id="NLog" version="4.3.4" targetFramework="net40" />
</packages> </packages>
+10 -11
View File
@@ -37,24 +37,20 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="FizzWare.NBuilder, Version=4.0.0.115, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL"> <Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.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> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@@ -62,6 +58,9 @@
<Reference Include="System.ServiceProcess" /> <Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" /> <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"> <Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference> </Reference>
@@ -1,4 +1,5 @@
using System.Collections.Generic; using System;
using System.Collections.Generic;
using Moq; using Moq;
using NUnit.Framework; using NUnit.Framework;
using NzbDrone.Common.Model; using NzbDrone.Common.Model;
+4 -4
View File
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" /> <package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="Moq" version="4.0.10827" /> <package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="4.0.0" targetFramework="net40" /> <package id="NBuilder" version="3.0.1.1" />
<package id="NLog" version="4.3.11" targetFramework="net40" /> <package id="NLog" version="4.3.4" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" /> <package id="NUnit" version="3.2.0" targetFramework="net40" />
</packages> </packages>
@@ -28,7 +28,7 @@ namespace NzbDrone.Automation.Test
LogManager.Configuration = new LoggingConfiguration(); LogManager.Configuration = new LoggingConfiguration();
var consoleTarget = new ConsoleTarget { Layout = "${level}: ${message} ${exception}" }; var consoleTarget = new ConsoleTarget { Layout = "${level}: ${message} ${exception}" };
LogManager.Configuration.AddTarget(consoleTarget.GetType().Name, consoleTarget); LogManager.Configuration.AddTarget(consoleTarget.GetType().Name, consoleTarget);
LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", NLog.LogLevel.Trace, consoleTarget)); LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, consoleTarget));
} }
[TestFixtureSetUp] [TestFixtureSetUp]
@@ -40,7 +40,7 @@ namespace NzbDrone.Automation.Test
_runner.KillAll(); _runner.KillAll();
_runner.Start(); _runner.Start();
driver.Url = "http://localhost:7878"; driver.Url = "http://localhost:8989";
var page = new PageBase(driver); var page = new PageBase(driver);
page.WaitForNoSpinner(); page.WaitForNoSpinner();
@@ -38,20 +38,20 @@
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="FluentAssertions.Core, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL"> <Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.Core.dll</HintPath> <HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath> <HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL"> <Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll</HintPath> <HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@@ -62,13 +62,13 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="WebDriver, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="WebDriver, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.0.1\lib\net40\WebDriver.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>True</Private> <HintPath>..\packages\Selenium.WebDriver.2.48.0\lib\net40\WebDriver.dll</HintPath>
</Reference> </Reference>
<Reference Include="WebDriver.Support, Version=3.0.1.0, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="WebDriver.Support, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.0.1\lib\net40\WebDriver.Support.dll</HintPath> <SpecificVersion>False</SpecificVersion>
<Private>True</Private> <HintPath>..\packages\Selenium.Support.2.48.0\lib\net40\WebDriver.Support.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

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