1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-03-20 16:44:18 -04:00

Compare commits

...

106 Commits

Author SHA1 Message Date
Taloth Saldono
97c3863efb Temporary mock data while services isn't updated with new endpoint. 2017-05-13 00:19:34 +02:00
Taloth Saldono
7b4cb4145d Ability to blacklist and rename indexer urls via services. 2017-05-13 00:19:34 +02:00
Taloth Saldono
766520b851 Renamed DownloadClientStatus to DownloadClientInfo to avoid conflict. 2017-05-13 00:16:53 +02:00
Taloth Saldono
14144bd4d9 Renamed IndexerStatus.IndexerId to ProviderId. 2017-05-13 00:16:53 +02:00
Taloth Saldono
7b0e40d5d0 Replaced Url with BaseUrl in most indexers. 2017-05-13 00:16:53 +02:00
Taloth Saldono
2dbf095fd5 Fixed: Regression in Quality fallback by extension. 2017-05-13 00:13:12 +02:00
Taloth Saldono
2a86f8c241 Fixed: UI Series lookup autocomplete with diacritics.
Closes #1915
2017-05-11 20:37:07 +02:00
Taloth Saldono
c184e7ddcc Fixed: Multiple Scene Mapping exception even when the mappings pointed to the same tvdbid.
Closes #1917
2017-05-11 06:32:09 +02:00
Taloth Saldono
95c81f8905 Fixed exception in MountCheck if RootDirectory cannot be found. 2017-05-10 23:08:17 +02:00
Mark McDowall
db15949704 Fixed: Better error message when searching for episode without an absolute episode number 2017-05-09 20:00:21 -07:00
Mark McDowall
a63248401e Fixed: Width in Kodi Metadata 2017-05-09 20:00:21 -07:00
Kyse
1b32411219 New: Health Check warning if series folder is mounted with 'ro' option on linux
Closes #1867
2017-05-09 21:07:24 +02:00
Taloth Saldono
cd7368512d Fixed Scene Mapping error message. 2017-05-09 17:26:45 +02:00
Taloth Saldono
a5bc4a8f11 Added ability to filter scene mappings by regex via services. 2017-05-06 14:05:49 +02:00
Drew Freyling
2ae41a3404 remove redundant IE meta tag as we use http header instead 2017-05-05 22:26:28 -07:00
Drew Freyling
312136a57c use cleancss for minification 2017-05-05 22:26:10 -07:00
Mark McDowall
53e51af9c7 Fixed: Don't import the same file again
Closes #929
2017-05-02 22:52:59 -07:00
Mark McDowall
f852ca91c0 Clean up GrabbedReleaseQualityFixture 2017-05-02 22:52:11 -07:00
Mark McDowall
413dd51db1 Fix unit test 2017-05-02 22:06:18 -07:00
Mark McDowall
9d93fc1092 New: Prevent automatic import if file quality differs from grabbed release quality 2017-05-02 18:44:42 -07:00
Lloyd Sparkes
0bbb82c67f Update SocksWebProxy to fix #1641 2017-04-29 17:11:55 +02:00
Mark McDowall
cd8ae0d036 Added test to validate season pack being grabbed when only one episode is monitored
Closes #1862
2017-04-28 17:37:29 -07:00
Taloth Saldono
d726a7acb2 Fixed: Sonarr UI Authentication cookie should be placed on path (UrlBase) instead of domain alone.
fixes #1874
2017-04-27 23:33:04 +02:00
Mark McDowall
c94636e2b3 Placeholders for language profile migrations 2017-04-26 11:45:07 -07:00
Taloth Saldono
3749f3e2e5 Fixed missing icon preventing detailed explanation validation errors explanations from appearing. 2017-04-25 19:16:43 +02:00
Taloth Saldono
1f93bec055 Updated Transmission tests. 2017-04-24 21:53:40 +02:00
Taloth Saldono
a003a89b14 Fixed: Sonarr not importing torrents in Vuze if the torrent already finished seeding and was stopped. 2017-04-24 21:08:50 +02:00
Taloth Saldono
35fca89dad Fixed: Incorrect imports with Vuze when torrent contains a single file.
fixes #1805
2017-04-23 17:24:07 +02:00
Mark McDowall
e97e13e897 Fixed: Smarter application update completed message
Closes #1864
2017-04-21 10:52:31 -07:00
Taloth Saldono
f8d5f1fc94 Added -Scrambled to the ReleaseGroup cleanup list. 2017-04-14 20:47:17 +02:00
Taloth Saldono
46a1ff3e2d Tweaked parser to handle S01.Ep01.
closes #1849
2017-04-14 20:44:14 +02:00
Mark McDowall
f36d5dc881 Moving and Removing of downloads in usenet clients
Fixed: Moving items triggered via post-processing scripts
Fixed: Removing failed downloads fromusenet clients
2017-04-12 17:41:22 -07:00
Taloth Saldono
f8b8fcfb8d Fixed: Handling of priority setting when queueing is disabled in qBittorrent.
fixes #1841
2017-04-12 20:49:28 +02:00
Taloth Saldono
de7f68570e Fixed: Regression causing nzbToMedia imports to be copied instead of moved. 2017-04-12 20:49:28 +02:00
Taloth Saldono
fa006d85fd New: Check whether an existing episode file was deleted before grabbing an upgrade, to avoid timing issues in combination with Ignore Deleted Episodes. 2017-04-12 20:46:36 +02:00
Mark McDowall
413ce1d9a7 Fixed: Double periods in extra file names after rename 2017-04-11 20:32:34 -07:00
Mark McDowall
41f769790d Fix issue adding a series when TitleSlug for another series is null
Fixed: Adding a series when an existing series is has a null slug
Closes #1840
2017-04-11 17:57:29 -07:00
Taloth Saldono
b63bcd16a7 Fixed: Sample check has too little margin for 2 min anime with 1 minute files. Lowered to 15 sec. 2017-04-10 17:46:08 +02:00
Mark McDowall
b485bdaeec Fixed: Unable to execute custom scripts if IMDB ID is null
Fixes #1825
2017-04-08 08:20:57 -07:00
Taloth Saldono
b70d167911 Apply Cleanse to Exception Data as well. 2017-04-08 12:38:39 +02:00
Taloth Saldono
924fe80997 Fixed RssParser test. 2017-04-07 22:36:39 +02:00
Taloth Saldono
cd450a44bf Should not empty install folder, MirrorFolder will take care of it. 2017-04-07 22:09:49 +02:00
Taloth Saldono
35741b9cae Added a few more files to ignore during file copy. 2017-04-07 22:07:42 +02:00
Taloth Saldono
c9d1807670 Sentry should use CleanseLogMessage. 2017-04-07 20:42:39 +02:00
Taloth Saldono
94886e767b Fixed: UnsupportedFeedException should log error for each item 2017-04-07 19:32:12 +02:00
Taloth Saldono
e4c3418987 Fixed: Failing Newznab capabilities request should trigger automatic indexer backoff logic. 2017-04-07 19:10:08 +02:00
Taloth Saldono
5613ab05e0 Fixed: Sabnzbd/NzbGet not processing history items properly after last update. 2017-03-31 18:56:45 +02:00
Taloth Saldono
372442af2c fixed broken tests. 2017-03-30 23:20:49 +02:00
Taloth Saldono
28c45f941b Cleanup of commented out code. 2017-03-30 22:28:00 +02:00
Marcelo Castagna
ea1616586f Fixed: Import from torrent Download Station should move since DS maintains an internal copy for seeding. 2017-03-30 22:26:11 +02:00
Mark McDowall
e48600da42 New: TvMaze and IMDB IDs added to custom script environment variables 2017-03-29 18:22:14 -07:00
Mark McDowall
5d9d2e684e New: Paths for deleted files when upgrading an existing file 2017-03-29 13:22:37 -07:00
Mark McDowall
2e392e0f5e New: Additional variables for custom script on grab events 2017-03-29 13:12:37 -07:00
Mark McDowall
83370ddbbb New: Episode files sent to Recycling Bin are put into subfolders
Closes #401
2017-03-29 06:44:50 -07:00
Mark McDowall
c20b152c28 Fixed spelling in message 2017-03-26 13:21:29 -07:00
Mark McDowall
bf5067466d Guard against a null file showing an exception in release rejections
Fixes #1755
2017-03-26 13:01:59 -07:00
Taloth Saldono
ec7f749541 Tweaked default config for extra files import. 2017-03-26 21:22:58 +02:00
Taloth Saldono
56ecbf4a31 Fixed: Sabnzbd error when tv sorting enabled for all categories. 2017-03-26 17:09:22 +02:00
Mark McDowall
1b39911135 True/False for config settings value 2017-03-25 22:18:57 -07:00
Mark McDowall
6aaefae2d5 New: Explicit toggle for importing extra files 2017-03-25 09:13:28 -07:00
margaale
db9d601115 Revert Session name 2017-03-23 13:46:01 -03:00
Taloth Saldono
e7331539f0 Fixed: Newznab default capabilities erroneously cached if indexer is unavailable. 2017-03-23 17:12:10 +01:00
Taloth Saldono
58bd57bed6 New: Updated MediaInfo to 0.7.93. 2017-03-22 19:17:55 +01:00
Mark McDowall
7a58082cd7 smallicon for Join notifications
New: White icon with transparent background for Join notifications notification bar icon
Closes #1458
2017-03-19 23:31:50 -07:00
Taloth Saldono
2e08f195e4 Fixed: Zero length file causes MediaInfo hanging in 100% cpu load. 2017-03-19 22:02:52 +01:00
Taloth Saldono
a1a5e29c3e fixed sab tests. 2017-03-19 19:00:05 +01:00
margaale
5033886b90 Fixed: DownloadStation api client for DSM 5.x. 2017-03-19 18:50:56 +01:00
Mark McDowall
29419d6575 Update README.md 2017-03-18 23:34:37 -07:00
Mark McDowall
3c22f68f5a Fixed: Parsing releases with year added to the end of the series title
Fixes #1768
2017-03-18 22:45:47 -07:00
Mark McDowall
a0d98951aa Use MaterialisingResponse for static resource responses 2017-03-18 12:22:44 -07:00
Taloth Saldono
70f7404499 Fixed: Sabnzbd 2.0 api compatibility.
closes #1775
2017-03-18 16:32:13 +01:00
Mark McDowall
abd70f5381 New: UHD category for RARBG 2017-03-17 07:16:24 -07:00
Mark McDowall
878e973081 Fixed: Join grab messages
Fixes #1751
2017-03-13 19:43:07 -07:00
Taloth Saldono
2bf3b9e7dd fixed typo setting custom directory for rtorrent. 2017-03-12 11:18:51 +01:00
Taloth Saldono
2326db0dea Fixed: Refactored rtorrent interface to fix reliability issues with adding magnets & torrents.
fixes #1745
2017-03-11 12:15:42 +01:00
Taloth Saldono
3590fedeaf Fixed: Timing issue in rtorrent handling of magnet links.
ref #1745
2017-03-10 21:07:08 +01:00
Taloth Saldono
f4866cae69 fixed broken project file. 2017-03-10 20:43:16 +01:00
Mark McDowall
149d191f62 Remove NCrunch.Framework 2017-03-09 20:30:39 -08:00
Jamie Magee
bb9bd63382 Upgrade CommonServiceLocator
From 1.0 to 1.3
2017-03-09 20:30:39 -08:00
Jamie Magee
34fda24124 Upgrade Microsoft.AspNet.SignalR.Client
From 1.2.1 to 1.2.2
2017-03-09 20:30:39 -08:00
Jamie Magee
c8d10829a0 Upgrade Selenium.*
From 3.0.1 to 3.2.0
2017-03-09 19:49:05 -08:00
Jamie Magee
ae2bdb757a Upgrade NUnit
From 3.5.0 to 3.6.0
2017-03-09 19:49:02 -08:00
Jamie Magee
714ad075fc Upgrade FluentAssertions
From 4.18.0 to 4.19.0
2017-03-09 19:48:11 -08:00
Jamie Magee
87a05df2fd Upgrade TinyTwitter
From 1.1.1 to 1.1.2

NOTE: Sonarr was already using a modified version of TinyTwitter 1.1.2.
This change just modifies the packages.config file to reflect that
2017-03-09 19:48:11 -08:00
Jamie Magee
f3263efa52 Upgrade SharpRaven
From 2.1.0 to 2.2.0
2017-03-09 19:48:11 -08:00
Jamie Magee
1cad11d207 Upgrade Ical.Net
From 2.2.25 to 2.2.32
2017-03-09 19:48:10 -08:00
Jamie Magee
781df8b20a Upgrade NLog
From 4.4.1 to 4.4.3
2017-03-09 19:48:10 -08:00
Mark McDowall
ebcce05588 Fixed: Parsing headers that have a trailing semi-colon
Fixes #1749
2017-03-09 15:40:13 -08:00
Taloth Saldono
bbf2134fe1 Fixed: Deluge 1.3.14 API support due to changed json-rpc checks.
fixes #1738
2017-03-06 20:14:34 +01:00
Mark McDowall
081c5fc332 Broken ExtraFiles migration due to extentionless files
Fixed: Prevent extensionless files from being imported
Fixed: Broken migration due to extensionless extra files
2017-03-06 11:00:38 -08:00
Mark McDowall
47915d5e05 Fixed: Bad extension when importing extra files 2017-03-05 17:45:35 -08:00
Mark McDowall
47e221d9a0 Fixed: Delay profiles are no longer hidden under advanced settings 2017-03-03 21:16:29 -08:00
Mark McDowall
bf485f6f2c Log number of files found when getting video/non-video files 2017-03-03 20:57:05 -08:00
Mark McDowall
b365d8a537 Include language in suffix when importing 2017-03-03 19:44:31 -08:00
Taloth Saldono
fee8da88a6 Accept full language name as suffix. 2017-03-03 19:44:31 -08:00
Mark McDowall
cc0dbf1af4 New: Rename subtitles and extra files when renaming files
Towards #459
2017-03-03 19:44:31 -08:00
Mark McDowall
836131ebb1 New: Import subtitles and extra files when importing media files 2017-03-03 19:44:31 -08:00
Marcelo Castagna
9a870a3709 Fixed: DownloadStation interface stuck in infinite loop in some cases.
* removed empty spaces. changed dcaex => ex

* Changed error message

* changed error message

* Wrong message, ups

* Another message
2017-03-01 18:46:16 +01:00
Taloth Saldono
afe05189da Fixed series scan tests. 2017-02-28 21:06:41 +01:00
Taloth Saldono
2abaef16f1 Fixed Indexer Health Checks and tests. 2017-02-28 20:59:22 +01:00
Daniel Smith
37d5a3f2ad Fixed: Clear EpisodeFile records from database if Series folder is missing, but root folder appears to be mounted. 2017-02-28 17:01:12 +01:00
Mark McDowall
be4d70e3a9 Fixed: Health check failing and preventing others from running 2017-02-28 00:12:34 -08:00
Mark McDowall
79043f2c64 Improve indexer health check messages
Fixed: Improve health check message when all enabled indexers are disabled due to failures
Closes #1551
2017-02-28 00:12:34 -08:00
Mark McDowall
1dab0aee6a Fixed: Reduce parameters required to add a new series
Fixes #1403
2017-02-27 21:37:33 -08:00
Mark McDowall
9b162f2d5e Fixed: Clean RSS feed before detecting type
Fixes #1518
2017-02-27 21:37:00 -08:00
Mark McDowall
5518cf5362 Added Download decision comparator test to confirm quality is preferred over seeders 2017-02-25 16:18:00 -08:00
325 changed files with 5870 additions and 1864 deletions

BIN
Logo/96-Outline-White.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -22,7 +22,7 @@ Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS fee
* Visual Studio 2015 (https://www.visualstudio.com/vs/)
* [Git](https://git-scm.com/downloads)
* [NodeJS](https://nodejs.org/download/)
* [NodeJS](https://nodejs.org/en/download/)
### Setup

View File

@@ -5,7 +5,7 @@ var postcss = require('gulp-postcss');
var sourcemaps = require('gulp-sourcemaps');
var autoprefixer = require('autoprefixer-core');
var livereload = require('gulp-livereload');
var cleancss = require('gulp-clean-css');
var print = require('gulp-print');
var paths = require('./paths');
var errorHandler = require('./errorHandler');
@@ -33,12 +33,13 @@ gulp.task('less', function() {
.pipe(sourcemaps.init())
.pipe(less({
dumpLineNumbers : 'false',
compress : true,
yuicompress : true,
compress : false,
yuicompress : false,
ieCompat : true,
strictImports : true
}))
.pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }) ]))
.pipe(cleancss())
.on('error', errorHandler.onError)
.pipe(sourcemaps.write(paths.dest.content))
.pipe(gulp.dest(paths.dest.content))

View File

@@ -20,6 +20,7 @@
"del": "1.2.0",
"gulp": "3.9.0",
"gulp-cached": "1.1.0",
"gulp-clean-css": "^3.0.4",
"gulp-concat": "2.6.0",
"gulp-declare": "0.3.0",
"gulp-handlebars": "3.0.1",

View File

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

View File

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

View File

@@ -42,17 +42,17 @@
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath>
<Private>True</Private>
</Reference>
<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 Include="FluentAssertions, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.dll</HintPath>
</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 Include="FluentAssertions.Core, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.Core.dll</HintPath>
</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 Include="Moq, Version=4.2.1510.2205, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<HintPath>..\packages\Moq.4.2.1510.2205\lib\net40\Moq.dll</HintPath>
</Reference>
<Reference Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.0\lib\net40\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

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

View File

@@ -33,12 +33,12 @@ namespace NzbDrone.Api.Authentication
{
if (_configFileProvider.AuthenticationMethod == AuthenticationType.Forms)
{
RegisterFormsAuth(pipelines);
RegisterFormsAuth(pipelines);
}
else if (_configFileProvider.AuthenticationMethod == AuthenticationType.Basic)
{
pipelines.EnableBasicAuthentication(new BasicAuthenticationConfiguration(_authenticationService, "Sonarr"));
pipelines.EnableBasicAuthentication(new BasicAuthenticationConfiguration(_authenticationService, "Sonarr"));
}
pipelines.BeforeRequest.AddItemToEndOfPipeline((Func<NancyContext, Response>) RequiresAuthentication);
@@ -68,6 +68,7 @@ namespace NzbDrone.Api.Authentication
{
RedirectUrl = _configFileProvider.UrlBase + "/login",
UserMapper = _authenticationService,
Path = _configFileProvider.UrlBase,
CryptographyConfiguration = cryptographyConfiguration
});
}

View File

@@ -20,6 +20,7 @@ namespace NzbDrone.Api.Config
public bool SkipFreeSpaceCheckWhenImporting { get; set; }
public bool CopyUsingHardlinks { get; set; }
public bool ImportExtraFiles { get; set; }
public string ExtraFileExtensions { get; set; }
public bool EnableMediaInfo { get; set; }
}
@@ -44,6 +45,7 @@ namespace NzbDrone.Api.Config
SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting,
CopyUsingHardlinks = model.CopyUsingHardlinks,
ImportExtraFiles = model.ImportExtraFiles,
ExtraFileExtensions = model.ExtraFileExtensions,
EnableMediaInfo = model.EnableMediaInfo
};

View File

@@ -2,6 +2,8 @@
using System.IO;
using NLog;
using NzbDrone.Api.REST;
using NzbDrone.Common.Disk;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore.Events;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.Events;
@@ -16,6 +18,7 @@ namespace NzbDrone.Api.EpisodeFiles
IHandle<EpisodeFileAddedEvent>
{
private readonly IMediaFileService _mediaFileService;
private readonly IDiskProvider _diskProvider;
private readonly IRecycleBinProvider _recycleBinProvider;
private readonly ISeriesService _seriesService;
private readonly IQualityUpgradableSpecification _qualityUpgradableSpecification;
@@ -23,6 +26,7 @@ namespace NzbDrone.Api.EpisodeFiles
public EpisodeFileModule(IBroadcastSignalRMessage signalRBroadcaster,
IMediaFileService mediaFileService,
IDiskProvider diskProvider,
IRecycleBinProvider recycleBinProvider,
ISeriesService seriesService,
IQualityUpgradableSpecification qualityUpgradableSpecification,
@@ -30,6 +34,7 @@ namespace NzbDrone.Api.EpisodeFiles
: base(signalRBroadcaster)
{
_mediaFileService = mediaFileService;
_diskProvider = diskProvider;
_recycleBinProvider = recycleBinProvider;
_seriesService = seriesService;
_qualityUpgradableSpecification = qualityUpgradableSpecification;
@@ -74,9 +79,10 @@ namespace NzbDrone.Api.EpisodeFiles
var episodeFile = _mediaFileService.Get(id);
var series = _seriesService.GetSeries(episodeFile.SeriesId);
var fullPath = Path.Combine(series.Path, episodeFile.RelativePath);
var subfolder = _diskProvider.GetParentFolder(series.Path).GetRelativePath(_diskProvider.GetParentFolder(fullPath));
_logger.Info("Deleting episode file: {0}", fullPath);
_recycleBinProvider.DeleteFile(fullPath);
_recycleBinProvider.DeleteFile(fullPath, subfolder);
_mediaFileService.Delete(episodeFile, DeleteMediaFileReason.Manual);
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using NLog;
using Nancy;
@@ -38,7 +38,7 @@ namespace NzbDrone.Api.Frontend.Mappers
if (_diskProvider.FileExists(filePath, _caseSensitive))
{
var response = new StreamResponse(() => GetContentStream(filePath), MimeTypes.GetMimeType(filePath));
return response;
return new MaterialisingResponse(response);
}
_logger.Warn("File {0} not found", filePath);

View File

@@ -41,20 +41,17 @@
</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>
<HintPath>..\packages\Ical.Net.2.2.32\lib\net40\antlr.runtime.dll</HintPath>
</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="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 Include="Ical.Net, Version=2.1.0.18776, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.32\lib\net40\Ical.Net.dll</HintPath>
</Reference>
<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 Include="Ical.Net.Collections, Version=2.1.0.18775, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Ical.Net.2.2.32\lib\net40\Ical.Net.Collections.dll</HintPath>
</Reference>
<Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath>
@@ -73,12 +70,10 @@
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.3\lib\net40\NLog.dll</HintPath>
</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>
<HintPath>..\packages\Ical.Net.2.2.32\lib\net40\NodaTime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -41,7 +41,7 @@ namespace NzbDrone.Api.Series
public static List<Season> ToModel(this IEnumerable<SeasonResource> resources)
{
return resources.Select(ToModel).ToList();
return resources?.Select(ToModel).ToList() ?? new List<Season>();
}
}
}

View File

@@ -29,12 +29,14 @@ namespace NzbDrone.Api.Series
{
private readonly ISeriesService _seriesService;
private readonly IAddSeriesService _addSeriesService;
private readonly ISeriesStatisticsService _seriesStatisticsService;
private readonly ISceneMappingService _sceneMappingService;
private readonly IMapCoversToLocal _coverMapper;
public SeriesModule(IBroadcastSignalRMessage signalRBroadcaster,
ISeriesService seriesService,
IAddSeriesService addSeriesService,
ISeriesStatisticsService seriesStatisticsService,
ISceneMappingService sceneMappingService,
IMapCoversToLocal coverMapper,
@@ -48,6 +50,7 @@ namespace NzbDrone.Api.Series
: base(signalRBroadcaster)
{
_seriesService = seriesService;
_addSeriesService = addSeriesService;
_seriesStatisticsService = seriesStatisticsService;
_sceneMappingService = sceneMappingService;
@@ -74,7 +77,6 @@ namespace NzbDrone.Api.Series
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.TvdbId).GreaterThan(0).SetValidator(seriesExistsValidator);
PutValidator.RuleFor(s => s.Path).IsValidPath();
@@ -114,7 +116,7 @@ namespace NzbDrone.Api.Series
{
var model = seriesResource.ToModel();
return _seriesService.AddSeries(model).Id;
return _addSeriesService.AddSeries(model).Id;
}
private void UpdateSeries(SeriesResource seriesResource)

View File

@@ -207,19 +207,9 @@ namespace NzbDrone.Api.Series
public static Core.Tv.Series ToModel(this SeriesResource resource, Core.Tv.Series series)
{
series.TvdbId = resource.TvdbId;
var updatedSeries = resource.ToModel();
series.Seasons = resource.Seasons.ToModel();
series.Path = resource.Path;
series.ProfileId = resource.ProfileId;
series.SeasonFolder = resource.SeasonFolder;
series.Monitored = resource.Monitored;
series.SeriesType = resource.SeriesType;
series.RootFolderPath = resource.RootFolderPath;
series.Tags = resource.Tags;
series.AddOptions = resource.AddOptions;
series.ApplyChanges(updatedSeries);
return series;
}

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentValidation" version="6.2.1.0" targetFramework="net40" />
<package id="Ical.Net" version="2.2.25" targetFramework="net40" />
<package id="Ical.Net" version="2.2.32" 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="9.0.1" targetFramework="net40" />
<package id="NLog" version="4.4.1" targetFramework="net40" />
<package id="NLog" version="4.4.3" targetFramework="net40" />
</packages>

View File

@@ -41,21 +41,17 @@
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath>
<Private>True</Private>
</Reference>
<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 Include="FluentAssertions, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.dll</HintPath>
</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 Include="FluentAssertions.Core, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.3\lib\net40\NLog.dll</HintPath>
</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 Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.0\lib\net40\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
<package id="FluentAssertions" version="4.19.0" targetFramework="net40" />
<package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="4.0.0" targetFramework="net40" />
<package id="NLog" version="4.4.1" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" />
<package id="NLog" version="4.4.3" targetFramework="net40" />
<package id="NUnit" version="3.6.0" targetFramework="net40" />
</packages>

View File

@@ -38,21 +38,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<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 Include="FluentAssertions, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.dll</HintPath>
</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 Include="FluentAssertions.Core, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.3\lib\net40\NLog.dll</HintPath>
</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 Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.0\lib\net40\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -62,13 +58,11 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<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 Include="WebDriver, Version=3.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.WebDriver.3.2.0\lib\net40\WebDriver.dll</HintPath>
</Reference>
<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 Include="WebDriver.Support, Version=3.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Selenium.Support.3.2.0\lib\net40\WebDriver.Support.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
<package id="NLog" version="4.4.1" 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" />
<package id="FluentAssertions" version="4.19.0" targetFramework="net40" />
<package id="NLog" version="4.4.3" targetFramework="net40" />
<package id="NUnit" version="3.6.0" targetFramework="net40" />
<package id="Selenium.Support" version="3.2.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="3.2.0" targetFramework="net40" />
</packages>

View File

@@ -5,6 +5,7 @@ using System;
using System.Text;
using NzbDrone.Common.Http;
using System.Collections.Specialized;
using System.Linq;
namespace NzbDrone.Common.Test.Http
{
@@ -36,5 +37,17 @@ namespace NzbDrone.Common.Test.Http
Action action = () => httpheader.GetEncodingFromContentType();
action.ShouldThrow<ArgumentException>();
}
[Test]
public void should_parse_cookie_with_trailing_semi_colon()
{
var cookies = HttpHeader.ParseCookies("uid=123456; pass=123456b2f3abcde42ac3a123f3f1fc9f;");
cookies.Count.Should().Be(2);
cookies.First().Key.Should().Be("uid");
cookies.First().Value.Should().Be("123456");
cookies.Last().Key.Should().Be("pass");
cookies.Last().Value.Should().Be("123456b2f3abcde42ac3a123f3f1fc9f");
}
}
}

View File

@@ -37,21 +37,17 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<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 Include="FluentAssertions, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.dll</HintPath>
</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 Include="FluentAssertions.Core, Version=4.19.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
<HintPath>..\packages\FluentAssertions.4.19.0\lib\net40\FluentAssertions.Core.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.3\lib\net40\NLog.dll</HintPath>
</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 Include="nunit.framework, Version=3.6.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.3.6.0\lib\net40\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -86,7 +86,7 @@ namespace NzbDrone.Common.Test
{
first.AsOsAgnostic().PathEquals(second.AsOsAgnostic()).Should().BeFalse();
}
[Test]
public void should_return_false_when_not_a_child()
{
@@ -113,6 +113,7 @@ namespace NzbDrone.Common.Test
[TestCase(@"C:\Test\", @"C:\Test\mydir")]
[TestCase(@"C:\Test\", @"C:\Test\mydir\")]
[TestCase(@"C:\Test", @"C:\Test\30.Rock.S01E01.Pilot.avi")]
[TestCase(@"C:\", @"C:\Test\30.Rock.S01E01.Pilot.avi")]
public void path_should_be_parent(string parentPath, string childPath)
{
parentPath.AsOsAgnostic().IsParentPath(childPath.AsOsAgnostic()).Should().BeTrue();

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
<package id="FluentAssertions" version="4.19.0" targetFramework="net40" />
<package id="Moq" version="4.0.10827" />
<package id="NLog" version="4.4.1" targetFramework="net40" />
<package id="NUnit" version="3.5.0" targetFramework="net40" />
<package id="NLog" version="4.4.3" targetFramework="net40" />
<package id="NUnit" version="3.6.0" targetFramework="net40" />
</packages>

View File

@@ -590,7 +590,7 @@ namespace NzbDrone.Common.Disk
private bool ShouldIgnore(FileInfo file)
{
if (file.Name.StartsWith(".nfs"))
if (file.Name.StartsWith(".nfs") || file.Name == "debug.log" || file.Name.EndsWith(".socket"))
{
_logger.Trace("Ignoring file {0}", file.FullName);
return true;

View File

@@ -1,4 +1,5 @@
using System.IO;
using System.Collections.Generic;
using System.IO;
using NzbDrone.Common.Extensions;
namespace NzbDrone.Common.Disk
@@ -8,10 +9,11 @@ namespace NzbDrone.Common.Disk
private readonly DriveInfo _driveInfo;
private readonly DriveType _driveType;
public DriveInfoMount(DriveInfo driveInfo, DriveType driveType = DriveType.Unknown)
public DriveInfoMount(DriveInfo driveInfo, DriveType driveType = DriveType.Unknown, MountOptions mountOptions = null)
{
_driveInfo = driveInfo;
_driveType = driveType;
MountOptions = mountOptions;
}
public long AvailableFreeSpace => _driveInfo.AvailableFreeSpace;
@@ -33,6 +35,8 @@ namespace NzbDrone.Common.Disk
public bool IsReady => _driveInfo.IsReady;
public MountOptions MountOptions { get; private set; }
public string Name => _driveInfo.Name;
public string RootDirectory => _driveInfo.RootDirectory.FullName;

View File

@@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.IO;
namespace NzbDrone.Common.Disk
@@ -8,6 +9,7 @@ namespace NzbDrone.Common.Disk
string DriveFormat { get; }
DriveType DriveType { get; }
bool IsReady { get; }
MountOptions MountOptions { get; }
string Name { get; }
string RootDirectory { get; }
long TotalFreeSpace { get; }

View File

@@ -0,0 +1,16 @@
using System.Collections.Generic;
namespace NzbDrone.Common.Disk
{
public class MountOptions
{
private readonly Dictionary<string, string> _options;
public MountOptions(Dictionary<string, string> options)
{
_options = options;
}
public bool IsReadOnly => _options.ContainsKey("ro");
}
}

View File

@@ -2,7 +2,7 @@ using System;
namespace NzbDrone.Common.Extensions
{
public static class Base64Extentions
public static class Base64Extensions
{
public static string ToBase64(this byte[] bytes)
{
@@ -14,4 +14,4 @@ namespace NzbDrone.Common.Extensions
return BitConverter.GetBytes(input).ToBase64();
}
}
}
}

View File

@@ -0,0 +1,55 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace NzbDrone.Common.Extensions
{
public static class ExceptionExtensions
{
public static T WithData<T>(this T ex, string key, string value) where T : Exception
{
ex.AddData(key, value);
return ex;
}
public static T WithData<T>(this T ex, string key, int value) where T : Exception
{
ex.AddData(key, value.ToString());
return ex;
}
public static T WithData<T>(this T ex, string key, Http.HttpUri value) where T : Exception
{
ex.AddData(key, value.ToString());
return ex;
}
public static T WithData<T>(this T ex, Http.HttpResponse response, int maxSampleLength = 512) where T : Exception
{
if (response == null || response.Content == null) return ex;
var contentSample = response.Content.Substring(0, Math.Min(response.Content.Length, 512));
if (response.Headers != null)
{
ex.AddData("ContentType", response.Headers.ContentType ?? string.Empty);
}
ex.AddData("ContentLength", response.Content.Length.ToString());
ex.AddData("ContentSample", contentSample);
return ex;
}
private static void AddData(this Exception ex, string key, string value)
{
if (value.IsNullOrWhiteSpace()) return;
ex.Data[key] = value;
}
}
}

View File

@@ -80,11 +80,11 @@ namespace NzbDrone.Common.Extensions
public static bool IsParentPath(this string parentPath, string childPath)
{
if (parentPath != "/")
if (parentPath != "/" && !parentPath.EndsWith(":\\"))
{
parentPath = parentPath.TrimEnd(Path.DirectorySeparatorChar);
}
if (childPath != "/")
if (childPath != "/" && !parentPath.EndsWith(":\\"))
{
childPath = childPath.TrimEnd(Path.DirectorySeparatorChar);
}
@@ -276,4 +276,4 @@ namespace NzbDrone.Common.Extensions
return Path.Combine(appFolderInfo.StartUpFolder, NLOG_CONFIG_FILE);
}
}
}
}

View File

@@ -5,11 +5,11 @@ using System.Xml.Linq;
namespace NzbDrone.Common.Extensions
{
public static class XmlExtentions
public static class XmlExtensions
{
public static IEnumerable<XElement> FindDecendants(this XContainer container, string localName)
{
return container.Descendants().Where(c => c.Name.LocalName.Equals(localName, StringComparison.InvariantCultureIgnoreCase));
}
}
}
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.Specialized;
@@ -169,7 +169,7 @@ namespace NzbDrone.Common.Http
public static List<KeyValuePair<string, string>> ParseCookies(string cookies)
{
return cookies.Split(';')
return cookies.Split(new[] { ";" }, StringSplitOptions.RemoveEmptyEntries)
.Select(v => v.Trim().Split('='))
.Select(v => new KeyValuePair<string, string>(v[0], v[1]))
.ToList();

View File

@@ -9,7 +9,7 @@ namespace NzbDrone.Common.Http
public class JsonRpcRequestBuilder : HttpRequestBuilder
{
public static HttpAccept JsonRpcHttpAccept = new HttpAccept("application/json-rpc, application/json");
public static string JsonRpcContentType = "application/json-rpc";
public static string JsonRpcContentType = "application/json";
public string JsonMethod { get; private set; }
public List<object> JsonParameters { get; private set; }

View File

@@ -0,0 +1,47 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
using NzbDrone.Common.Serializer;
namespace NzbDrone.Common.Instrumentation
{
public class CleansingJsonVisitor : JsonVisitor
{
public override void Visit(JArray json)
{
for (var i = 0; i < json.Count; i++)
{
if (json[i].Type == JTokenType.String)
{
var text = json[i].Value<string>();
json[i] = new JValue(CleanseLogMessage.Cleanse(text));
}
}
foreach (JToken token in json)
{
Visit(token);
}
}
public override void Visit(JProperty property)
{
if (property.Value.Type == JTokenType.String)
{
property.Value = CleanseValue(property.Value as JValue);
}
else
{
base.Visit(property);
}
}
private JValue CleanseValue(JValue value)
{
var text = value.Value<string>();
var cleansed = CleanseLogMessage.Cleanse(text);
return new JValue(cleansed);
}
}
}

View File

@@ -0,0 +1,31 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
namespace NzbDrone.Common.Instrumentation.Sentry
{
public class SentryPacketCleanser
{
public void CleansePacket(SonarrSentryPacket packet)
{
packet.Message = CleanseLogMessage.Cleanse(packet.Message);
if (packet.Fingerprint != null)
{
for (var i = 0; i < packet.Fingerprint.Length; i++)
{
packet.Fingerprint[i] = CleanseLogMessage.Cleanse(packet.Fingerprint[i]);
}
}
if (packet.Extra != null)
{
var target = JObject.FromObject(packet.Extra);
new CleansingJsonVisitor().Visit(target);
packet.Extra = target;
}
}
}
}

View File

@@ -114,7 +114,6 @@ namespace NzbDrone.Common.Instrumentation.Sentry
var extras = logEvent.Properties.ToDictionary(x => x.Key.ToString(), x => x.Value.ToString());
_client.Logger = logEvent.LoggerName;
var sentryMessage = new SentryMessage(logEvent.Message, logEvent.Parameters);
var sentryEvent = new SentryEvent(logEvent.Exception)

View File

@@ -6,6 +6,13 @@ namespace NzbDrone.Common.Instrumentation.Sentry
{
public class SonarrJsonPacketFactory : IJsonPacketFactory
{
private readonly SentryPacketCleanser _cleanser;
public SonarrJsonPacketFactory()
{
_cleanser = new SentryPacketCleanser();
}
private static string ShortenPath(string path)
{
@@ -37,6 +44,8 @@ namespace NzbDrone.Common.Instrumentation.Sentry
frame.Filename = ShortenPath(frame.Filename);
}
}
_cleanser.CleansePacket(packet);
}
catch (Exception)
{
@@ -46,7 +55,6 @@ namespace NzbDrone.Common.Instrumentation.Sentry
return packet;
}
[Obsolete]
public JsonPacket Create(string project, SentryMessage message, ErrorLevel level = ErrorLevel.Info, IDictionary<string, string> tags = null,
string[] fingerprint = null, object extra = null)
@@ -61,4 +69,4 @@ namespace NzbDrone.Common.Instrumentation.Sentry
throw new NotImplementedException();
}
}
}
}

View File

@@ -44,20 +44,16 @@
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.3\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Org.Mentalis, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DotNet4.SocksProxy.1.3.2.0\lib\net40\Org.Mentalis.dll</HintPath>
<Private>True</Private>
<Reference Include="Org.Mentalis, Version=1.0.0.1, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DotNet4.SocksProxy.1.3.4.0\lib\net40\Org.Mentalis.dll</HintPath>
</Reference>
<Reference Include="SharpRaven, Version=2.1.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpRaven.2.1.0\lib\net40\SharpRaven.dll</HintPath>
<Private>True</Private>
<Reference Include="SharpRaven, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SharpRaven.2.2.0\lib\net40\SharpRaven.dll</HintPath>
</Reference>
<Reference Include="SocksWebProxy, Version=1.3.2.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DotNet4.SocksProxy.1.3.2.0\lib\net40\SocksWebProxy.dll</HintPath>
<Private>True</Private>
<Reference Include="SocksWebProxy, Version=1.3.4.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\DotNet4.SocksProxy.1.3.4.0\lib\net40\SocksWebProxy.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
@@ -89,6 +85,7 @@
<Compile Include="Disk\FileSystemLookupService.cs" />
<Compile Include="Disk\DriveInfoMount.cs" />
<Compile Include="Disk\IMount.cs" />
<Compile Include="Disk\MountOptions.cs" />
<Compile Include="Disk\RelativeFileSystemModel.cs" />
<Compile Include="Disk\FileSystemModel.cs" />
<Compile Include="Disk\FileSystemResult.cs" />
@@ -135,14 +132,15 @@
<Compile Include="Expansive\Tree.cs" />
<Compile Include="Expansive\TreeNode.cs" />
<Compile Include="Expansive\TreeNodeList.cs" />
<Compile Include="Extensions\Base64Extentions.cs" />
<Compile Include="Extensions\Base64Extensions.cs" />
<Compile Include="Extensions\DateTimeExtensions.cs" />
<Compile Include="Crypto\HashConverter.cs" />
<Compile Include="Extensions\ExceptionExtensions.cs" />
<Compile Include="Extensions\Int64Extensions.cs" />
<Compile Include="Extensions\ObjectExtensions.cs" />
<Compile Include="Extensions\StreamExtensions.cs" />
<Compile Include="Extensions\UrlExtensions.cs" />
<Compile Include="Extensions\XmlExtentions.cs" />
<Compile Include="Extensions\XmlExtensions.cs" />
<Compile Include="HashUtil.cs" />
<Compile Include="Http\Dispatchers\CurlHttpDispatcher.cs" />
<Compile Include="Http\Dispatchers\FallbackHttpDispatcher.cs" />
@@ -177,12 +175,14 @@
<Compile Include="Extensions\IEnumerableExtensions.cs" />
<Compile Include="Http\UserAgentBuilder.cs" />
<Compile Include="Instrumentation\CleanseLogMessage.cs" />
<Compile Include="Instrumentation\CleansingJsonVisitor.cs" />
<Compile Include="Instrumentation\Extensions\LoggerProgressExtensions.cs" />
<Compile Include="Instrumentation\GlobalExceptionHandlers.cs" />
<Compile Include="Instrumentation\LogEventExtensions.cs" />
<Compile Include="Instrumentation\NzbDroneFileTarget.cs" />
<Compile Include="Instrumentation\NzbDroneLogger.cs" />
<Compile Include="Instrumentation\Sentry\SentryDebounce.cs" />
<Compile Include="Instrumentation\Sentry\SentryPacketCleanser.cs" />
<Compile Include="Instrumentation\Sentry\SentryTarget.cs" />
<Compile Include="Instrumentation\Sentry\MachineNameUserFactory.cs" />
<Compile Include="Instrumentation\Sentry\SonarrJsonPacketFactory.cs" />
@@ -207,6 +207,7 @@
<Compile Include="Serializer\HttpUriConverter.cs" />
<Compile Include="Serializer\IntConverter.cs" />
<Compile Include="Serializer\Json.cs" />
<Compile Include="Serializer\JsonVisitor.cs" />
<Compile Include="ServiceFactory.cs" />
<Compile Include="ServiceProvider.cs" />
<Compile Include="Extensions\StringExtensions.cs" />

View File

@@ -8,6 +8,7 @@ using System.IO;
using System.Linq;
using NLog;
using NzbDrone.Common.EnvironmentInfo;
using NzbDrone.Common.Extensions;
using NzbDrone.Common.Model;
namespace NzbDrone.Common.Processes
@@ -129,7 +130,25 @@ namespace NzbDrone.Common.Processes
{
foreach (DictionaryEntry environmentVariable in environmentVariables)
{
startInfo.EnvironmentVariables.Add(environmentVariable.Key.ToString(), environmentVariable.Value.ToString());
try
{
_logger.Trace("Setting environment variable '{0}' to '{1}'", environmentVariable.Key, environmentVariable.Value);
startInfo.EnvironmentVariables.Add(environmentVariable.Key.ToString(), environmentVariable.Value.ToString());
}
catch (Exception e)
{
if (environmentVariable.Value == null)
{
_logger.Error(e, "Unable to set environment variable '{0}', value is null", environmentVariable.Key);
}
else
{
_logger.Error(e, "Unable to set environment variable '{0}'", environmentVariable.Key);
}
throw;
}
}
}

View File

@@ -0,0 +1,95 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json.Linq;
namespace NzbDrone.Common.Serializer
{
public class JsonVisitor
{
protected void Dispatch(JToken json)
{
switch (json.Type)
{
case JTokenType.Object:
Visit(json as JObject);
break;
case JTokenType.Array:
Visit(json as JArray);
break;
case JTokenType.Raw:
Visit(json as JRaw);
break;
case JTokenType.Constructor:
Visit(json as JConstructor);
break;
case JTokenType.Property:
Visit(json as JProperty);
break;
case JTokenType.Comment:
case JTokenType.Integer:
case JTokenType.Float:
case JTokenType.String:
case JTokenType.Boolean:
case JTokenType.Null:
case JTokenType.Undefined:
case JTokenType.Date:
case JTokenType.Bytes:
case JTokenType.Guid:
case JTokenType.Uri:
case JTokenType.TimeSpan:
Visit(json as JValue);
break;
default:
break;
}
}
public virtual void Visit(JToken json)
{
Dispatch(json);
}
public virtual void Visit(JContainer json)
{
Dispatch(json);
}
public virtual void Visit(JArray json)
{
foreach (JToken token in json)
{
Visit(token);
}
}
public virtual void Visit(JConstructor json)
{
}
public virtual void Visit(JObject json)
{
foreach (JProperty property in json.Properties())
{
Visit(property);
}
}
public virtual void Visit(JProperty property)
{
Visit(property.Value);
}
public virtual void Visit(JValue value)
{
}
}
}

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="DotNet4.SocksProxy" version="1.3.2.0" targetFramework="net40" />
<package id="DotNet4.SocksProxy" version="1.3.4.0" targetFramework="net40" />
<package id="ICSharpCode.SharpZipLib.Patched" version="0.86.5" targetFramework="net40" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net40" />
<package id="NLog" version="4.4.1" targetFramework="net40" />
<package id="SharpRaven" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.4.3" targetFramework="net40" />
<package id="SharpRaven" version="2.2.0" targetFramework="net40" />
</packages>

View File

@@ -79,8 +79,7 @@
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.4.1\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\NLog.4.4.3\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />

View File

@@ -3,6 +3,6 @@
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net40" />
<package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net40" />
<package id="NLog" version="4.4.1" targetFramework="net40" />
<package id="NLog" version="4.4.3" targetFramework="net40" />
<package id="Owin" version="1.0" targetFramework="net40" />
</packages>

View File

@@ -20,11 +20,14 @@ namespace NzbDrone.Core.Test.DataAugmentation.Scene
private Mock<ISceneMappingProvider> _provider1;
private Mock<ISceneMappingProvider> _provider2;
[SetUp]
public void Setup()
{
_fakeMappings = Builder<SceneMapping>.CreateListOfSize(5).BuildListOfNew();
_fakeMappings = Builder<SceneMapping>.CreateListOfSize(5)
.All()
.With(v => v.FilterRegex = null)
.BuildListOfNew();
_fakeMappings[0].SearchTerm = "Words";
_fakeMappings[1].SearchTerm = "That";
@@ -193,7 +196,7 @@ namespace NzbDrone.Core.Test.DataAugmentation.Scene
Mocker.GetMock<ISceneMappingRepository>().Setup(c => c.All()).Returns(mappings);
var tvdbId = Subject.FindTvdbId(parseTitle);
var seasonNumber = Subject.GetSceneSeasonNumber(parseTitle);
var seasonNumber = Subject.GetSceneSeasonNumber(parseTitle, null);
tvdbId.Should().Be(100);
seasonNumber.Should().Be(expectedSeasonNumber);
@@ -314,6 +317,49 @@ namespace NzbDrone.Core.Test.DataAugmentation.Scene
Subject.GetSceneNames(100, new List<int> { 4 }, new List<int> { 4 }).Should().BeEmpty();
}
[Test]
public void should_filter_by_regex()
{
var mappings = new List<SceneMapping>
{
new SceneMapping { Title = "Amareto", ParseTerm = "amareto", SearchTerm = "Amareto", TvdbId = 100 },
new SceneMapping { Title = "Amareto", ParseTerm = "amareto", SearchTerm = "Amareto", TvdbId = 101, FilterRegex="-Viva$" }
};
Mocker.GetMock<ISceneMappingRepository>().Setup(c => c.All()).Returns(mappings);
Subject.FindTvdbId("Amareto", "Amareto.S01E01.720p.WEB-DL-Viva").Should().Be(101);
Subject.FindTvdbId("Amareto", "Amareto.S01E01.720p.WEB-DL-DMO").Should().Be(100);
}
[Test]
public void should_throw_if_multiple_mappings()
{
var mappings = new List<SceneMapping>
{
new SceneMapping { Title = "Amareto", ParseTerm = "amareto", SearchTerm = "Amareto", TvdbId = 100 },
new SceneMapping { Title = "Amareto", ParseTerm = "amareto", SearchTerm = "Amareto", TvdbId = 101 }
};
Mocker.GetMock<ISceneMappingRepository>().Setup(c => c.All()).Returns(mappings);
Assert.Throws<InvalidSceneMappingException>(() => Subject.FindTvdbId("Amareto", "Amareto.S01E01.720p.WEB-DL-Viva"));
}
[Test]
public void should_not_throw_if_multiple_mappings_with_same_tvdbid()
{
var mappings = new List<SceneMapping>
{
new SceneMapping { Title = "Amareto", ParseTerm = "amareto", SearchTerm = "Amareto", TvdbId = 100 },
new SceneMapping { Title = "Amareto", ParseTerm = "amareto", SearchTerm = "Amareto", TvdbId = 100 }
};
Mocker.GetMock<ISceneMappingRepository>().Setup(c => c.All()).Returns(mappings);
Subject.FindTvdbId("Amareto", "Amareto.S01E01.720p.WEB-DL-Viva").Should().Be(100);
}
private void AssertNoUpdate()
{
_provider1.Verify(c => c.GetSceneMappings(), Times.Once());

View File

@@ -0,0 +1,83 @@
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Datastore.Migration;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.Datastore.Migration
{
[TestFixture]
public class fix_extra_file_extensionsFixture : MigrationTest<fix_extra_file_extension>
{
[Test]
public void should_extra_files_that_do_not_have_an_extension()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("ExtraFiles").Row(new
{
SeriesId = 1,
SeasonNumber = 1,
EpisodeFileId = 1,
RelativePath = "Series.Title.S01E01",
Added = "2016-05-30 20:23:02.3725923",
LastUpdated = "2016-05-30 20:23:02.3725923",
Extension = ""
});
});
var items = db.Query("Select * from ExtraFiles");
items.Should().BeEmpty();
}
[Test]
public void should_fix_double_extension()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("SubtitleFiles").Row(new
{
SeriesId = 1,
SeasonNumber = 1,
EpisodeFileId = 1,
RelativePath = "Series.Title.S01E01.en.srt",
Added = "2016-05-30 20:23:02.3725923",
LastUpdated = "2016-05-30 20:23:02.3725923",
Language = Language.English,
Extension = "en.srt"
});
});
var items = db.Query("Select * from SubtitleFiles");
items.Should().HaveCount(1);
items.First()["Extension"].Should().Be(".srt");
}
[Test]
public void should_fix_extension_missing_a_leading_period()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("ExtraFiles").Row(new
{
SeriesId = 1,
SeasonNumber = 1,
EpisodeFileId = 1,
RelativePath = "Series.Title.S01E01.nfo-orig",
Added = "2016-05-30 20:23:02.3725923",
LastUpdated = "2016-05-30 20:23:02.3725923",
Extension = "nfo-orig"
});
});
var items = db.Query("Select * from ExtraFiles");
items.Should().HaveCount(1);
items.First()["Extension"].Should().Be(".nfo-orig");
}
}
}

View File

@@ -0,0 +1,54 @@
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Datastore.Migration;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.Datastore.Migration
{
[TestFixture]
public class import_extra_files_configFixture : MigrationTest<import_extra_files>
{
[Test]
public void should_not_insert_if_missing()
{
var db = WithMigrationTestDb();
var items = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
items.Should().BeNull();
}
[Test]
public void should_not_insert_if_empty()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "extrafileextensions",
Value = ""
});
});
var items = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
items.Should().BeNull();
}
[Test]
public void should_insert_True_if_configured()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "extrafileextensions",
Value = "srt"
});
});
var items = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
items.Should().Be("True");
}
}
}

View File

@@ -0,0 +1,133 @@
using System.Linq;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Datastore.Migration;
using NzbDrone.Core.Parser;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.Datastore.Migration
{
[TestFixture]
public class fix_extra_files_configFixture : MigrationTest<fix_extra_files_config>
{
[Test]
public void should_not_update_importextrafiles_disabled()
{
var db = WithMigrationTestDb();
var itemEnabled = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
itemEnabled.Should().BeNull();
}
[Test]
public void should_fix_importextrafiles_if_wrong()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "importextrafiles",
Value = 1
});
});
var itemEnabled = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
itemEnabled.Should().Be("True");
}
[Test]
public void should_fill_in_default_extensions()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "importextrafiles",
Value = "False"
});
c.Insert.IntoTable("Config").Row(new
{
Key = "extrafileextensions",
Value = ""
});
});
var itemEnabled = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
itemEnabled.Should().Be("False");
var itemExtensions = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'extrafileextensions'");
itemExtensions.Should().Be("srt");
}
[Test]
public void should_not_fill_in_default_extensions()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "importextrafiles",
Value = "True"
});
c.Insert.IntoTable("Config").Row(new
{
Key = "extrafileextensions",
Value = ""
});
});
var itemEnabled = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
itemEnabled.Should().Be("True");
var itemExtensions = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'extrafileextensions'");
itemExtensions.Should().Be("");
}
[Test]
public void should_not_fill_in_default_extensions_if_not_defined()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "importextrafiles",
Value = "False"
});
});
var itemEnabled = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
itemEnabled.Should().Be("False");
var itemExtensions = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'extrafileextensions'");
itemExtensions.Should().BeNull();
}
[Test]
public void should_not_fill_in_default_extensions_if_already_defined()
{
var db = WithMigrationTestDb(c =>
{
c.Insert.IntoTable("Config").Row(new
{
Key = "importextrafiles",
Value = "False"
});
c.Insert.IntoTable("Config").Row(new
{
Key = "extrafileextensions",
Value = "sub"
});
});
var itemEnabled = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'importextrafiles'");
itemEnabled.Should().Be("False");
var itemExtensions = db.QueryScalar<string>("SELECT Value FROM Config WHERE Key = 'extrafileextensions'");
itemExtensions.Should().Be("sub");
}
}
}

View File

@@ -28,6 +28,8 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
private Mock<IDecisionEngineSpecification> _fail2;
private Mock<IDecisionEngineSpecification> _fail3;
private Mock<IDecisionEngineSpecification> _failDelayed1;
[SetUp]
public void Setup()
{
@@ -39,14 +41,19 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_fail2 = new Mock<IDecisionEngineSpecification>();
_fail3 = new Mock<IDecisionEngineSpecification>();
_failDelayed1 = new Mock<IDecisionEngineSpecification>();
_pass1.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Accept);
_pass2.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Accept);
_pass3.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Accept);
_fail1.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Reject("fail1"));
_fail2.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Reject("fail2"));
_fail3.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Reject("fail3"));
_failDelayed1.Setup(c => c.IsSatisfiedBy(It.IsAny<RemoteEpisode>(), null)).Returns(Decision.Reject("failDelayed1"));
_failDelayed1.SetupGet(c => c.Priority).Returns(SpecificationPriority.Disk);
_reports = new List<ReleaseInfo> { new ReleaseInfo { Title = "The.Office.S03E115.DVDRip.XviD-OSiTV" } };
_remoteEpisode = new RemoteEpisode {
Series = new Series(),
@@ -78,6 +85,25 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
_pass3.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once());
}
[Test]
public void should_call_delayed_specifications_if_non_delayed_passed()
{
GivenSpecifications(_pass1, _failDelayed1);
Subject.GetRssDecision(_reports).ToList();
_failDelayed1.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Once());
}
[Test]
public void should_not_call_delayed_specifications_if_non_delayed_failed()
{
GivenSpecifications(_fail1, _failDelayed1);
Subject.GetRssDecision(_reports).ToList();
_failDelayed1.Verify(c => c.IsSatisfiedBy(_remoteEpisode, null), Times.Never());
}
[Test]
public void should_return_rejected_if_single_specs_fail()
{
@@ -214,10 +240,10 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
var criteria = new SeasonSearchCriteria { Episodes = episodes.Take(1).ToList(), SeasonNumber = 1 };
var reports = episodes.Select(v =>
new ReleaseInfo()
{
Title = string.Format("{0}.S{1:00}E{2:00}.720p.WEB-DL-DRONE", series.Title, v.SceneSeasonNumber, v.SceneEpisodeNumber)
var reports = episodes.Select(v =>
new ReleaseInfo()
{
Title = string.Format("{0}.S{1:00}E{2:00}.720p.WEB-DL-DRONE", series.Title, v.SceneSeasonNumber, v.SceneEpisodeNumber)
}).ToList();
Mocker.GetMock<IParsingService>()
@@ -289,4 +315,4 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
ExceptionVerification.ExpectedErrors(1);
}
}
}
}

View File

@@ -137,5 +137,17 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
WithFirstEpisodeUnmonitored();
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultSingle, new SingleEpisodeSearchCriteria{ MonitoredEpisodesOnly = true}).Accepted.Should().BeFalse();
}
[Test]
public void should_return_false_if_all_episodes_are_not_monitored_for_season_pack_release()
{
WithSecondEpisodeUnmonitored();
_parseResultMulti.ParsedEpisodeInfo = new ParsedEpisodeInfo
{
FullSeason = true
};
_monitoredEpisodeSpecification.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
}
}
}

View File

@@ -379,5 +379,34 @@ namespace NzbDrone.Core.Test.DecisionEngineTests
var qualifiedReports = Subject.PrioritizeDecisions(decisions);
qualifiedReports.First().RemoteEpisode.Release.Should().Be(remoteEpisode1.Release);
}
[Test]
public void should_prefer_quality_over_the_number_of_peers()
{
var remoteEpisode1 = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.Bluray1080p));
var remoteEpisode2 = GivenRemoteEpisode(new List<Episode> { GivenEpisode(1) }, new QualityModel(Quality.SDTV));
var torrentInfo1 = new TorrentInfo();
torrentInfo1.PublishDate = DateTime.Now;
torrentInfo1.DownloadProtocol = DownloadProtocol.Torrent;
torrentInfo1.Seeders = 100;
torrentInfo1.Peers = 10;
torrentInfo1.Size = 200.Megabytes();
var torrentInfo2 = torrentInfo1.JsonClone();
torrentInfo2.Seeders = 1100;
torrentInfo2.Peers = 10;
torrentInfo1.Size = 250.Megabytes();
remoteEpisode1.Release = torrentInfo1;
remoteEpisode2.Release = torrentInfo2;
var decisions = new List<DownloadDecision>();
decisions.Add(new DownloadDecision(remoteEpisode1));
decisions.Add(new DownloadDecision(remoteEpisode2));
var qualifiedReports = Subject.PrioritizeDecisions(decisions);
((TorrentInfo)qualifiedReports.First().RemoteEpisode.Release).Should().Be(torrentInfo1);
}
}
}

View File

@@ -0,0 +1,139 @@
using System;
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.DecisionEngine.Specifications.RssSync;
using NzbDrone.Core.IndexerSearch.Definitions;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Profiles;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Tv;
using NzbDrone.Core.DecisionEngine;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Common.Disk;
using Moq;
using NzbDrone.Test.Common;
using System.IO;
namespace NzbDrone.Core.Test.DecisionEngineTests.RssSync
{
[TestFixture]
public class DeletedEpisodeFileSpecificationFixture : CoreTest<DeletedEpisodeFileSpecification>
{
private RemoteEpisode _parseResultMulti;
private RemoteEpisode _parseResultSingle;
private EpisodeFile _firstFile;
private EpisodeFile _secondFile;
[SetUp]
public void Setup()
{
_firstFile = new EpisodeFile
{
Id = 1,
RelativePath = "My.Series.S01E01.mkv",
Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 1)),
DateAdded = DateTime.Now
};
_secondFile = new EpisodeFile
{
Id = 2,
RelativePath = "My.Series.S01E02.mkv",
Quality = new QualityModel(Quality.Bluray1080p, new Revision(version: 1)),
DateAdded = DateTime.Now
};
var singleEpisodeList = new List<Episode> { new Episode { EpisodeFile = _firstFile, EpisodeFileId = 1 } };
var doubleEpisodeList = new List<Episode> {
new Episode { EpisodeFile = _firstFile, EpisodeFileId = 1 },
new Episode { EpisodeFile = _secondFile, EpisodeFileId = 2 }
};
var fakeSeries = Builder<Series>.CreateNew()
.With(c => c.Profile = new Profile { Cutoff = Quality.Bluray1080p })
.With(c => c.Path = @"C:\Series\My.Series".AsOsAgnostic())
.Build();
_parseResultMulti = new RemoteEpisode
{
Series = fakeSeries,
ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)) },
Episodes = doubleEpisodeList
};
_parseResultSingle = new RemoteEpisode
{
Series = fakeSeries,
ParsedEpisodeInfo = new ParsedEpisodeInfo { Quality = new QualityModel(Quality.DVD, new Revision(version: 2)) },
Episodes = singleEpisodeList
};
GivenUnmonitorDeletedEpisodes(true);
}
private void GivenUnmonitorDeletedEpisodes(bool enabled)
{
Mocker.GetMock<IConfigService>()
.SetupGet(v => v.AutoUnmonitorPreviouslyDownloadedEpisodes)
.Returns(enabled);
}
private void WithExistingFile(EpisodeFile episodeFile)
{
var path = Path.Combine(@"C:\Series\My.Series".AsOsAgnostic(), episodeFile.RelativePath);
Mocker.GetMock<IDiskProvider>()
.Setup(v => v.FileExists(path))
.Returns(true);
}
[Test]
public void should_return_true_when_unmonitor_deleted_episdes_is_off()
{
GivenUnmonitorDeletedEpisodes(false);
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_true_when_searching()
{
Subject.IsSatisfiedBy(_parseResultSingle, new SeasonSearchCriteria()).Accepted.Should().BeTrue();
}
[Test]
public void should_return_true_if_file_exists()
{
WithExistingFile(_firstFile);
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_file_is_missing()
{
Subject.IsSatisfiedBy(_parseResultSingle, null).Accepted.Should().BeFalse();
}
[Test]
public void should_return_true_if_both_of_multiple_episode_exist()
{
WithExistingFile(_firstFile);
WithExistingFile(_secondFile);
Subject.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeTrue();
}
[Test]
public void should_return_false_if_one_of_multiple_episode_is_missing()
{
WithExistingFile(_firstFile);
Subject.IsSatisfiedBy(_parseResultMulti, null).Accepted.Should().BeFalse();
}
}
}

View File

@@ -99,6 +99,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
var result = Subject.GetItems().Single();
VerifyCompleted(result);
result.CanBeRemoved.Should().BeFalse();
result.CanMoveFiles.Should().BeFalse();
}
[Test]

View File

@@ -77,6 +77,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.Blackhole
var result = Subject.GetItems().Single();
VerifyCompleted(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]

View File

@@ -19,6 +19,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
protected DelugeTorrent _downloading;
protected DelugeTorrent _failed;
protected DelugeTorrent _completed;
protected DelugeTorrent _seeding;
[SetUp]
public void Setup()
@@ -75,7 +76,11 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
Size = 1000,
BytesDownloaded = 1000,
Progress = 100.0,
DownloadPath = "somepath"
DownloadPath = "somepath",
IsAutoManaged = true,
StopAtRatio = true,
StopRatio = 1.0,
Ratio = 1.5
};
Mocker.GetMock<ITorrentFileInfoReader>()
@@ -114,7 +119,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
.Returns("CBC2F069FE8BB2F544EAE707D75BCD3DE9DCF951".ToLower())
.Callback(PrepareClientToReturnQueuedItem);
}
protected virtual void GivenTorrents(List<DelugeTorrent> torrents)
{
if (torrents == null)
@@ -129,7 +134,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
protected void PrepareClientToReturnQueuedItem()
{
GivenTorrents(new List<DelugeTorrent>
GivenTorrents(new List<DelugeTorrent>
{
_queued
});
@@ -137,7 +142,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
protected void PrepareClientToReturnDownloadingItem()
{
GivenTorrents(new List<DelugeTorrent>
GivenTorrents(new List<DelugeTorrent>
{
_downloading
});
@@ -145,7 +150,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
protected void PrepareClientToReturnFailedItem()
{
GivenTorrents(new List<DelugeTorrent>
GivenTorrents(new List<DelugeTorrent>
{
_failed
});
@@ -189,6 +194,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
PrepareClientToReturnCompletedItem();
var item = Subject.GetItems().Single();
VerifyCompleted(item);
item.CanBeRemoved.Should().BeTrue();
item.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -248,11 +256,11 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
item.Status.Should().Be(expectedItemStatus);
}
[TestCase(DelugeTorrentStatus.Paused, DownloadItemStatus.Completed, true)]
[TestCase(DelugeTorrentStatus.Checking, DownloadItemStatus.Downloading, true)]
[TestCase(DelugeTorrentStatus.Queued, DownloadItemStatus.Completed, true)]
[TestCase(DelugeTorrentStatus.Seeding, DownloadItemStatus.Completed, true)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(string apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly)
[TestCase(DelugeTorrentStatus.Paused, DownloadItemStatus.Completed)]
[TestCase(DelugeTorrentStatus.Checking, DownloadItemStatus.Downloading)]
[TestCase(DelugeTorrentStatus.Queued, DownloadItemStatus.Completed)]
[TestCase(DelugeTorrentStatus.Seeding, DownloadItemStatus.Completed)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(string apiStatus, DownloadItemStatus expectedItemStatus)
{
_completed.State = apiStatus;
@@ -261,24 +269,25 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DelugeTests
var item = Subject.GetItems().Single();
item.Status.Should().Be(expectedItemStatus);
item.IsReadOnly.Should().Be(expectedReadOnly);
}
[Test]
public void GetItems_should_check_share_ratio_for_readonly()
[TestCase(0.5, false)]
[TestCase(1.01, true)]
public void GetItems_should_check_share_ratio_for_moveFiles_and_remove(double ratio, bool canBeRemoved)
{
_completed.State = DelugeTorrentStatus.Paused;
_completed.IsAutoManaged = true;
_completed.StopAtRatio = true;
_completed.StopRatio = 1.0;
_completed.Ratio = 1.01;
_completed.Ratio = ratio;
PrepareClientToReturnCompletedItem();
var item = Subject.GetItems().Single();
item.Status.Should().Be(DownloadItemStatus.Completed);
item.IsReadOnly.Should().BeFalse();
item.CanMoveFiles.Should().Be(canBeRemoved);
item.CanBeRemoved.Should().Be(canBeRemoved);
}
[Test]

View File

@@ -275,7 +275,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
{ "default_destination", _defaultDestination },
};
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationInfoProxy>()
.Setup(v => v.GetConfig(It.IsAny<DownloadStationSettings>()))
.Returns(_downloadStationConfigItems);
}
@@ -311,7 +311,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
torrents = new List<DownloadStationTask>();
}
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(s => s.GetTasks(It.IsAny<DownloadStationSettings>()))
.Returns(torrents);
}
@@ -330,11 +330,11 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
.Setup(s => s.Get(It.IsAny<HttpRequest>()))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), new byte[1000]));
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(s => s.AddTaskFromUrl(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<DownloadStationSettings>()))
.Callback(PrepareClientToReturnQueuedItem);
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(s => s.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<DownloadStationSettings>()))
.Callback(PrepareClientToReturnQueuedItem);
}
@@ -352,7 +352,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
{
var tasks = new List<DownloadStationTask>() { _queued, _completed, _failed, _downloading, _seeding };
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(d => d.GetTasks(_settings))
.Returns(tasks);
@@ -372,7 +372,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), _tvDirectory, It.IsAny<DownloadStationSettings>()), Times.Once());
}
@@ -389,7 +389,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), $"{_defaultDestination}/{_category}", It.IsAny<DownloadStationSettings>()), Times.Once());
}
@@ -405,7 +405,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), null, It.IsAny<DownloadStationSettings>()), Times.Once());
}
@@ -482,7 +482,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
Assert.Throws(Is.InstanceOf<Exception>(), () => Subject.Download(remoteEpisode));
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), null, _settings), Times.Never());
}
@@ -576,11 +576,11 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
items.Should().OnlyContain(v => !v.OutputPath.IsEmpty);
}
[TestCase(DownloadStationTaskStatus.Downloading, DownloadItemStatus.Downloading, true)]
[TestCase(DownloadStationTaskStatus.Finished, DownloadItemStatus.Completed, false)]
[TestCase(DownloadStationTaskStatus.Seeding, DownloadItemStatus.Completed, true)]
[TestCase(DownloadStationTaskStatus.Waiting, DownloadItemStatus.Queued, true)]
public void GetItems_should_return_readonly_expected(DownloadStationTaskStatus apiStatus, DownloadItemStatus expectedItemStatus, bool readOnlyExpected)
[TestCase(DownloadStationTaskStatus.Downloading, false, false)]
[TestCase(DownloadStationTaskStatus.Finished, true, true)]
[TestCase(DownloadStationTaskStatus.Seeding, true, false)]
[TestCase(DownloadStationTaskStatus.Waiting, false, false)]
public void GetItems_should_return_canBeMoved_and_canBeDeleted_as_expected(DownloadStationTaskStatus apiStatus, bool canMoveFilesExpected, bool canBeRemovedExpected)
{
GivenSerialNumber();
GivenSharedFolder();
@@ -592,7 +592,11 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
var items = Subject.GetItems();
items.Should().HaveCount(1);
items.First().IsReadOnly.Should().Be(readOnlyExpected);
var item = items.First();
item.CanBeRemoved.Should().Be(canBeRemovedExpected);
item.CanMoveFiles.Should().Be(canMoveFilesExpected);
}
[TestCase(DownloadStationTaskStatus.Downloading, DownloadItemStatus.Downloading)]

View File

@@ -177,7 +177,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
{ "default_destination", _defaultDestination },
};
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationInfoProxy>()
.Setup(v => v.GetConfig(It.IsAny<DownloadStationSettings>()))
.Returns(_downloadStationConfigItems);
}
@@ -213,7 +213,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
nzbs = new List<DownloadStationTask>();
}
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(s => s.GetTasks(It.IsAny<DownloadStationSettings>()))
.Returns(nzbs);
}
@@ -233,7 +233,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), new byte[1000]));
*/
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(s => s.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<string>(), It.IsAny<DownloadStationSettings>()))
.Callback(PrepareClientToReturnQueuedItem);
}
@@ -242,7 +242,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
{
var tasks = new List<DownloadStationTask>() { _queued, _completed, _failed, _downloading, _seeding };
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Setup(d => d.GetTasks(_settings))
.Returns(tasks);
}
@@ -260,7 +260,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), _tvDirectory, It.IsAny<DownloadStationSettings>()), Times.Once());
}
@@ -277,7 +277,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), $"{_defaultDestination}/{_category}", It.IsAny<DownloadStationSettings>()), Times.Once());
}
@@ -293,7 +293,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
id.Should().NotBeNullOrEmpty();
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromData(It.IsAny<byte[]>(), It.IsAny<string>(), null, It.IsAny<DownloadStationSettings>()), Times.Once());
}
@@ -370,7 +370,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
Assert.Throws(Is.InstanceOf<Exception>(), () => Subject.Download(remoteEpisode));
Mocker.GetMock<IDownloadStationProxy>()
Mocker.GetMock<IDownloadStationTaskProxy>()
.Verify(v => v.AddTaskFromUrl(It.IsAny<string>(), null, _settings), Times.Never());
}
@@ -408,24 +408,6 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.DownloadStationTests
items.Should().OnlyContain(v => !v.OutputPath.IsEmpty);
}
[TestCase(DownloadStationTaskStatus.Downloading, DownloadItemStatus.Downloading, true)]
[TestCase(DownloadStationTaskStatus.Finished, DownloadItemStatus.Completed, false)]
[TestCase(DownloadStationTaskStatus.Waiting, DownloadItemStatus.Queued, true)]
public void GetItems_should_return_readonly_expected(DownloadStationTaskStatus apiStatus, DownloadItemStatus expectedItemStatus, bool readOnlyExpected)
{
GivenSerialNumber();
GivenSharedFolder();
_queued.Status = apiStatus;
GivenTasks(new List<DownloadStationTask>() { _queued });
var items = Subject.GetItems();
items.Should().HaveCount(1);
items.First().IsReadOnly.Should().Be(readOnlyExpected);
}
[TestCase(DownloadStationTaskStatus.Downloading, DownloadItemStatus.Downloading)]
[TestCase(DownloadStationTaskStatus.Error, DownloadItemStatus.Failed)]
[TestCase(DownloadStationTaskStatus.Extracting, DownloadItemStatus.Downloading)]

View File

@@ -190,6 +190,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
PrepareClientToReturnCompletedItem();
var item = Subject.GetItems().Single();
VerifyCompleted(item);
item.CanBeRemoved.Should().BeTrue();
item.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -298,7 +301,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.HadoukenTests
.Returns("hash");
var result = Subject.Download(remoteEpisode);
Assert.IsFalse(result.Any(c => char.IsLower(c)));
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using FluentAssertions;
@@ -103,10 +103,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
public void queued_item_should_have_required_properties()
{
GivenQueue(_queued);
var result = Subject.GetItems().Single();
VerifyQueued(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -118,6 +121,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
var result = Subject.GetItems().Single();
VerifyPaused(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -129,6 +135,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
var result = Subject.GetItems().Single();
VerifyDownloading(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -139,6 +148,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
var result = Subject.GetItems().Single();
VerifyCompleted(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -149,6 +161,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbVortexTests
var result = Subject.GetItems().Single();
VerifyFailed(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using FluentAssertions;
@@ -163,10 +163,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
GivenQueue(_queued);
GivenHistory(null);
var result = Subject.GetItems().Single();
VerifyQueued(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -180,6 +183,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
var result = Subject.GetItems().Single();
VerifyPaused(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -193,6 +199,25 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
var result = Subject.GetItems().Single();
VerifyDownloading(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
public void post_processing_item_should_have_required_properties()
{
_queued.ActiveDownloads = 1;
GivenQueue(_queued);
GivenHistory(null);
_queued.RemainingSizeLo = 0;
var result = Subject.GetItems().Single();
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -204,6 +229,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.NzbgetTests
var result = Subject.GetItems().Single();
VerifyCompleted(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]

View File

@@ -89,6 +89,12 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
});
}
protected void GivenHighPriority()
{
Subject.Definition.Settings.As<QBittorrentSettings>().OlderTvPriority = (int)QBittorrentPriority.First;
Subject.Definition.Settings.As<QBittorrentSettings>().RecentTvPriority = (int)QBittorrentPriority.First;
}
protected void GivenMaxRatio(float maxRatio, bool removeOnMaxRatio = true)
{
Mocker.GetMock<IQBittorrentProxy>()
@@ -265,6 +271,39 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
id.Should().Be(expectedHash);
}
[Test]
public void Download_should_set_top_priority()
{
GivenHighPriority();
GivenSuccessfulDownload();
var remoteEpisode = CreateRemoteEpisode();
var id = Subject.Download(remoteEpisode);
Mocker.GetMock<IQBittorrentProxy>()
.Verify(v => v.MoveTorrentToTopInQueue(It.IsAny<string>(), It.IsAny<QBittorrentSettings>()), Times.Once());
}
[Test]
public void Download_should_not_fail_if_top_priority_not_available()
{
GivenHighPriority();
GivenSuccessfulDownload();
Mocker.GetMock<IQBittorrentProxy>()
.Setup(v => v.MoveTorrentToTopInQueue(It.IsAny<string>(), It.IsAny<QBittorrentSettings>()))
.Throws(new HttpException(new HttpResponse(new HttpRequest("http://me.local/"), new HttpHeader(), new byte[0], System.Net.HttpStatusCode.Forbidden)));
var remoteEpisode = CreateRemoteEpisode();
var id = Subject.Download(remoteEpisode);
id.Should().NotBeNullOrEmpty();
ExceptionVerification.ExpectedWarns(1);
}
[Test]
public void should_return_status_with_outputdirs()
{
@@ -311,7 +350,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
}
[Test]
public void should_be_read_only_if_max_ratio_not_reached()
public void should_not_be_removable_and_should_not_allow_move_files_if_max_ratio_not_reached()
{
GivenMaxRatio(1.0f);
@@ -330,11 +369,12 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
GivenTorrents(new List<QBittorrentTorrent> { torrent });
var item = Subject.GetItems().Single();
item.IsReadOnly.Should().BeTrue();
item.CanBeRemoved.Should().BeFalse();
item.CanMoveFiles.Should().BeFalse();
}
[Test]
public void should_be_read_only_if_max_ratio_reached_and_not_paused()
public void should_not_be_removable_and_should_not_allow_move_files_if_max_ratio_reached_and_not_paused()
{
GivenMaxRatio(1.0f);
@@ -353,11 +393,12 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
GivenTorrents(new List<QBittorrentTorrent> { torrent });
var item = Subject.GetItems().Single();
item.IsReadOnly.Should().BeTrue();
item.CanBeRemoved.Should().BeFalse();
item.CanMoveFiles.Should().BeFalse();
}
[Test]
public void should_be_read_only_if_max_ratio_is_not_set()
public void should_not_be_removable_and_should_not_allow_move_files_if_max_ratio_is_not_set()
{
GivenMaxRatio(1.0f, false);
@@ -376,11 +417,12 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
GivenTorrents(new List<QBittorrentTorrent> { torrent });
var item = Subject.GetItems().Single();
item.IsReadOnly.Should().BeTrue();
item.CanBeRemoved.Should().BeFalse();
item.CanMoveFiles.Should().BeFalse();
}
[Test]
public void should_not_be_read_only_if_max_ratio_reached_and_paused()
public void should_be_removable_and_should_allow_move_files_if_max_ratio_reached_and_paused()
{
GivenMaxRatio(1.0f);
@@ -399,7 +441,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.QBittorrentTests
GivenTorrents(new List<QBittorrentTorrent> { torrent });
var item = Subject.GetItems().Single();
item.IsReadOnly.Should().BeFalse();
item.CanBeRemoved.Should().BeTrue();
item.CanMoveFiles.Should().BeTrue();
}
[Test]

View File

@@ -54,11 +54,11 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.RTorrentTests
protected void GivenSuccessfulDownload()
{
Mocker.GetMock<IRTorrentProxy>()
.Setup(s => s.AddTorrentFromUrl(It.IsAny<string>(), It.IsAny<RTorrentSettings>()))
.Setup(s => s.AddTorrentFromUrl(It.IsAny<string>(), It.IsAny<string>(), It.IsAny<RTorrentPriority>(), It.IsAny<string>(), It.IsAny<RTorrentSettings>()))
.Callback(PrepareClientToReturnCompletedItem);
Mocker.GetMock<IRTorrentProxy>()
.Setup(s => s.AddTorrentFromFile(It.IsAny<string>(), It.IsAny<byte[]>(), It.IsAny<RTorrentSettings>()))
.Setup(s => s.AddTorrentFromFile(It.IsAny<string>(), It.IsAny<byte[]>(), It.IsAny<string>(), It.IsAny<RTorrentPriority>(), It.IsAny<string>(), It.IsAny<RTorrentSettings>()))
.Callback(PrepareClientToReturnCompletedItem);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Collections.Generic;
using FizzWare.NBuilder;
@@ -23,6 +23,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
private SabnzbdHistory _failed;
private SabnzbdHistory _completed;
private SabnzbdConfig _config;
private SabnzbdFullStatus _fullStatus;
[SetUp]
public void Setup()
@@ -65,7 +66,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
Status = SabnzbdDownloadStatus.Failed,
Size = 1000,
Category = "tv",
Category = "tv",
Id = "sabnzbd_nzb12345",
Title = "Droned.S01E01.Pilot.1080p.WEB-DL-DRONE"
}
@@ -80,7 +81,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
{
Status = SabnzbdDownloadStatus.Completed,
Size = 1000,
Category = "tv",
Category = "tv",
Id = "sabnzbd_nzb12345",
Title = "Droned.S01E01.Pilot.1080p.WEB-DL-DRONE",
Storage = "/remote/mount/vv/Droned.S01E01.Pilot.1080p.WEB-DL-DRONE"
@@ -100,9 +101,29 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
}
};
Mocker.GetMock<ISabnzbdProxy>()
.Setup(v => v.GetVersion(It.IsAny<SabnzbdSettings>()))
.Returns("1.2.3");
Mocker.GetMock<ISabnzbdProxy>()
.Setup(s => s.GetConfig(It.IsAny<SabnzbdSettings>()))
.Returns(_config);
_fullStatus = new SabnzbdFullStatus
{
CompleteDir = @"Y:\nzbget\root\complete".AsOsAgnostic()
};
Mocker.GetMock<ISabnzbdProxy>()
.Setup(s => s.GetFullStatus(It.IsAny<SabnzbdSettings>()))
.Returns(_fullStatus);
}
protected void GivenVersion(string version)
{
Mocker.GetMock<ISabnzbdProxy>()
.Setup(s => s.GetVersion(It.IsAny<SabnzbdSettings>()))
.Returns(version);
}
protected void GivenFailedDownload()
@@ -166,11 +187,14 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
GivenQueue(_queued);
GivenHistory(null);
var result = Subject.GetItems().Single();
VerifyQueued(result);
result.RemainingTime.Should().NotBe(TimeSpan.Zero);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[TestCase(SabnzbdDownloadStatus.Paused)]
@@ -184,6 +208,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
var result = Subject.GetItems().Single();
VerifyPaused(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[TestCase(SabnzbdDownloadStatus.Checking)]
@@ -206,7 +233,10 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
var result = Subject.GetItems().Single();
VerifyDownloading(result);
result.RemainingTime.Should().NotBe(TimeSpan.Zero);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -218,6 +248,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
var result = Subject.GetItems().Single();
VerifyCompleted(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -231,6 +264,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
var result = Subject.GetItems().Single();
VerifyFailed(result);
result.CanBeRemoved.Should().BeTrue();
result.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -386,23 +422,46 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
result.OutputPath.Should().Be(@"C:\sorted\somewhere\asdfasdf\asdfasdf.mkv".AsOsAgnostic());
}
[TestCase(@"Y:\nzbget\root", @"completed\downloads", @"vv", @"Y:\nzbget\root\completed\downloads\vv")]
[TestCase(@"Y:\nzbget\root", @"completed", @"vv", @"Y:\nzbget\root\completed\vv")]
[TestCase(@"/nzbget/root", @"completed/downloads", @"vv", @"/nzbget/root/completed/downloads/vv")]
[TestCase(@"/nzbget/root", @"completed", @"vv", @"/nzbget/root/completed/vv")]
public void should_return_status_with_outputdir(string rootFolder, string completeDir, string categoryDir, string expectedDir)
[TestCase(@"Y:\nzbget\root", @"completed\downloads", @"vv", @"Y:\nzbget\root\completed\downloads", @"Y:\nzbget\root\completed\downloads\vv")]
[TestCase(@"Y:\nzbget\root", @"completed", @"vv", @"Y:\nzbget\root\completed", @"Y:\nzbget\root\completed\vv")]
[TestCase(@"/nzbget/root", @"completed/downloads", @"vv", @"/nzbget/root/completed/downloads", @"/nzbget/root/completed/downloads/vv")]
[TestCase(@"/nzbget/root", @"completed", @"vv", @"/nzbget/root/completed", @"/nzbget/root/completed/vv")]
public void should_return_status_with_outputdir_for_version_lt_2(string rootFolder, string completeDir, string categoryDir, string fullCompleteDir, string fullCategoryDir)
{
_fullStatus.CompleteDir = null;
_queued.DefaultRootFolder = rootFolder;
_config.Misc.complete_dir = completeDir;
_config.Categories.First().Dir = categoryDir;
GivenVersion("1.2.1");
GivenQueue(null);
var result = Subject.GetStatus();
result.IsLocalhost.Should().BeTrue();
result.OutputRootFolders.Should().NotBeNull();
result.OutputRootFolders.First().Should().Be(expectedDir);
result.OutputRootFolders.First().Should().Be(fullCategoryDir);
}
[TestCase(@"Y:\nzbget\root", @"completed\downloads", @"vv", @"Y:\nzbget\root\completed\downloads", @"Y:\nzbget\root\completed\downloads\vv")]
[TestCase(@"Y:\nzbget\root", @"completed", @"vv", @"Y:\nzbget\root\completed", @"Y:\nzbget\root\completed\vv")]
[TestCase(@"/nzbget/root", @"completed/downloads", @"vv", @"/nzbget/root/completed/downloads", @"/nzbget/root/completed/downloads/vv")]
[TestCase(@"/nzbget/root", @"completed", @"vv", @"/nzbget/root/completed", @"/nzbget/root/completed/vv")]
public void should_return_status_with_outputdir_for_version_gte_2(string rootFolder, string completeDir, string categoryDir, string fullCompleteDir, string fullCategoryDir)
{
_fullStatus.CompleteDir = fullCompleteDir;
_queued.DefaultRootFolder = null;
_config.Misc.complete_dir = completeDir;
_config.Categories.First().Dir = categoryDir;
GivenVersion("2.0.0beta1");
GivenQueue(null);
var result = Subject.GetStatus();
result.IsLocalhost.Should().BeTrue();
result.OutputRootFolders.Should().NotBeNull();
result.OutputRootFolders.First().Should().Be(fullCategoryDir);
}
[Test]
@@ -450,5 +509,73 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.SabnzbdTests
result.IsValid.Should().BeTrue();
result.HasWarnings.Should().BeTrue();
}
[Test]
public void should_test_success_if_tv_sorting_disabled()
{
_config.Misc.enable_tv_sorting = false;
_config.Misc.tv_categories = null;
var result = new NzbDroneValidationResult(Subject.Test());
result.IsValid.Should().BeTrue();
}
[Test]
public void should_test_failed_if_tv_sorting_null()
{
_config.Misc.enable_tv_sorting = true;
_config.Misc.tv_categories = null;
var result = new NzbDroneValidationResult(Subject.Test());
result.IsValid.Should().BeFalse();
}
[Test]
public void should_test_failed_if_tv_sorting_empty()
{
_config.Misc.enable_tv_sorting = true;
_config.Misc.tv_categories = new string[0];
var result = new NzbDroneValidationResult(Subject.Test());
result.IsValid.Should().BeFalse();
}
[Test]
public void should_test_success_if_tv_sorting_contains_different_category()
{
_config.Misc.enable_tv_sorting = true;
_config.Misc.tv_categories = new[] { "tv-custom" };
var result = new NzbDroneValidationResult(Subject.Test());
result.IsValid.Should().BeTrue();
}
[Test]
public void should_test_failed_if_tv_sorting_contains_category()
{
_config.Misc.enable_tv_sorting = true;
_config.Misc.tv_categories = new[] { "tv" };
var result = new NzbDroneValidationResult(Subject.Test());
result.IsValid.Should().BeFalse();
}
[Test]
public void should_test_failed_if_tv_sorting_default_category()
{
Subject.Definition.Settings.As<SabnzbdSettings>().TvCategory = null;
_config.Misc.enable_tv_sorting = true;
_config.Misc.tv_categories = new[] { "Default" };
var result = new NzbDroneValidationResult(Subject.Test());
result.IsValid.Should().BeFalse();
}
}
}

View File

@@ -41,6 +41,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
PrepareClientToReturnCompletedItem();
var item = Subject.GetItems().Single();
VerifyCompleted(item);
item.CanBeRemoved.Should().BeTrue();
item.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -145,8 +148,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
[TestCase(TransmissionTorrentStatus.Check, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Queued)]
[TestCase(TransmissionTorrentStatus.Downloading, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Downloading)]
public void GetItems_should_return_queued_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus)
{
_queued.Status = apiStatus;
@@ -160,7 +163,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Queued)]
[TestCase(TransmissionTorrentStatus.Downloading, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Downloading)]
public void GetItems_should_return_downloading_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus)
{
_downloading.Status = apiStatus;
@@ -172,13 +175,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
item.Status.Should().Be(expectedItemStatus);
}
[TestCase(TransmissionTorrentStatus.Stopped, DownloadItemStatus.Completed, false)]
[TestCase(TransmissionTorrentStatus.CheckWait, DownloadItemStatus.Downloading, true)]
[TestCase(TransmissionTorrentStatus.Check, DownloadItemStatus.Downloading, true)]
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Completed, true)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed, true)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed, true)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly)
[TestCase(TransmissionTorrentStatus.Stopped, DownloadItemStatus.Completed, true)]
[TestCase(TransmissionTorrentStatus.CheckWait, DownloadItemStatus.Downloading, false)]
[TestCase(TransmissionTorrentStatus.Check, DownloadItemStatus.Downloading, false)]
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Completed, false)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed, false)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed, false)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedValue)
{
_completed.Status = apiStatus;
@@ -187,7 +190,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.TransmissionTests
var item = Subject.GetItems().Single();
item.Status.Should().Be(expectedItemStatus);
item.IsReadOnly.Should().Be(expectedReadOnly);
item.CanBeRemoved.Should().Be(expectedValue);
item.CanMoveFiles.Should().Be(expectedValue);
}
[Test]

View File

@@ -222,6 +222,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
PrepareClientToReturnCompletedItem();
var item = Subject.GetItems().Single();
VerifyCompleted(item);
item.CanBeRemoved.Should().BeTrue();
item.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -292,12 +295,12 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
item.Status.Should().Be(expectedItemStatus);
}
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checking, DownloadItemStatus.Queued, false)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked, DownloadItemStatus.Completed, false)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Queued, DownloadItemStatus.Completed, true)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Started, DownloadItemStatus.Completed, true)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Queued | UTorrentTorrentStatus.Paused, DownloadItemStatus.Completed, true)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(UTorrentTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly)
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checking, DownloadItemStatus.Queued, true)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked, DownloadItemStatus.Completed, true)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Queued, DownloadItemStatus.Completed, false)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Started, DownloadItemStatus.Completed, false)]
[TestCase(UTorrentTorrentStatus.Loaded | UTorrentTorrentStatus.Checked | UTorrentTorrentStatus.Queued | UTorrentTorrentStatus.Paused, DownloadItemStatus.Completed, false)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(UTorrentTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedValue)
{
_completed.Status = apiStatus;
@@ -306,7 +309,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.UTorrentTests
var item = Subject.GetItems().Single();
item.Status.Should().Be(expectedItemStatus);
item.IsReadOnly.Should().Be(expectedReadOnly);
item.CanBeRemoved.Should().Be(expectedValue);
item.CanMoveFiles.Should().Be(expectedValue);
}
[Test]

View File

@@ -13,6 +13,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
[TestFixture]
public class VuzeFixture : TransmissionFixtureBase<Vuze>
{
[SetUp]
public void Setup_Vuze()
{
// Vuze never sets isFinished.
_completed.IsFinished = false;
}
[Test]
public void queued_item_should_have_required_properties()
{
@@ -43,6 +50,9 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
PrepareClientToReturnCompletedItem();
var item = Subject.GetItems().Single();
VerifyCompleted(item);
item.CanBeRemoved.Should().BeTrue();
item.CanMoveFiles.Should().BeTrue();
}
[Test]
@@ -147,8 +157,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
[TestCase(TransmissionTorrentStatus.Check, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Queued)]
[TestCase(TransmissionTorrentStatus.Downloading, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Downloading)]
public void GetItems_should_return_queued_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus)
{
_queued.Status = apiStatus;
@@ -162,7 +172,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Queued)]
[TestCase(TransmissionTorrentStatus.Downloading, DownloadItemStatus.Downloading)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Downloading)]
public void GetItems_should_return_downloading_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus)
{
_downloading.Status = apiStatus;
@@ -174,13 +184,13 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
item.Status.Should().Be(expectedItemStatus);
}
[TestCase(TransmissionTorrentStatus.Stopped, DownloadItemStatus.Completed, false)]
[TestCase(TransmissionTorrentStatus.CheckWait, DownloadItemStatus.Downloading, true)]
[TestCase(TransmissionTorrentStatus.Check, DownloadItemStatus.Downloading, true)]
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Completed, true)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed, true)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed, true)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedReadOnly)
[TestCase(TransmissionTorrentStatus.Stopped, DownloadItemStatus.Completed, true)]
[TestCase(TransmissionTorrentStatus.CheckWait, DownloadItemStatus.Downloading, false)]
[TestCase(TransmissionTorrentStatus.Check, DownloadItemStatus.Downloading, false)]
[TestCase(TransmissionTorrentStatus.Queued, DownloadItemStatus.Queued, false)]
[TestCase(TransmissionTorrentStatus.SeedingWait, DownloadItemStatus.Completed, false)]
[TestCase(TransmissionTorrentStatus.Seeding, DownloadItemStatus.Completed, false)]
public void GetItems_should_return_completed_item_as_downloadItemStatus(TransmissionTorrentStatus apiStatus, DownloadItemStatus expectedItemStatus, bool expectedValue)
{
_completed.Status = apiStatus;
@@ -189,7 +199,8 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
var item = Subject.GetItems().Single();
item.Status.Should().Be(expectedItemStatus);
item.IsReadOnly.Should().Be(expectedReadOnly);
item.CanBeRemoved.Should().Be(expectedValue);
item.CanMoveFiles.Should().Be(expectedValue);
}
[Test]
@@ -294,7 +305,7 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
}
[Test]
public void should_have_correct_output_directory()
public void should_have_correct_output_directory_for_multifile_torrents()
{
WindowsOnly();
@@ -311,5 +322,25 @@ namespace NzbDrone.Core.Test.Download.DownloadClientTests.VuzeTests
items.First().OutputPath.Should().Be(@"C:\Downloads\" + _title);
}
[Test]
public void should_have_correct_output_directory_for_singlefile_torrents()
{
WindowsOnly();
var fileName = _title + ".mkv";
_downloading.Name = fileName;
_downloading.DownloadDir = @"C:/Downloads";
GivenTorrents(new List<TransmissionTorrent>
{
_downloading
});
var items = Subject.GetItems().ToList();
items.Should().HaveCount(1);
items.First().OutputPath.Should().Be(@"C:\Downloads\" + fileName);
}
}
}
}

View File

@@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.Download.Pending.PendingReleaseServiceTests
{
Mocker.GetMock<IIndexerStatusService>()
.Setup(v => v.GetBlockedIndexers())
.Returns(new List<IndexerStatus> { new IndexerStatus { IndexerId = 1, DisabledTill = DateTime.UtcNow.AddHours(2) } });
.Returns(new List<IndexerStatus> { new IndexerStatus { ProviderId = 1, DisabledTill = DateTime.UtcNow.AddHours(2) } });
GivenPendingRelease();

View File

@@ -0,0 +1,281 @@
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
<meta xmlns="http://pipes.yahoo.com" name="pipes" content="noprocess" />
<title>TV :: AlphaRatio</title>
<link>https://alpharatio.cc/</link>
<description>Personal RSS feed: TV</description>
<language>en-us</language>
<lastBuildDate>Tue, 29 Nov 2016 11:01:28 +0000</lastBuildDate>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<generator>Gazelle Feed Class</generator>
<item>
<title><![CDATA[TvHD 465989 465960 Good.Behavior.S01E03.PROPER.720p.HDTV.x264-KILLERS]]></title>
<description>
<![CDATA[MB <br />
@@@@: : <br />
:7 :::.7:@.:u7:.X5LF <br />
.LFq2 .B@B@B@B@B@B@B@ <br />
.. i@r rB@B@B@B@B@B@B@@@: <br />
: :B@B@B@B@: X@@@@@B@B@B@B@B@B@B@J .u@B. <br />
:.YkuB@B@B@BM. @B@B@B@B@B@@@B@B@B@r 2B@B@B@B@i <br />
@@@B@r@@@B@B: B@B@B@B@B@@@B@B@B@B@ i@B@B@B@BrO@@@@@ <br />
@@@@B@B@BB, r:@B@B@@@B@@@B@q@@@BM @L:B.B, @@B@B@B@BO@@@@B@B@B <br />
jB@B@B@B@N. 7 B@@@@@B@B@O 8B@. @F B@B@B@@@O@B@B@B@@@@@B. <br />
i@B@B@B@: 7 @B@B@B@B@ B: B: i@B@B@B@BNB8B7 .B@@ <br />
@B@B@. 1G @B@B@B@ @ , @B@:i @u @: 0EB@ <br />
;ir , U@B@B .@ B@B L B@B <br />
7 B@B@ q@Bv:@BP @B@ <br />
i@Bu @ ,S@ @@ B@@@B@B@. BkU@B@ 5Ui @Y@B <br />
@@B@v B :@iB B@@@B@B@M@ @B@@@B@BB @@7i iU 5i2vB@k B@ <br />
@B@B@B7 i @ @B@B@B@B@B@B5 i@B@@@B@ r @ <br />
@B@B@B@. @ B@B@B@B@B@B@B@. MB @Bu . U @Bi <br />
k@P @@@OBi .@ @B@B@B@B@B@B@B. @MBB@@ @F @ 7B@B <br />
@B @B@@@B@ 0B@B@B@B@B@B@B@B@ B@B@B@B@F B@B@B. B@B <br />
B @B@B@B B: B@B@B@B@@@B@@@BM B@B@B@B@B@: @B@;:B@@@: F@B <br />
@. B@@@B@ @Bu i. MX J B@B@B@ @B. @B@B@B@@ B@B@F Si k@@ B@BN <br />
@@ @B@B@B@B@B B @B@BOr: .i0F7@B: B@B@ E@ @B@B@r@ B@B@B. @B@B@B5 <br />
B@B@B@@@B@B@B: @B@B@B@Z: B@B@B@B@B@B@@@B, L@ @B@ B@B@B@B@B@B@B, <br />
:@B@B@B@B@B@B@: Y@B@@@@@B@B@B@: 7B@@@0 :@ L@ ,@B@B@B@B@B@B@B@. <br />
JB@B@B@B@B@B@B@ U@B@@J, @U.@@B@B@B B@F i@ PB @B@B@B@B@BG.@B@B@B, <br />
r@B@B@B@B@B@B@B ; @B@B@ :. @ @J r@ G@ @@: .Z@@7 B@@@@@B@B@B@F <br />
,B@B@B@B@B@B@B@B5 @B@@@ j@B5E@BXB@BvO rB OB B@ B@@@r B@B@B@B@B@B@B@B. <br />
@B@B@B@B@B@@@B@i @@ .uO0 :v. @ @B@B @@@ L: ,@ .@ Z@ iB B@B @B@B@@@BNB@ :2@B@B@B@@@B@B <br />
:@@B@B@B@B@@@B@B..@@@B@B@@. :YY B@@@: B, B .: u@ .@B@B r@ OB i@B@B@@@B@B <br />
UB@B@B@B@B@@@B@B@B@B@B LJ, @B@B. @. @ Y @BP .rUB@B@B@B@Z7, B@B@B@B@B@ <br />
,@B@@@B@B@B@B@B@@@ i17. @B@B@v O, B 1B@B@B@B@@@B@@@B@B@B@B@B@B@B@BiB@Bv<br />
:B@B@B@B@B@B@B@2@B B@B@B@ k. .@ M@@BOB@B@B@B@B@B@B@B@B@B@B@B@B@P @@B<br />
i@B@B@@@B@B@B@B M@B .7 @B@B@r B. 7B @ YB@B@B@B@B@B@B@B@B@B@B@B@B@B@B@B@B@@@<br />
u@@B@B@B@@@B@B@ B@B@ 2U8. 5B@@E @, r@ M B@B@B@B@B@B@B@B@B@@@B@B@B@B@@@B@@@@@B<br />
q@B@B@B@@@B@B@B. @@@i2 @JX :@B@ BY rB @ G@@B@B@B@B@B@B@B@B@B@B@B@B@B@B@B@B@B@<br />
BB@B@B@B@B@B@Bi . B@@: @B @ @B@B@B@B@B@B@B@B@B@B@B@@@@@B@B@B@j<br />
O@B@B@B@B@B@B@@@ u@B@@ Bu B @@B@B@B@BB8 0B@B@B <br />
SB@B@B@B@B@B@B@B@B @@B@@@B @ .BS r @@@B@ <br />
.@B@B@B@B@B@B@B@B@ B@B@@@B@Br XB@Br 7B u .vB B: B@B@B@B <br />
@@@@B@B@B@B@B@B@B@B@B .@B@B@B@B@@M i..@. i i i P @,jB @@B <br />
@B@B@B@B@B@B@B@B@B@B@B@i @N@@@B@@@B@B@B @ B@E <br />
@B@B@B@@@B@B@B@B@B@B@B@B @ : @@B@B@@@Mi B . @@ <br />
F@B@@@B@B@B@B@B@@@B@B@B@,@ M @.:v X i B :BM <br />
i@B@B@B@B@@@B@B@B@@@@@B@B L ,r , ; B@. @B@, <br />
,M@B@B @B@B@B@B@@@B@B@B@ rL B j :jr@B@@r @B@B@B <br />
@B@B@B@B@B@B@B@B .: . .@ : , @@@@B@@ <br />
,@B@B@B@B@B@B@B .@X r5BMB: r ,, 7 B B@B @B@B@B@@ <br />
L@@B@B@B@ 8B@B@ BM:@B@B@B@B@B@@8X80Mu: FB@B@B@B@B@@@B@B@@@B@B q uO@GMFLv@B@B@B@B@ B@Bu <br />
@B@B@B@B k@ MYM@@@B@B@F ,. :5@B@B7 Y@B@@@@@B@@@B@@@@@B@@@@@B@ B : B@B@B@ @@B@BL <br />
B@@@@@@@ @@7 @EvB@BF B@B@B@@@@@B@BMB@B@B@B@@@B@B@B@ 7 . .@u, i@ B@B@77B@ <br />
B@B@B@@@O@ : 7., :@B@@@B@B@B@, .LB@@@B@B@B@B@B@B@ @ r@: @::M @@B@B@M@B@ <br />
:i @B@B@@@Bi5 :: v@B@@@B@B@B B@@@B@@@B@@@B@@ B@@@B@B@B@B@B@B@i<br />
: B@B@B@B@B@ @B@B@B@@@B LB@B@@@B@B@B@B@B@@5 @B@B@B@B@B@@@B@ <br />
.k@B@B@B@B@B@u. B@B@B@B@B2 @B@B@B@B@B@@@B@B@@@B@@@B@B@B@B@B@B@ <br />
:Lur:F@@@B@B@B@B@@@B B@B@B@B@B@ @@@B@B@B@B@B@@@B@B@B@B@B@B@B@B@B@J <br />
.vBMi :,,rB@B@B@B@BO @@@B@B@@@5 :i@@@B@B@B@@@B@B@B@B@@@B@@@B@B@B@@: <br />
1r @B@B@B@B@B@ LB@B@B@B@Bq N@Bi rB@B@B@B@B@B@B@@@B@B@B@B@B@B@@@B@ <br />
,L. @@B@B@B@G Li .@B@B@B@B@B@@@B@. B@B@viv@B@B@B@B@B@B@B@B@B@B@B@@@B@B@B@ <br />
r, @@@@@B@@@B@: : B@B@B@B@B@B@@@B@ :B@ @S@B@B@B@B@B@B@@@B@B@B@@@B@B@B@ <br />
.j iB@B@B@B@B@B@Bi:; G @@BrLk . i M@B@B@@@B@@@ GB@B@B@B@B@B@B@B@B@@@B@B@B@: <br />
,: : BUB@B@B@B@@@@@N0r@B@B B@B@ : :@B@B@B@@@B @B@B@B@B@B@B@B@B@B@B@B@. B <br />
@i ui M .. @B@: B.@@B@BB:O @. B @ i B@@@@@B@ @@@B@B@B@@@B @@B@B@B@@@B @ @ <br />
E@ @7 ; .U i N@B@ B .@ @ @B@B@B@B@ v .GB @B@B@B@B@@@M: @B@B@B@B@BZ @ Y <br />
Bu .@ M 7v7 @ :B@B@@@B@BU @B@B@B@B@ BB@B@B@B@B@Bi B@@@B@B@B@v <br />
5@ @7 L S .q .N@B@@@B@BBB@B@B@B@B@B@kqqSB@B@B@B@B@ @B@B@B@B@@r <br />
q : B Z .: 2@B@B@B@..L. . M@B@B@:@BiP @B B@@@B@B@B@ <br />
; B@@@B@B. @@@B@: 2@B@B@ i @B@@@B@B@B <br />
7@B@k@B@B@B@B@B@B@B@ B@B@@@@@Bi <br />
jB@B@B@@@B@@O @B@B@B@B@ <br />
B@B@B@B@k B@@@B@@@B <br />
rPS: @B@ @B@B@ <br />
. :: ,ui:,: vL:,:: B@B B@B@B <br />
.B@B@B@B@i @B@@@B@5 @B@B :@@@@@ OB@@@ @B@ @B@@@ <br />
@B@B@ FB@B@ 7@B@B@ .@@@B @B@B iMB@B@S .GB@B@.,B@@L vG0Sqv;:@ L@@ ..E@B <br />
B@@@B@@@B@B@B .@B@@ :B@B@ B@B@ @B@B@..B@B@ @B@@@2.B@B@ @B@BBM S@1 S@. <br />
@B@B@B. ,@B@B8 B@B@ .@B@@ @B@@ B@B@8:iii;Mv i@B@M .rr B@B@B@B k@r EJ <br />
S@B@B@B@ EB@B@B@B. B@B@B@, r@B@B@1 @B@B@B: YB@@@r. 7@B@B@2 @@@@@@MB@B@ ,Bi <br />
:r, .i ,: .i: :i ,:.i. i,:: :: :J@B@X7 i. i: r :,:. ,@ a <br />
.B n <br />
[ P R E S E N T S ] @ t <br />
@ i <br />
0 / <br />
B 4 <br />
@ 0 <br />
. 4 <br />
<br />
Good.Behavior.S01E03.PROPER.720p.HDTV.x264-KILLERS<br />
<br />
<br />
Day: 2016-11-29<br />
Resolution: 1280x720<br />
Size: 1.02 GiB<br />
FrameRate: 23.976<br />
Length: 00:49:02.144<br />
Bitrate: 2 535 Kbps<br />
Note: FLEET is missing the last seg<br />
<br />
<br />
n***** We all miss you. Come back soon.]]>
</description>
<pubDate>Tue, 29 Nov 2016 10:55:58 +0000</pubDate>
<link>https://alpharatio.cc/torrents.php?action=download&amp;authkey=private_auth_key&amp;torrent_pass=private_torrent_pass&amp;id=465960</link>
<guid>https://alpharatio.cc/torrents.php?action=download&amp;authkey=private_auth_key&amp;torrent_pass=private_torrent_pass&amp;id=465960</guid>
<comments>https://alpharatio.cc/torrents.php?id=465989</comments>
<dc:creator>Anonymous</dc:creator>
</item>
<item>
<title><![CDATA[TvHD 465860 465831 WWE.RAW.2016.11.28.720p.HDTV.x264-KYR]]></title>
<description>
<![CDATA[&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&deg;&deg; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&deg; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig;&deg;&deg;&Uuml;&deg;&Ucirc;&Ucirc;&sup2;&szlig;&Uuml;&Ucirc;&Ucirc;&Uuml;&Uuml;&sup2; &Uuml;&szlig;&sup2; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &Uuml;&szlig;&deg;&sup2;&deg;&sup2;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&plusmn;&sup2;&sup2; &Uuml;&Yacute; &THORN; &THORN;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&deg; &Ucirc;&Ucirc;&Yacute;&sup2;&THORN;&sup2;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&plusmn;&sup2;&Yacute;&Yacute;&THORN;&Ucirc; &szlig; &Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&sup2;&Ucirc;&Ucirc;&deg;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Yacute;&plusmn;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc;&THORN;&sup2;&THORN; &Yacute; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig; &szlig;&szlig;&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&deg;&Ucirc;&sup2;&Ucirc;&THORN;&sup2; &Yacute;&sup2; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&deg;&deg;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Yacute;&Ucirc;&Ucirc;&szlig;&Yacute;&sup2;&deg;&THORN;&THORN; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&deg;&Ucirc;&Yacute;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&THORN;&THORN;&THORN;&Uuml;&Ucirc;&Ucirc;&deg;&sup2;&Yacute;&THORN; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&sup2;&Yacute;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&deg;&Ucirc;&sup2;&THORN;&Ucirc;&Ucirc;&Ucirc; &THORN; &sup2; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &sup2;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Yacute;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Yacute;&Ucirc; &sup2; &Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&sup2;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Yacute;&Ucirc;&THORN;&Ucirc;&Ucirc;&THORN;&sup2;&THORN; &Yacute;&Yacute; &Uuml;&Uuml;&Uuml;&Uuml; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Uuml;&Uuml; &Uuml; &THORN;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&THORN;&Ucirc;&Ucirc;&sup2;&THORN;&deg;&THORN; &sup2;&Yacute; &szlig;&szlig;&szlig;&Ucirc;&Ucirc;&Ucirc;&sup2; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &Ucirc;&Ucirc;&sup2;&sup2;&Ucirc;&Ucirc;&sup2; &THORN;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&THORN;&Ucirc;&Yacute;&Ucirc;&Ucirc;&plusmn;&THORN; &sup2; &Yacute;&THORN; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&THORN; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&plusmn; &Uuml;&Uuml; &szlig;&sup2;&Ucirc;&Ucirc;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&THORN;&Yacute;&Ucirc;&Yacute;&Ucirc;&Ucirc;&deg;&Ucirc; &sup2; &THORN; &sup2; &Uuml;&szlig;&Ucirc;&Ucirc;&Ucirc;&szlig; &THORN;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Yacute; &Ucirc;&Ucirc;&szlig; &Uuml;&Uuml;&Uuml;&szlig;&sup2; &Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&THORN;&THORN;&Ucirc;&Uuml;&sup2; &THORN; &Yacute; &Yacute; &szlig;&szlig;&szlig; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&szlig; &sup2;&szlig; &sup2;&THORN;&Yacute; &THORN;&Ucirc;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Yacute;&Ucirc;&sup2;&THORN;&Ucirc;&Yacute;&Ucirc;&Yacute; &Yacute; &Yacute; &THORN; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &THORN; &THORN;&Yacute; &THORN;&Ucirc;<br />
&plusmn;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&THORN;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Yacute;&THORN;&Ucirc; &Yacute;&THORN; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Yacute; &sup2;&Ucirc;&Uuml; &Ucirc;&Ucirc;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&deg;&Ucirc; &szlig; &THORN; &Yacute; &Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Uuml;&Ucirc;&Ucirc;&Uuml; &Yacute; &Uuml;&szlig; &szlig;&Ucirc;&Ucirc;<br />
&Ucirc;&sup2;&Ucirc;&Ucirc;&Yacute;&Yacute;&Yacute;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&sup2;&THORN; &Yacute; &sup2;&Uuml;&sup2;&Ucirc;&Ucirc; &Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&Ucirc;&szlig;&szlig;&szlig; &Uuml;&Uuml;&Uuml;&sup2;&szlig; &Ucirc;&Ucirc;<br />
&Ucirc;&Yacute;&Ucirc;&Ucirc;&THORN;&Yacute;&deg;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Yacute;&Ucirc;&sup2;&Yacute; &Yacute; &szlig;&szlig;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &deg; &szlig;&sup2;&szlig; &sup2; &THORN;&Ucirc;<br />
&Ucirc;&Ucirc;&deg;&Ucirc;&THORN;&Ucirc;&THORN;&THORN;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc;&sup2;&THORN;&Ucirc; &Yacute; &Yacute; &Uuml;&Uuml; &THORN;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&Ucirc;&Uuml;&Uuml; &plusmn;&deg;&deg; &szlig; &Ucirc;<br />
&Ucirc;&Ucirc;&Ucirc;&THORN;&Yacute;&Ucirc;&THORN;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc; &sup2;&Yacute; &THORN; &THORN;&deg;&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &plusmn;&sup2;&plusmn;&plusmn; &THORN;<br />
&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Yacute;&Ucirc;&THORN;&Ucirc;&Ucirc;&Yacute;&sup2;&THORN;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Yacute;&THORN;&Yacute; &Yacute; &sup2;&szlig; &Uuml;&szlig;&Yacute;&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Uuml; &Uuml;&Uuml;&sup2;&Ucirc;&Ucirc;&Ucirc;&sup2;&sup2; &THORN;<br />
&Ucirc;&Ucirc;&Yacute;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&deg;&Ucirc;&sup2;&THORN;&Yacute;&Ucirc;&deg;&Ucirc;&THORN; &Yacute;&Yacute; &Uuml;&Uuml;&sup2;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&sup2;&Uuml; &Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&plusmn;<br />
&Ucirc;&szlig;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&THORN;&Ucirc;&sup2;&THORN;&Yacute;&Yacute;&Ucirc; &Yacute;&Yacute;&Yacute; &deg; &Yacute;&szlig;&Ucirc;&sup2;&Yacute;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&szlig;&szlig;&szlig; &szlig;&Uuml;&sup2;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&THORN;&Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc;&Ucirc; &sup2;&sup2;&plusmn;&plusmn;&THORN; &szlig;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Uuml;&szlig;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&sup2;&Yacute;&sup2;&Uuml; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&THORN;&Uuml; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute; &Uuml; &THORN;<br />
&szlig;&sup2;&Ucirc;&THORN;&sup2;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&THORN;&THORN;&Ucirc;&Ucirc;&sup2;&Ucirc;&sup2;&THORN;&sup2;&Yacute; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&THORN;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &THORN;&Ucirc;<br />
&Uuml;&sup2;&szlig;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&sup2;&Ucirc;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &Yacute;&Ucirc;<br />
&szlig; &Uuml;&Uuml;&szlig;&szlig;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&Ucirc;&szlig;&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &THORN; &Ucirc;<br />
&szlig; &szlig;&Ucirc;&Ucirc;&Uuml;&Uuml;&Yacute;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&Uuml;&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&Uuml;&Uuml;&szlig; &Yacute;&THORN;&sup2;<br />
&szlig;&Yacute;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&Uuml; &sup2; &Ucirc;&sup2;<br />
&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&THORN;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &sup2; &THORN;&sup2;&deg;<br />
&szlig; &sup2;&THORN;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&sup2; &sup2; &Uuml;&Ucirc;&sup2;<br />
&THORN;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&Ucirc; &sup2; &Uuml;&Ucirc;&sup2;&deg;<br />
&Uuml;&szlig; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&Yacute;&szlig; &Uuml;&szlig; &Uuml;&Ucirc;&sup2;&deg;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&Uuml;&sup2; &Uuml;&szlig; &Uuml;&Ucirc;&Ucirc;&sup2;&deg;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&sup2; &Uuml;&sup2;&szlig; &Uuml;&Ucirc;&Ucirc;&sup2;&plusmn;&deg;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&sup2; &Uuml;&Uuml;&szlig;&szlig; &Uuml;&Ucirc;&Ucirc;&sup2;&plusmn;&deg;<br />
&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&sup2; &Uuml;&Uuml;&szlig;&szlig; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&sup2;&plusmn;&deg;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&sup2; &Uuml;&Uuml;&szlig;&szlig; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&sup2;&plusmn;&deg;<br />
&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute;&Ucirc;&sup2;&Uuml;&Uuml;&szlig;&szlig; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&sup2;&sup2;&plusmn;&deg;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&szlig;&szlig;&szlig;&Uuml;&Uuml;&Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&sup2;&sup2;&plusmn;&plusmn;&deg;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&sup2;&sup2;&plusmn;&plusmn;&deg;<br />
&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &deg;&sup2;&szlig;&sup2;&sup2;&sup2;&sup2;&plusmn;&plusmn;&deg;<br />
&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &deg;&sup2;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute; &deg;&plusmn;&Yacute;<br />
&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&deg;&deg;&plusmn;&sup2;<br />
&sup2;&Ucirc;&Ucirc;&Ucirc;&sup2;&szlig;&sup2;&sup2;&szlig;<br />
&Ucirc;&sup2;&Ucirc;<br />
&THORN;&sup2;&Yacute;<br />
&plusmn;<br />
&deg;<br />
<br />
&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;<br />
&Uuml;&szlig;&szlig;&Ucirc;&Ucirc;&szlig; &szlig;&Ucirc;&sup2; &Uuml;&szlig;&szlig;&Ucirc;&Ucirc;&szlig; &szlig;&Ucirc;&sup2; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig; &szlig;&Ucirc;&sup2;<br />
&Ucirc;&Ucirc;&Ucirc;&deg;&plusmn;&Ucirc;&Yacute; &sup2;&Ucirc;&Uuml; &Ucirc;&Ucirc;&Ucirc;&deg;&plusmn;&Ucirc;&Yacute; &Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&deg;&plusmn;&Ucirc;&Yacute;<br />
&THORN;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc; &Ucirc;&Ucirc;&Yacute; &THORN;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Yacute;&Ucirc;&Ucirc;&Ucirc;&szlig; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&Ucirc;&Ucirc;<br />
&Uuml;&Uuml; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &THORN;&Ucirc;&Ucirc;&Yacute; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &sup2;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;<br />
&THORN;&Ucirc;&Ucirc; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&Ucirc;&Ucirc; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &THORN;&Ucirc;&Ucirc; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&Ucirc;&Ucirc;&Yacute; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &Ucirc;&Ucirc;&Ucirc; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Yacute; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;<br />
&THORN;&Ucirc;&sup2; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&Uuml;&Uuml; &THORN;&Ucirc;&Ucirc;&Yacute; &sup2;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &THORN;&Ucirc;&sup2; &Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Uuml;&Uuml;&Uuml; &szlig;<br />
&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig;&Ucirc;&Uuml; &sup2;&Ucirc;&Ucirc;&Uuml;&Uuml;&Uuml;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig;&Ucirc;&Uuml;<br />
&THORN;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig; &szlig;&Ucirc;&Ucirc;&Ucirc;&deg;&THORN;&Ucirc; &szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &THORN;&Ucirc;&Ucirc;&Ucirc;&szlig;&szlig; &szlig;&Ucirc;&Ucirc;&Ucirc;&deg;&THORN;&Ucirc;<br />
&sup2;&Ucirc;&sup2; &Ucirc;&Ucirc;&Ucirc;&Uuml;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Yacute; &sup2;&Ucirc;&Ucirc; &Ucirc;&Ucirc;&Ucirc;&Uuml;&Ucirc;&Yacute;<br />
&THORN;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2; &THORN;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &THORN;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;<br />
&Ucirc;&Ucirc;&Ucirc; &Ucirc;&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc; &Ucirc;&szlig;&Ucirc;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc;&Ucirc; &Ucirc;&szlig;&Ucirc;&Ucirc;&Ucirc;&Ucirc;<br />
&szlig; &Ucirc;&deg;&THORN;&Ucirc;&Ucirc;&Ucirc;&Yacute; &Ucirc;&deg;&THORN;&Ucirc;&Ucirc;&Ucirc; &szlig; &Ucirc;&deg;&THORN;&Ucirc;&Ucirc;&Ucirc;&Yacute;<br />
&Ucirc;&plusmn;&deg;&Ucirc;&Ucirc;&Ucirc;&sup2; &Ucirc;&plusmn;&deg;&Ucirc;&Ucirc;&Ucirc;&sup2; &Ucirc;&plusmn;&deg;&Ucirc;&Ucirc;&Ucirc;&sup2;<br />
&THORN;&plusmn;&plusmn;&plusmn;&deg;&Ucirc;&Ucirc; &THORN;&plusmn;&plusmn;&plusmn;&deg;&Ucirc;&Ucirc; &THORN;&plusmn;&plusmn;&plusmn;&deg;&Ucirc;&Ucirc; presents..<br />
&THORN;&sup2;&plusmn;&plusmn;&plusmn;&plusmn;&Yacute; &THORN;&sup2;&plusmn;&plusmn;&plusmn;&plusmn;&Yacute; &THORN;&sup2;&plusmn;&plusmn;&plusmn;&plusmn;&Yacute;<br />
&Ucirc;&sup2;&sup2;&sup2;&Ucirc;&Uuml; &Uuml;&sup2; &Ucirc;&sup2;&sup2;&sup2;&Ucirc;&Uuml; &Uuml;&sup2; &Ucirc;&sup2;&sup2;&sup2;&Ucirc;&Uuml; &Uuml;&sup2;<br />
&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;<br />
k n o w y o u r r o l e<br />
<br />
&uacute; &uacute;&uacute;--&Auml;-&Auml;-&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;-&Auml;-&Auml;--&uacute;&uacute; &uacute;<br />
WWE.RAW.2016.11.28.720p.HDTV.h264-KYR<br />
&uacute; &uacute;&uacute;--&Auml;-&Auml;-&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;-&Auml;-&Auml;--&uacute;&uacute; &uacute;<br />
&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;<br />
&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Ucirc;&sup2;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Uuml;&szlig;&Ucirc; &Uuml;&Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Ucirc;&Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&Uuml;&Ucirc;&deg;&Uuml;&szlig;&Ucirc;<br />
&Uacute;&Auml;&Auml;&Ucirc; &szlig;&Uuml;&Ucirc; &Uuml;&Ucirc;&Ucirc; &Ucirc;&sup2;&Ucirc; &Uuml;&Ucirc;&Ucirc; &Uuml; &Ucirc;&Uuml;&Uuml;&deg;&Ucirc; &Uuml;&Ucirc;&szlig;&Auml;&Auml;&Ucirc; &Ucirc; &Ucirc; &Ucirc; &Uuml;&Ucirc;&Ucirc; &Ucirc; &Ucirc;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&uacute;&uacute; &uacute;<br />
&sup3; &Ucirc; &Ucirc; &Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&Ucirc; &Ucirc;&Uuml;&szlig; &Ucirc;&Uuml;&szlig;&szlig;&Ucirc; &Ucirc; &Ucirc;&Uuml;&Ucirc; &Ucirc;&deg;&Ucirc;&sup2;&Ucirc; &szlig; &Ucirc;<br />
&sup3; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;<br />
&sup3;<br />
&sup3; title&uacute;[ WWE RAW ]&uacute;<br />
&sup3; genre&uacute;[ Wrestling ]&uacute; crf&uacute;[ 23 ]&uacute;<br />
&sup3; rel. date&uacute;[ 11.28.16 ]&uacute; format&uacute;[ x264 ]&uacute;<br />
&sup3; air date&uacute;[ 11.28.16 ]&uacute; source&uacute;[ HDTV ]&uacute;<br />
&sup3; runtime&uacute;[ 2h 13m 48s ]&uacute; bitrate&uacute;[ 4111kbps ]&uacute;<br />
&sup3; filesize&uacute;[ 4.28 GB ]&uacute; resolu.&uacute;[ 1280x720 ]&uacute;<br />
&sup3; rar count&uacute;[ 93x50mb ]&uacute; frames&uacute;[ 59.940 ]&uacute;<br />
&sup3; &uacute;[ audio&uacute;[ 384 kbps AC3 5.1 ]&uacute;<br />
&sup3; &uacute;[ location&uacute;[ USA ]&uacute;<br />
&sup3; &uacute;[ ]&uacute;<br />
&sup3; url &uacute;[ http://www.wwe.com ]&uacute; <br />
&sup3;<br />
&sup3;<br />
&sup3; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;<br />
&sup3; &Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Ucirc;&sup2;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Uuml;&szlig;&Ucirc; &Uuml;&Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Uuml;&szlig;&Ucirc;&Uuml; &Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Uuml;&Uuml;&Ucirc;<br />
&sup3; &uacute; &uacute;&uacute;&Auml;&Auml;&Auml;&Auml;&Auml;-&Ucirc; &szlig;&Uuml;&Ucirc; &Uuml;&Ucirc;&Ucirc; &Ucirc;&sup2;&Ucirc; &Uuml;&Ucirc;&Ucirc; &Uuml; &Ucirc;&Uuml;&Uuml;&deg;&Ucirc; &Uuml;&Ucirc;&szlig;&Auml;&Auml;&Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc;&Ucirc; &Ucirc;&Ucirc; &Uuml;&Ucirc;&Ucirc;&Uuml;&Uuml;&deg;&Ucirc;&Auml;&Auml;&acute;<br />
&sup3; &Ucirc; &Ucirc; &Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&Ucirc; &Ucirc;&Uuml;&szlig; &Ucirc;&Uuml;&szlig;&szlig;&Ucirc; &Ucirc; &Ucirc; &Ucirc; &szlig; &Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig; &Ucirc; &sup3;<br />
&sup3; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &sup3;<br />
&sup3; &sup3;<br />
&sup3; &sup3;<br />
&sup3; Enjoy! &sup3;<br />
&sup3; &sup3;<br />
&sup3; &sup3;<br />
&sup3; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &sup3;<br />
&sup3; &Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Uuml;&szlig;&Ucirc;&szlig;&Ucirc;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Ucirc;&Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&Uuml;&Ucirc;&deg;&Uuml;&szlig;&Ucirc; &sup3;<br />
&Atilde;&Auml;&Auml;&Ucirc; &Yacute;&szlig;&Ucirc; &szlig;&Uuml;&Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &szlig; &Ucirc;&Auml;&Auml;&Ucirc;&deg;&Ucirc; &Ucirc; &Ucirc; &Uuml;&Ucirc;&Ucirc; &Ucirc; &Ucirc;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;-&Auml;&Auml;&Auml;&Auml;&Auml;&uacute;&uacute; &uacute; &sup3;<br />
&Ucirc; &szlig; &Ucirc; &Ucirc; &Ucirc; &szlig; &Ucirc; &szlig; &Ucirc; &Ucirc;&szlig;&szlig; &Ucirc; &Ucirc; &Ucirc; &Ucirc;&deg;&Ucirc;&sup2;&Ucirc; &szlig; &Ucirc; &sup3;<br />
&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig; &sup3;<br />
&sup3;<br />
 group info &sup3;<br />
&sup3;<br />
Know Your Role and Shut Your Mouth! &sup3;<br />
&sup3;<br />
 we are now looking for... &sup3;<br />
&sup3;<br />
(a) capper(s) of cable, PPV, good upspeed advantageous &sup3;<br />
.. contact in the usual way. &sup3;<br />
&sup3;<br />
 KYR respects... &sup3;<br />
&sup3;<br />
everyone keeping it real and oldschool. we love ya! &sup3;<br />
&sup3;<br />
&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &sup3;<br />
&Uuml;&Uuml;&Uuml;&Uuml;&sup2; &Uuml;&Uuml;&Uuml; &Ucirc;&Uuml;&sup2; &Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &sup2;&Yacute; &sup3;<br />
&uacute; &uacute;&uacute;&Auml;&Auml;&Auml;&Auml;&Auml;--&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Ucirc; &Uuml;&Uuml; &Yacute;&THORN;&Ucirc;&Ucirc;&Yacute;&Uuml;&Uuml; &Yacute;&THORN;&Ucirc;&Ucirc;&Yacute;&szlig;&szlig; &THORN;&Ucirc;&Ucirc;&Yacute;&THORN;&Ucirc; &Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&acute;<br />
&Ucirc; &Ucirc;&Ucirc; &Uuml;&Ucirc;&Ucirc;&szlig; &Ucirc;&Ucirc; &Uuml;&Ucirc;&Ucirc;&sup2; &Ucirc;&Ucirc; &Uuml;&Ucirc;&Ucirc;&szlig; &Ucirc;&Yacute; K N O W &sup3;<br />
ascii crafted by &Ucirc; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&Uuml; &THORN;&Ucirc;&Ucirc;&sup2;&szlig; &Uuml; &Ucirc;&Ucirc;&Ucirc;&Ucirc;&sup2;&Uuml; &szlig;&Ucirc; &sup3;<br />
&Ucirc; &Ucirc;&Ucirc; &szlig;&Ucirc;&Ucirc;&sup2; &Ucirc;&Ucirc; &Uuml;&sup2;&Ucirc; &Ucirc;&Ucirc; &szlig;&Ucirc;&Ucirc;&sup2; &sup2;&Yacute; Y O U R &sup3;<br />
h8`!HiGHONASCii &Ucirc; &Ucirc;&Ucirc; &Yacute;&THORN;&Ucirc;&Ucirc;&Yacute; &Ucirc;&Ucirc; &Ucirc; &Ucirc; &Ucirc;&Ucirc; &Yacute;&THORN;&Ucirc;&Ucirc;&Yacute;&THORN;&Ucirc; &sup3;<br />
&Ucirc; &Ucirc;&sup2; &Ucirc; &Ucirc;&Ucirc;&sup2; &Ucirc;&sup2; &Ucirc; &Ucirc; &Ucirc;&sup2; &Ucirc; &Ucirc;&Ucirc;&sup2; &Ucirc; R O L E &sup3;<br />
&uacute; &uacute;&uacute;&Auml;-&Auml;----&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Ucirc;&Uuml;&Uuml;&Uuml;&Uuml;&sup2;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&sup2; &Ucirc;&Uuml;&Uuml;&Uuml;&Uuml;&sup2;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&sup2; &Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Auml;&Ugrave;<br />
&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;<br />
&deg;&plusmn;&sup2;&Ucirc; &Uuml;&szlig;&Ucirc; &Uuml;&szlig;&Ucirc; &Uuml;&szlig;&Ucirc; &Uuml;&szlig;&Ucirc;&sup2;&sup2;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Ucirc;&sup2;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Uuml;&szlig;&Ucirc; &Uuml;&Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc; &Uuml;&Uuml;&Ucirc;&sup2;&sup2;&Ucirc;&deg;&Uuml;&szlig;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Uuml;&szlig;&Ucirc;&sup2;&plusmn;&deg;<br />
&deg; &deg;&plusmn;&Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc;+&plusmn;&Ucirc; &szlig;&Uuml;&Ucirc; &Uuml;&Ucirc;&Ucirc; &Ucirc;&plusmn;&Ucirc; &Uuml;&Ucirc;&Ucirc; &Uuml; &Ucirc;&Uuml;&Uuml;&deg;&Ucirc; &Uuml;&Ucirc;&Ucirc;&Uuml;&Uuml;&deg;&Ucirc;&plusmn;&plusmn;&Ucirc; &Uuml; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc;&plusmn;&deg; &deg;<br />
&deg;&plusmn;&sup2;&Ucirc;&Uuml;&szlig;&deg;&Ucirc;&Uuml;&szlig;&deg;&Ucirc;&Uuml;&szlig;&deg;&Ucirc;&Uuml;&szlig;&deg;&Ucirc;&sup2;&sup2;&Ucirc; &Ucirc; &Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&Ucirc; &Ucirc;&Uuml;&szlig; &Ucirc;&Uuml;&szlig;&szlig;&Ucirc;&Uuml;&szlig; &Ucirc;&sup2;&sup2;&Ucirc;&Uuml;&Ucirc; &Ucirc;&Uuml;&Ucirc; &Ucirc; &szlig;&Uuml;&Ucirc;&sup2;&plusmn;&deg;<br />
&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;<br />
&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml; &Uuml;&Uuml; &Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;&Uuml;<br />
&deg;&plusmn;&sup2;&sup2;&Ucirc;&szlig;&Uuml; &Ucirc;&deg;&Uuml;&szlig;&Ucirc;&szlig;&Ucirc;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&Uuml; &Uuml;&Ucirc;&Uuml;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&szlig;&Uuml;&deg;&Ucirc;&deg;&Ucirc;&deg;&Ucirc;&deg;&Ucirc;&sup2;&sup2;&plusmn;&deg;<br />
&deg; &deg;&plusmn;&plusmn;&Ucirc; &Ucirc;&Ucirc;&Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc; &Ucirc;&Ucirc; &Ucirc;&Ucirc;&deg;&Ucirc; &Ucirc; &Ucirc; &Yacute;&szlig;&Ucirc; &Ucirc; &Ucirc; &Ucirc;&plusmn;&plusmn;&deg; &deg;<br />
&deg;&plusmn;&sup2;&sup2;&Ucirc;&Uuml;&szlig;&deg;&Ucirc; &szlig; &Ucirc; &szlig; &Ucirc;&Uuml;&Ucirc; &Ucirc;&Ucirc;&deg;&Ucirc;&Ucirc; &Ucirc; &Ucirc; &Ucirc;&deg;&szlig; &Ucirc;&szlig;&Ucirc;&szlig;&Ucirc;&szlig;&Ucirc;&sup2;&sup2;&plusmn;&deg;<br />
&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig; &szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;&szlig;]]>
</description>
<pubDate>Tue, 29 Nov 2016 05:08:18 +0000</pubDate>
<link>https://alpharatio.cc/torrents.php?action=download&amp;authkey=private_auth_key&amp;torrent_pass=private_torrent_pass&amp;id=465831</link>
<guid>https://alpharatio.cc/torrents.php?action=download&amp;authkey=private_auth_key&amp;torrent_pass=private_torrent_pass&amp;id=465831</guid>
<comments>https://alpharatio.cc/torrents.php?id=465860</comments>
<dc:creator>Anonymous</dc:creator>
</item>
</channel>
</rss>

View File

@@ -12,6 +12,7 @@ namespace NzbDrone.Core.Test.Framework
{
List<Dictionary<string, object>> Query(string sql);
List<T> Query<T>(string sql) where T : new();
T QueryScalar<T>(string sql);
}
public class DirectDataMapper : IDirectDataMapper
@@ -25,7 +26,7 @@ namespace NzbDrone.Core.Test.Framework
_providerFactory = dataMapper.ProviderFactory;
_connectionString = dataMapper.ConnectionString;
}
private DbConnection OpenConnection()
{
var connection = _providerFactory.CreateConnection();
@@ -62,6 +63,13 @@ namespace NzbDrone.Core.Test.Framework
return dataTable.Rows.Cast<DataRow>().Select(MapToObject<T>).ToList();
}
public T QueryScalar<T>(string sql)
{
var dataTable = GetDataTable(sql);
return dataTable.Rows.Cast<DataRow>().Select(d => MapValue(d, 0, typeof(T))).Cast<T>().FirstOrDefault();
}
protected Dictionary<string, object> MapToDictionary(DataRow dataRow)
{
var item = new Dictionary<string, object>();
@@ -107,24 +115,29 @@ namespace NzbDrone.Core.Test.Framework
propertyType = propertyType.GetGenericArguments()[0];
}
object value;
if (dataRow.ItemArray[i] == DBNull.Value)
{
value = null;
}
else if (dataRow.Table.Columns[i].DataType == typeof(string) && propertyType != typeof(string))
{
value = Json.Deserialize((string)dataRow.ItemArray[i], propertyType);
}
else
{
value = Convert.ChangeType(dataRow.ItemArray[i], propertyType);
}
object value = MapValue(dataRow, i, propertyType);
propertyInfo.SetValue(item, value, null);
}
return item;
}
private object MapValue(DataRow dataRow, int i, Type targetType)
{
if (dataRow.ItemArray[i] == DBNull.Value)
{
return null;
}
else if (dataRow.Table.Columns[i].DataType == typeof(string) && targetType != typeof(string))
{
return Json.Deserialize((string)dataRow.ItemArray[i], targetType);
}
else
{
return Convert.ChangeType(dataRow.ItemArray[i], targetType);
}
}
}
}

View File

@@ -1,4 +1,5 @@
using FluentAssertions;
using NzbDrone.Common.Extensions;
using NzbDrone.Core.HealthCheck;
namespace NzbDrone.Core.Test.HealthCheck.Checks
@@ -10,14 +11,24 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
result.Type.Should().Be(HealthCheckResult.Ok);
}
public static void ShouldBeWarning(this Core.HealthCheck.HealthCheck result)
public static void ShouldBeWarning(this Core.HealthCheck.HealthCheck result, string message = null)
{
result.Type.Should().Be(HealthCheckResult.Warning);
if (message.IsNotNullOrWhiteSpace())
{
result.Message.Should().Contain(message);
}
}
public static void ShouldBeError(this Core.HealthCheck.HealthCheck result)
public static void ShouldBeError(this Core.HealthCheck.HealthCheck result, string message = null)
{
result.Type.Should().Be(HealthCheckResult.Error);
if (message.IsNotNullOrWhiteSpace())
{
result.Message.Should().Contain(message);
}
}
}
}

View File

@@ -0,0 +1,92 @@
using System.Collections.Generic;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.HealthCheck.Checks;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.HealthCheck.Checks
{
[TestFixture]
public class IndexerRssCheckFixture : CoreTest<IndexerRssCheck>
{
private Mock<IIndexer> _indexerMock;
[SetUp]
public void SetUp()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer>());
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled(It.IsAny<bool>()))
.Returns(new List<IIndexer>());
}
private void GivenIndexer(bool supportsRss, bool supportsSearch)
{
_indexerMock = Mocker.GetMock<IIndexer>();
_indexerMock.SetupGet(s => s.SupportsRss).Returns(supportsRss);
_indexerMock.SetupGet(s => s.SupportsSearch).Returns(supportsSearch);
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer> { _indexerMock.Object });
}
private void GivenRssEnabled()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled(It.IsAny<bool>()))
.Returns(new List<IIndexer> { _indexerMock.Object });
}
private void GivenRssFiltered()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled(false))
.Returns(new List<IIndexer> { _indexerMock.Object });
}
[Test]
public void should_return_error_when_no_indexer_present()
{
Subject.Check().ShouldBeError();
}
[Test]
public void should_return_error_when_no_rss_supported_indexer_present()
{
GivenIndexer(false, true);
Subject.Check().ShouldBeError();
}
[Test]
public void should_return_ok_when_rss_is_enabled()
{
GivenIndexer(true, false);
GivenRssEnabled();
Subject.Check().ShouldBeOk();
}
[Test]
public void should_return_error_if_rss_is_supported_but_disabled()
{
GivenIndexer(true, false);
Subject.Check().ShouldBeError();
}
[Test]
public void should_return_filter_warning_if_rss_is_enabled_but_filtered()
{
GivenIndexer(true, false);
GivenRssFiltered();
Subject.Check().ShouldBeWarning("recent indexer errors");
}
}
}

View File

@@ -8,10 +8,22 @@ using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.HealthCheck.Checks
{
[TestFixture]
public class IndexerCheckFixture : CoreTest<IndexerCheck>
public class IndexerSearchCheckFixture : CoreTest<IndexerSearchCheck>
{
private Mock<IIndexer> _indexerMock;
[SetUp]
public void SetUp()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer>());
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled(It.IsAny<bool>()))
.Returns(new List<IIndexer>());
}
private void GivenIndexer(bool supportsRss, bool supportsSearch)
{
_indexerMock = Mocker.GetMock<IIndexer>();
@@ -21,42 +33,30 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer> { _indexerMock.Object });
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled())
.Returns(new List<IIndexer>());
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled())
.Returns(new List<IIndexer>());
}
private void GivenRssEnabled()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.RssEnabled())
.Returns(new List<IIndexer> { _indexerMock.Object });
}
private void GivenSearchEnabled()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled())
.Setup(s => s.SearchEnabled(It.IsAny<bool>()))
.Returns(new List<IIndexer> { _indexerMock.Object });
}
private void GivenSearchFiltered()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled(false))
.Returns(new List<IIndexer> { _indexerMock.Object });
}
[Test]
public void should_return_error_when_not_indexers_are_enabled()
public void should_return_warning_when_no_indexer_present()
{
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer>());
Subject.Check().ShouldBeError();
Subject.Check().ShouldBeWarning();
}
[Test]
public void should_return_warning_when_only_enabled_indexer_doesnt_support_search()
public void should_return_warning_when_no_search_supported_indexer_present()
{
GivenIndexer(true, false);
@@ -64,7 +64,16 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
}
[Test]
public void should_return_warning_when_only_enabled_indexer_doesnt_support_rss()
public void should_return_ok_when_search_is_enabled()
{
GivenIndexer(false, true);
GivenSearchEnabled();
Subject.Check().ShouldBeOk();
}
[Test]
public void should_return_warning_if_search_is_supported_but_disabled()
{
GivenIndexer(false, true);
@@ -72,52 +81,12 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
}
[Test]
public void should_return_ok_when_multiple_indexers_are_enabled()
public void should_return_filter_warning_if_search_is_enabled_but_filtered()
{
GivenRssEnabled();
GivenSearchEnabled();
GivenIndexer(false, true);
GivenSearchFiltered();
var indexer1 = Mocker.GetMock<IIndexer>();
indexer1.SetupGet(s => s.SupportsRss).Returns(true);
indexer1.SetupGet(s => s.SupportsSearch).Returns(true);
var indexer2 = new Moq.Mock<IIndexer>();
indexer2.SetupGet(s => s.SupportsRss).Returns(true);
indexer2.SetupGet(s => s.SupportsSearch).Returns(false);
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.GetAvailableProviders())
.Returns(new List<IIndexer> { indexer1.Object, indexer2.Object });
Subject.Check().ShouldBeOk();
}
[Test]
public void should_return_ok_when_indexer_supports_rss_and_search()
{
GivenIndexer(true, true);
GivenRssEnabled();
GivenSearchEnabled();
Subject.Check().ShouldBeOk();
}
[Test]
public void should_return_warning_if_rss_is_supported_but_disabled()
{
GivenIndexer(true, true);
GivenSearchEnabled();
Subject.Check().ShouldBeWarning();
}
[Test]
public void should_return_warning_if_search_is_supported_but_disabled()
{
GivenIndexer(true, true);
GivenRssEnabled();
Subject.Check().ShouldBeWarning();
Subject.Check().ShouldBeWarning("recent indexer errors");
}
}
}

View File

@@ -40,7 +40,7 @@ namespace NzbDrone.Core.Test.HealthCheck.Checks
{
_blockedIndexers.Add(new IndexerStatus
{
IndexerId = id,
ProviderId = id,
InitialFailure = DateTime.UtcNow.AddHours(-failureHours),
MostRecentFailure = DateTime.UtcNow.AddHours(-0.1),
EscalationLevel = 5,

View File

@@ -81,10 +81,10 @@ namespace NzbDrone.Core.Test.HistoryTests
Path = @"C:\Test\Unsorted\Series.s01e01.mkv"
};
Subject.Handle(new EpisodeImportedEvent(localEpisode, episodeFile, true, "sab", "abcd", true));
Subject.Handle(new EpisodeImportedEvent(localEpisode, episodeFile, true, "sab", "abcd"));
Mocker.GetMock<IHistoryRepository>()
.Verify(v => v.Insert(It.Is<History.History>(h => h.SourceTitle == Path.GetFileNameWithoutExtension(localEpisode.Path))));
}
}
}
}

View File

@@ -28,7 +28,7 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
public void should_delete_orphaned_indexerstatus()
{
var status = Builder<IndexerStatus>.CreateNew()
.With(h => h.IndexerId = _indexer.Id)
.With(h => h.ProviderId = _indexer.Id)
.BuildNew();
Db.Insert(status);
@@ -42,13 +42,13 @@ namespace NzbDrone.Core.Test.Housekeeping.Housekeepers
GivenIndexer();
var status = Builder<IndexerStatus>.CreateNew()
.With(h => h.IndexerId = _indexer.Id)
.With(h => h.ProviderId = _indexer.Id)
.BuildNew();
Db.Insert(status);
Subject.Clean();
AllStoredModels.Should().HaveCount(1);
AllStoredModels.Should().Contain(h => h.IndexerId == _indexer.Id);
AllStoredModels.Should().Contain(h => h.ProviderId == _indexer.Id);
}
}
}

View File

@@ -28,7 +28,7 @@ namespace NzbDrone.Core.Test.IndexerSearchTests
_mockIndexer.SetupGet(s => s.SupportsSearch).Returns(true);
Mocker.GetMock<IIndexerFactory>()
.Setup(s => s.SearchEnabled())
.Setup(s => s.SearchEnabled(true))
.Returns(new List<IIndexer> { _mockIndexer.Object });
Mocker.GetMock<IMakeDownloadDecision>()

View File

@@ -20,7 +20,7 @@ namespace NzbDrone.Core.Test.IndexerTests.IPTorrentsTests
Subject.Definition = new IndexerDefinition()
{
Name = "IPTorrents",
Settings = new IPTorrentsSettings() { Url = "http://fake.com/" }
Settings = new IPTorrentsSettings() { BaseUrl = "http://fake.com/" }
};
}

View File

@@ -1,9 +1,12 @@
using FluentAssertions;
using System;
using System.Xml;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
@@ -18,7 +21,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
_settings = new NewznabSettings()
{
Url = "http://indxer.local"
BaseUrl = "http://indxer.local"
};
_caps = ReadAllText("Files/Indexers/Newznab/newznab_caps.xml");
@@ -64,5 +67,35 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
caps.DefaultPageSize.Should().Be(100);
caps.MaxPageSize.Should().Be(100);
}
[Test]
public void should_throw_if_failed_to_get()
{
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Get(It.IsAny<HttpRequest>()))
.Throws<Exception>();
Assert.Throws<Exception>(() => Subject.GetCapabilities(_settings));
}
[Test]
public void should_throw_if_xml_invalid()
{
GivenCapsResponse(_caps.Replace("<limits", "<>"));
Assert.Throws<XmlException>(() => Subject.GetCapabilities(_settings));
}
[Test]
public void should_not_throw_on_xml_data_unexpected()
{
GivenCapsResponse(_caps.Replace("5030", "asdf"));
var result = Subject.GetCapabilities(_settings);
result.Should().NotBeNull();
ExceptionVerification.ExpectedErrors(1);
}
}
}

View File

@@ -1,5 +1,6 @@
using System;
using System.Linq;
using System.Net;
using FluentAssertions;
using Moq;
using NUnit.Framework;
@@ -7,6 +8,7 @@ using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Newznab;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
@@ -24,7 +26,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
Name = "Newznab",
Settings = new NewznabSettings()
{
Url = "http://indexer.local/",
BaseUrl = "http://indexer.local/",
Categories = new int[] { 1 }
}
};
@@ -43,7 +45,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
var releases = Subject.FetchRecent();
releases.Should().HaveCount(100);
@@ -69,5 +71,27 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
Subject.PageSize.Should().Be(25);
}
[Test]
public void should_record_indexer_failure_if_caps_throw()
{
var request = new HttpRequest("http://my.indexer.com");
var response = new HttpResponse(request, new HttpHeader(), new byte[0], (HttpStatusCode)429);
response.Headers["Retry-After"] = "300";
Mocker.GetMock<INewznabCapabilitiesProvider>()
.Setup(v => v.GetCapabilities(It.IsAny<NewznabSettings>()))
.Throws(new TooManyRequestsException(request, response));
_caps.MaxPageSize = 30;
_caps.DefaultPageSize = 25;
Subject.FetchRecent().Should().BeEmpty();
Mocker.GetMock<IIndexerStatusService>()
.Verify(v => v.RecordFailure(It.IsAny<int>(), TimeSpan.FromMinutes(5.0)), Times.Once());
ExceptionVerification.ExpectedWarns(1);
}
}
}

View File

@@ -20,10 +20,10 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
{
Subject.Settings = new NewznabSettings()
{
Url = "http://127.0.0.1:1234/",
Categories = new [] { 1, 2 },
AnimeCategories = new [] { 3, 4 },
ApiKey = "abcd",
BaseUrl = "http://127.0.0.1:1234/",
Categories = new [] { 1, 2 },
AnimeCategories = new [] { 3, 4 },
ApiKey = "abcd",
};
_singleEpisodeSearchCriteria = new SingleEpisodeSearchCriteria
@@ -84,7 +84,7 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
page.Url.FullUri.Should().Contain("&cat=3,4&");
}
[Test]
public void should_use_mode_search_for_anime()
{

View File

@@ -15,12 +15,12 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
var setting = new NewznabSettings()
{
ApiKey = "",
Url = url
BaseUrl = url
};
setting.Validate().IsValid.Should().BeFalse();
setting.Validate().Errors.Should().Contain(c => c.PropertyName == "ApiKey");
setting.Validate().Errors.Should().Contain(c => c.PropertyName == nameof(NewznabSettings.ApiKey));
}
@@ -32,13 +32,13 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
var setting = new NewznabSettings
{
ApiKey = "",
Url = url
BaseUrl = url
};
setting.Validate().IsValid.Should().BeFalse();
setting.Validate().Errors.Should().NotContain(c => c.PropertyName == "ApiKey");
setting.Validate().Errors.Should().Contain(c => c.PropertyName == "Url");
setting.Validate().Errors.Should().NotContain(c => c.PropertyName == nameof(NewznabSettings.ApiKey));
setting.Validate().Errors.Should().Contain(c => c.PropertyName == nameof(NewznabSettings.BaseUrl));
}
@@ -49,11 +49,11 @@ namespace NzbDrone.Core.Test.IndexerTests.NewznabTests
var setting = new NewznabSettings()
{
ApiKey = "",
Url = url
BaseUrl = url
};
setting.Validate().IsValid.Should().BeTrue();
}
}
}
}

View File

@@ -1,14 +1,17 @@
using System;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.ThingiProvider;
using NzbDrone.Core.Validation;
namespace NzbDrone.Core.Test.IndexerTests
{
public class TestIndexerSettings : IProviderConfig
public class TestIndexerSettings : IIndexerSettings
{
public NzbDroneValidationResult Validate()
{
throw new NotImplementedException();
}
public string BaseUrl { get; set; }
}
}

View File

@@ -5,9 +5,11 @@ using Moq;
using NUnit.Framework;
using NzbDrone.Common.Http;
using NzbDrone.Core.Indexers;
using NzbDrone.Core.Indexers.Exceptions;
using NzbDrone.Core.Indexers.TorrentRss;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Test.Common;
namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
{
@@ -48,7 +50,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
releases.Should().HaveCount(50);
releases.First().Should().BeOfType<TorrentInfo>();
var torrentInfo = (TorrentInfo)releases.First();
torrentInfo.Title.Should().Be("Conan.2015.02.05.Jeff.Bridges.720p.HDTV.X264-CROOKS");
@@ -239,7 +241,37 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
torrentInfo.Title.Should().Be("DAYS - 05 (1280x720 HEVC2 AAC).mkv");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("http://storage.animetosho.org/torrents/4b58360143d59a55cbd922397a3eaa378165f3ff/DAYS%20-%2005%20%281280x720%20HEVC2%20AAC%29.torrent");
torrentInfo.DownloadUrl.Should().Be("http://storage.animetosho.org/torrents/4b58360143d59a55cbd922397a3eaa378165f3ff/DAYS%20-%2005%20%281280x720%20HEVC2%20AAC%29.torrent");
}
[Test]
public void should_parse_recent_feed_from_AlphaRatio()
{
GivenRecentFeedResponse("TorrentRss/AlphaRatio.xml");
var releases = Subject.FetchRecent();
releases.Should().HaveCount(2);
releases.Last().Should().BeOfType<TorrentInfo>();
var torrentInfo = releases.Last() as TorrentInfo;
torrentInfo.Title.Should().Be("TvHD 465860 465831 WWE.RAW.2016.11.28.720p.HDTV.x264-KYR");
torrentInfo.DownloadProtocol.Should().Be(DownloadProtocol.Torrent);
torrentInfo.DownloadUrl.Should().Be("https://alpharatio.cc/torrents.php?action=download&authkey=private_auth_key&torrent_pass=private_torrent_pass&id=465831");
}
[Test]
public void should_record_indexer_failure_if_unsupported_feed()
{
GivenRecentFeedResponse("TorrentRss/invalid/TorrentDay_NoPubDate.xml");
Subject.FetchRecent().Should().BeEmpty();
Mocker.GetMock<IIndexerStatusService>()
.Verify(v => v.RecordFailure(It.IsAny<int>(), TimeSpan.Zero), Times.Once());
ExceptionVerification.ExpectedErrors(1);
}
}
}

View File

@@ -200,6 +200,26 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
});
}
[Test]
public void should_detect_rss_settings_for_AlphaRatio()
{
_indexerSettings.AllowZeroSize = true;
GivenRecentFeedResponse("TorrentRss/AlphaRatio.xml");
var settings = Subject.Detect(_indexerSettings);
settings.ShouldBeEquivalentTo(new TorrentRssIndexerParserSettings
{
UseEZTVFormat = false,
UseEnclosureUrl = false,
UseEnclosureLength = false,
ParseSizeInDescription = true,
ParseSeedersInDescription = false,
SizeElementName = null
});
}
[Test]
[Ignore("Cannot reliably reject unparseable titles")]
public void should_reject_rss_settings_for_AwesomeHD()
@@ -267,9 +287,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorrentRssIndexerTests
var ex = Assert.Throws<UnsupportedFeedException>(() => Subject.Detect(_indexerSettings));
ex.Message.Should().Contain("Empty feed");
ExceptionVerification.ExpectedErrors(1);
ex.Message.Should().Contain("Rss feed must have a pubDate");
}
[TestCase("Torrentleech/Torrentleech.xml")]

View File

@@ -25,7 +25,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
Name = "Torznab",
Settings = new TorznabSettings()
{
Url = "http://indexer.local/",
BaseUrl = "http://indexer.local/",
Categories = new int[] { 1 }
}
};
@@ -44,7 +44,7 @@ namespace NzbDrone.Core.Test.IndexerTests.TorznabTests
Mocker.GetMock<IHttpClient>()
.Setup(o => o.Execute(It.Is<HttpRequest>(v => v.Method == HttpMethod.GET)))
.Returns<HttpRequest>(r => new HttpResponse(r, new HttpHeader(), recentFeed));
var releases = Subject.FetchRecent();
releases.Should().HaveCount(5);

View File

@@ -5,6 +5,7 @@ using FizzWare.NBuilder;
using Moq;
using NUnit.Framework;
using NzbDrone.Common.Disk;
using NzbDrone.Core.Configuration;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.EpisodeImport;
using NzbDrone.Core.Test.Framework;
@@ -17,28 +18,50 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
public class ScanFixture : CoreTest<DiskScanService>
{
private Series _series;
private string _rootFolder;
private string _otherSeriesFolder;
[SetUp]
public void Setup()
{
_rootFolder = @"C:\Test\TV".AsOsAgnostic();
_otherSeriesFolder = @"C:\Test\TV\OtherSeries".AsOsAgnostic();
var seriesFolder = @"C:\Test\TV\Series".AsOsAgnostic();
_series = Builder<Series>.CreateNew()
.With(s => s.Path = @"C:\Test\TV\Series".AsOsAgnostic())
.With(s => s.Path = seriesFolder)
.Build();
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(It.IsAny<string>()))
.Returns(false);
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.GetParentFolder(It.IsAny<string>()))
.Returns((string path) => Directory.GetParent(path).FullName);
}
private void GivenParentFolderExists()
private void GivenRootFolder(params string[] subfolders)
{
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(It.IsAny<string>()))
.Setup(s => s.FolderExists(_rootFolder))
.Returns(true);
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.GetDirectories(It.IsAny<string>()))
.Returns(new string[] { @"C:\Test\TV\Series2".AsOsAgnostic() });
.Setup(s => s.GetDirectories(_rootFolder))
.Returns(subfolders);
foreach (var folder in subfolders)
{
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(folder))
.Returns(true);
}
}
private void GivenSeriesFolder()
{
GivenRootFolder(_series.Path);
}
private void GivenFiles(IEnumerable<string> files)
@@ -49,39 +72,124 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
}
[Test]
public void should_not_scan_if_series_root_folder_does_not_exist()
{
public void should_not_scan_if_root_folder_does_not_exist()
{
Subject.Scan(_series);
ExceptionVerification.ExpectedWarns(1);
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.FolderExists(_series.Path), Times.Never());
Mocker.GetMock<IMediaFileTableCleanupService>()
.Verify(v => v.Clean(It.IsAny<Series>(), It.IsAny<List<string>>()), Times.Never());
.Verify(v => v.Clean(It.IsAny<Series>(), It.IsAny<List<string>>()), Times.Never());
}
[Test]
public void should_not_scan_if_series_root_folder_is_empty()
{
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.FolderExists(It.IsAny<string>()))
.Returns(true);
Mocker.GetMock<IDiskProvider>()
.Setup(s => s.GetDirectories(It.IsAny<string>()))
.Returns(new string[0]);
GivenRootFolder();
Subject.Scan(_series);
ExceptionVerification.ExpectedWarns(1);
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.FolderExists(_series.Path), Times.Never());
Mocker.GetMock<IMediaFileTableCleanupService>()
.Verify(v => v.Clean(It.IsAny<Series>(), new List<string>()), Times.Never());
.Verify(v => v.Clean(It.IsAny<Series>(), It.IsAny<List<string>>()), Times.Never());
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.IsAny<List<string>>(), _series), Times.Never());
}
[Test]
public void should_create_if_series_folder_does_not_exist_but_create_folder_enabled()
{
GivenRootFolder(_otherSeriesFolder);
Mocker.GetMock<IConfigService>()
.Setup(s => s.CreateEmptySeriesFolders)
.Returns(true);
Subject.Scan(_series);
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.CreateFolder(_series.Path), Times.Once());
}
[Test]
public void should_not_create_if_series_folder_does_not_exist_and_create_folder_disabled()
{
GivenRootFolder(_otherSeriesFolder);
Mocker.GetMock<IConfigService>()
.Setup(s => s.CreateEmptySeriesFolders)
.Returns(false);
Subject.Scan(_series);
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.CreateFolder(_series.Path), Times.Never());
}
[Test]
public void should_clean_but_not_import_if_series_folder_does_not_exist()
{
GivenRootFolder(_otherSeriesFolder);
Subject.Scan(_series);
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.FolderExists(_series.Path), Times.Once());
Mocker.GetMock<IMediaFileTableCleanupService>()
.Verify(v => v.Clean(It.IsAny<Series>(), It.IsAny<List<string>>()), Times.Once());
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.IsAny<List<string>>(), _series), Times.Never());
}
[Test]
public void should_clean_but_not_import_if_series_folder_does_not_exist_and_create_folder_enabled()
{
GivenRootFolder(_otherSeriesFolder);
Mocker.GetMock<IConfigService>()
.Setup(s => s.CreateEmptySeriesFolders)
.Returns(true);
Subject.Scan(_series);
Mocker.GetMock<IMediaFileTableCleanupService>()
.Verify(v => v.Clean(It.IsAny<Series>(), It.IsAny<List<string>>()), Times.Once());
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.IsAny<List<string>>(), _series), Times.Never());
}
[Test]
public void should_find_files_at_root_of_series_folder()
{
GivenSeriesFolder();
GivenFiles(new List<string>
{
Path.Combine(_series.Path, "file1.mkv").AsOsAgnostic(),
Path.Combine(_series.Path, "s01e01.mkv").AsOsAgnostic()
});
Subject.Scan(_series);
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 2), _series), Times.Once());
}
[Test]
public void should_not_scan_extras_subfolder()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{
@@ -94,6 +202,9 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
Subject.Scan(_series);
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.GetFiles(It.IsAny<string>(), It.IsAny<SearchOption>()), Times.Once());
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 1), _series), Times.Once());
}
@@ -101,7 +212,7 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_not_scan_AppleDouble_subfolder()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{
@@ -119,9 +230,10 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_scan_extras_series_and_subfolders()
{
GivenParentFolderExists();
_series.Path = @"C:\Test\TV\Extras".AsOsAgnostic();
GivenSeriesFolder();
GivenFiles(new List<string>
{
Path.Combine(_series.Path, "Extras", "file1.mkv").AsOsAgnostic(),
@@ -141,7 +253,7 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_not_scan_subfolders_that_start_with_period()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{
@@ -160,7 +272,7 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_not_scan_subfolder_of_season_folder_that_starts_with_a_period()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{
@@ -180,7 +292,7 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_not_scan_Synology_eaDir()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{
@@ -197,7 +309,7 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_not_scan_thumb_folder()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{
@@ -214,9 +326,10 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
[Test]
public void should_scan_dotHack_folder()
{
GivenParentFolderExists();
_series.Path = @"C:\Test\TV\.hack".AsOsAgnostic();
GivenSeriesFolder();
GivenFiles(new List<string>
{
Path.Combine(_series.Path, "Season 1", "file1.mkv").AsOsAgnostic(),
@@ -229,27 +342,10 @@ namespace NzbDrone.Core.Test.MediaFiles.DiskScanServiceTests
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 2), _series), Times.Once());
}
[Test]
public void should_find_files_at_root_of_series_folder()
{
GivenParentFolderExists();
GivenFiles(new List<string>
{
Path.Combine(_series.Path, "file1.mkv").AsOsAgnostic(),
Path.Combine(_series.Path, "s01e01.mkv").AsOsAgnostic()
});
Subject.Scan(_series);
Mocker.GetMock<IMakeImportDecision>()
.Verify(v => v.GetImportDecisions(It.Is<List<string>>(l => l.Count == 2), _series), Times.Once());
}
[Test]
public void should_exclude_osx_metadata_files()
{
GivenParentFolderExists();
GivenSeriesFolder();
GivenFiles(new List<string>
{

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using FizzWare.NBuilder;
@@ -14,6 +14,7 @@ using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
using FluentAssertions;
using NzbDrone.Core.Download;
namespace NzbDrone.Core.Test.MediaFiles
{
@@ -77,7 +78,7 @@ namespace NzbDrone.Core.Test.MediaFiles
Subject.ProcessRootFolder(new DirectoryInfo(_droneFactory));
Mocker.GetMock<IMakeImportDecision>()
.Verify(c => c.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<ParsedEpisodeInfo>(), It.IsAny<bool>()),
.Verify(c => c.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), It.IsAny<ParsedEpisodeInfo>(), It.IsAny<bool>()),
Times.Never());
VerifyNoImport();
@@ -128,7 +129,7 @@ namespace NzbDrone.Core.Test.MediaFiles
imported.Add(new ImportDecision(localEpisode));
Mocker.GetMock<IMakeImportDecision>()
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), null, true))
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), null, true))
.Returns(imported);
Mocker.GetMock<IImportApprovedEpisodes>()
@@ -154,7 +155,7 @@ namespace NzbDrone.Core.Test.MediaFiles
imported.Add(new ImportDecision(localEpisode));
Mocker.GetMock<IMakeImportDecision>()
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), null, true))
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), null, true))
.Returns(imported);
Mocker.GetMock<IImportApprovedEpisodes>()
@@ -226,7 +227,7 @@ namespace NzbDrone.Core.Test.MediaFiles
imported.Add(new ImportDecision(localEpisode));
Mocker.GetMock<IMakeImportDecision>()
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), null, true))
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), null, true))
.Returns(imported);
Mocker.GetMock<IImportApprovedEpisodes>()
@@ -280,7 +281,7 @@ namespace NzbDrone.Core.Test.MediaFiles
Subject.ProcessPath(fileName);
Mocker.GetMock<IMakeImportDecision>()
.Verify(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.Is<ParsedEpisodeInfo>(v => v.AbsoluteEpisodeNumbers.First() == 9), true), Times.Once());
.Verify(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), It.Is<ParsedEpisodeInfo>(v => v.AbsoluteEpisodeNumbers.First() == 9), true), Times.Once());
}
[Test]
@@ -304,7 +305,7 @@ namespace NzbDrone.Core.Test.MediaFiles
var result = Subject.ProcessPath(fileName);
Mocker.GetMock<IMakeImportDecision>()
.Verify(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), null, true), Times.Once());
.Verify(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), null, true), Times.Once());
}
[Test]
@@ -337,7 +338,7 @@ namespace NzbDrone.Core.Test.MediaFiles
imported.Add(new ImportDecision(localEpisode));
Mocker.GetMock<IMakeImportDecision>()
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), null, true))
.Setup(s => s.GetImportDecisions(It.IsAny<List<string>>(), It.IsAny<Series>(), It.IsAny<DownloadClientItem>(), null, true))
.Returns(imported);
Mocker.GetMock<IImportApprovedEpisodes>()

View File

@@ -14,6 +14,7 @@ using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
using NzbDrone.Test.Common;
using FizzWare.NBuilder;
using NzbDrone.Core.Download;
namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
{
@@ -44,13 +45,13 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
_fail2 = new Mock<IImportDecisionEngineSpecification>();
_fail3 = new Mock<IImportDecisionEngineSpecification>();
_pass1.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>())).Returns(Decision.Accept());
_pass2.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>())).Returns(Decision.Accept());
_pass3.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>())).Returns(Decision.Accept());
_pass1.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Accept());
_pass2.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Accept());
_pass3.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Accept());
_fail1.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>())).Returns(Decision.Reject("_fail1"));
_fail2.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>())).Returns(Decision.Reject("_fail2"));
_fail3.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>())).Returns(Decision.Reject("_fail3"));
_fail1.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Reject("_fail1"));
_fail2.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Reject("_fail2"));
_fail3.Setup(c => c.IsSatisfiedBy(It.IsAny<LocalEpisode>(), It.IsAny<DownloadClientItem>())).Returns(Decision.Reject("_fail3"));
_series = Builder<Series>.CreateNew()
.With(e => e.Profile = new Profile { Items = Qualities.QualityFixture.GetDefaultQualities() })
@@ -90,16 +91,17 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
[Test]
public void should_call_all_specifications()
{
var downloadClientItem = Builder<DownloadClientItem>.CreateNew().Build();
GivenSpecifications(_pass1, _pass2, _pass3, _fail1, _fail2, _fail3);
Subject.GetImportDecisions(_videoFiles, new Series(), null, false);
Subject.GetImportDecisions(_videoFiles, new Series(), downloadClientItem, null, false);
_fail1.Verify(c => c.IsSatisfiedBy(_localEpisode), Times.Once());
_fail2.Verify(c => c.IsSatisfiedBy(_localEpisode), Times.Once());
_fail3.Verify(c => c.IsSatisfiedBy(_localEpisode), Times.Once());
_pass1.Verify(c => c.IsSatisfiedBy(_localEpisode), Times.Once());
_pass2.Verify(c => c.IsSatisfiedBy(_localEpisode), Times.Once());
_pass3.Verify(c => c.IsSatisfiedBy(_localEpisode), Times.Once());
_fail1.Verify(c => c.IsSatisfiedBy(_localEpisode, downloadClientItem), Times.Once());
_fail2.Verify(c => c.IsSatisfiedBy(_localEpisode, downloadClientItem), Times.Once());
_fail3.Verify(c => c.IsSatisfiedBy(_localEpisode, downloadClientItem), Times.Once());
_pass1.Verify(c => c.IsSatisfiedBy(_localEpisode, downloadClientItem), Times.Once());
_pass2.Verify(c => c.IsSatisfiedBy(_localEpisode, downloadClientItem), Times.Once());
_pass3.Verify(c => c.IsSatisfiedBy(_localEpisode, downloadClientItem), Times.Once());
}
[Test]
@@ -184,7 +186,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
GivenSpecifications(_pass1, _pass2, _pass3);
var expectedQuality = QualityParser.ParseQuality(_videoFiles.Single());
var result = Subject.GetImportDecisions(_videoFiles, _series, new ParsedEpisodeInfo{Quality = new QualityModel(Quality.SDTV)}, true);
var result = Subject.GetImportDecisions(_videoFiles, _series, null, new ParsedEpisodeInfo{Quality = new QualityModel(Quality.SDTV)}, true);
result.Single().LocalEpisode.Quality.Should().Be(expectedQuality);
}
@@ -201,7 +203,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var expectedQuality = new QualityModel(Quality.SDTV);
var result = Subject.GetImportDecisions(_videoFiles, _series, new ParsedEpisodeInfo { Quality = expectedQuality }, true);
var result = Subject.GetImportDecisions(_videoFiles, _series, null, new ParsedEpisodeInfo { Quality = expectedQuality }, true);
result.Single().LocalEpisode.Quality.Should().Be(expectedQuality);
}
@@ -217,7 +219,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var expectedQuality = new QualityModel(Quality.Bluray720p);
var result = Subject.GetImportDecisions(_videoFiles, _series, new ParsedEpisodeInfo { Quality = expectedQuality }, true);
var result = Subject.GetImportDecisions(_videoFiles, _series, null, new ParsedEpisodeInfo { Quality = expectedQuality }, true);
result.Single().LocalEpisode.Quality.Should().Be(expectedQuality);
}
@@ -264,7 +266,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var folderInfo = Parser.Parser.ParseTitle("Series.Title.S01");
Subject.GetImportDecisions(_videoFiles, _series, folderInfo, true);
Subject.GetImportDecisions(_videoFiles, _series, null, folderInfo, true);
Mocker.GetMock<IParsingService>()
.Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), null, true), Times.Exactly(3));
@@ -287,7 +289,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var folderInfo = Parser.Parser.ParseTitle("Series.Title.S01E01");
Subject.GetImportDecisions(_videoFiles, _series, folderInfo, true);
Subject.GetImportDecisions(_videoFiles, _series, null, folderInfo, true);
Mocker.GetMock<IParsingService>()
.Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), null, true), Times.Exactly(2));
@@ -309,7 +311,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var folderInfo = Parser.Parser.ParseTitle("Series.Title.S01E01");
Subject.GetImportDecisions(_videoFiles, _series, folderInfo, true);
Subject.GetImportDecisions(_videoFiles, _series, null, folderInfo, true);
Mocker.GetMock<IParsingService>()
.Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), It.IsAny<ParsedEpisodeInfo>(), true), Times.Exactly(1));
@@ -336,7 +338,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var folderInfo = Parser.Parser.ParseTitle("Series.Title.S01E01");
Subject.GetImportDecisions(_videoFiles, _series, folderInfo, true);
Subject.GetImportDecisions(_videoFiles, _series, null, folderInfo, true);
Mocker.GetMock<IParsingService>()
.Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), It.IsAny<ParsedEpisodeInfo>(), true), Times.Exactly(2));
@@ -358,7 +360,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var folderInfo = Parser.Parser.ParseTitle("Series.Title.S01E01.720p.HDTV-LOL");
Subject.GetImportDecisions(_videoFiles, _series, folderInfo, true);
Subject.GetImportDecisions(_videoFiles, _series, null, folderInfo, true);
Mocker.GetMock<IParsingService>()
.Verify(c => c.GetLocalEpisode(It.IsAny<string>(), It.IsAny<Series>(), null, true), Times.Exactly(1));
@@ -380,7 +382,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
var folderQuality = new QualityModel(Quality.Unknown);
var result = Subject.GetImportDecisions(_videoFiles, _series, new ParsedEpisodeInfo { Quality = folderQuality}, true);
var result = Subject.GetImportDecisions(_videoFiles, _series, null, new ParsedEpisodeInfo { Quality = folderQuality}, true);
result.Single().LocalEpisode.Quality.Should().Be(_quality);
}

View File

@@ -121,6 +121,24 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport
ShouldBeFalse();
}
[Test]
public void should_return_false_if_runtime_greater_than_anime_short_minimum()
{
_series.Runtime = 2;
GivenRuntime(60);
ShouldBeFalse();
}
[Test]
public void should_return_true_if_runtime_less_than_anime_short_minimum()
{
_series.Runtime = 2;
GivenRuntime(10);
ShouldBeTrue();
}
[Test]
public void should_fall_back_to_file_size_if_mediainfo_dll_not_found_acceptable_size()
{

View File

@@ -63,7 +63,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenFileSize(100.Megabytes());
GivenFreeSpace(80.Megabytes());
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
ExceptionVerification.ExpectedWarns(1);
}
@@ -73,7 +73,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenFileSize(100.Megabytes());
GivenFreeSpace(150.Megabytes());
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
ExceptionVerification.ExpectedWarns(1);
}
@@ -83,7 +83,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenFileSize(100.Megabytes());
GivenFreeSpace(1.Gigabytes());
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -92,7 +92,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenFileSize(100.Megabytes());
GivenFreeSpace(1.Gigabytes());
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
Mocker.GetMock<IDiskProvider>()
.Verify(v => v.GetAvailableSpace(_rootFolder), Times.Once());
@@ -104,7 +104,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenFileSize(100.Megabytes());
GivenFreeSpace(null);
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -116,7 +116,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Setup(s => s.GetAvailableSpace(It.IsAny<string>()))
.Throws(new TestException());
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
ExceptionVerification.ExpectedErrors(1);
}
@@ -125,7 +125,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.ExistingFile = true;
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
Mocker.GetMock<IDiskProvider>()
.Verify(s => s.GetAvailableSpace(It.IsAny<string>()), Times.Never());
@@ -140,7 +140,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Setup(s => s.GetAvailableSpace(It.IsAny<string>()))
.Returns(freeSpace);
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -150,7 +150,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Setup(s => s.SkipFreeSpaceCheckWhenImporting)
.Returns(true);
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
}
}

View File

@@ -34,13 +34,13 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.ParsedEpisodeInfo.FullSeason = true;
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
[Test]
public void should_return_true_when_file_does_not_contain_the_full_season()
{
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
}
}

View File

@@ -0,0 +1,94 @@
using System.Collections.Generic;
using FizzWare.NBuilder;
using FluentAssertions;
using Moq;
using NUnit.Framework;
using NzbDrone.Core.Download;
using NzbDrone.Core.History;
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Qualities;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
[TestFixture]
public class GrabbedReleaseQualityFixture : CoreTest<GrabbedReleaseQualitySpecification>
{
private LocalEpisode _localEpisode;
private DownloadClientItem _downloadClientItem;
[SetUp]
public void Setup()
{
_localEpisode = Builder<LocalEpisode>.CreateNew()
.With(l => l.Quality = new QualityModel(Quality.Bluray720p))
.Build();
_downloadClientItem = Builder<DownloadClientItem>.CreateNew()
.Build();
}
private void GivenHistory(List<History.History> history)
{
Mocker.GetMock<IHistoryService>()
.Setup(s => s.FindByDownloadId(It.IsAny<string>()))
.Returns(history);
}
[Test]
public void should_be_accepted_when_downloadClientItem_is_null()
{
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_be_accepted_if_no_history_for_downloadId()
{
GivenHistory(new List<History.History>());
Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue();
}
[Test]
public void should_be_accepted_if_no_grabbed_history_for_downloadId()
{
var history = Builder<History.History>.CreateListOfSize(1)
.All()
.With(h => h.EventType = HistoryEventType.Unknown)
.BuildList();
GivenHistory(history);
Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue();
}
[Test]
public void should_be_accepted_if_grabbed_history_quality_matches()
{
var history = Builder<History.History>.CreateListOfSize(1)
.All()
.With(h => h.EventType = HistoryEventType.Grabbed)
.With(h => h.Quality = _localEpisode.Quality)
.BuildList();
GivenHistory(history);
Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeTrue();
}
[Test]
public void should_be_rejected_if_grabbed_history_quality_does_not_match()
{
var history = Builder<History.History>.CreateListOfSize(1)
.All()
.With(h => h.EventType = HistoryEventType.Grabbed)
.With(h => h.Quality = new QualityModel(Quality.HDTV720p))
.BuildList();
GivenHistory(history);
Subject.IsSatisfiedBy(_localEpisode, _downloadClientItem).Accepted.Should().BeFalse();
}
}
}

View File

@@ -31,7 +31,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.ExistingFile = true;
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -39,7 +39,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title\S01E01.mkv".AsOsAgnostic();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -47,7 +47,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01\S01E01.mkv".AsOsAgnostic();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -55,7 +55,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.ParsedEpisodeInfo.EpisodeNumbers = new[] { 1 };
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01E01.720p.HDTV-Sonarr\S01E01.mkv".AsOsAgnostic();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -63,14 +63,14 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.ParsedEpisodeInfo.EpisodeNumbers = new[] { 1 };
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01E01E02.720p.HDTV-Sonarr\S01E01.mkv".AsOsAgnostic();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_be_rejected_if_file_and_folder_do_not_have_same_episode()
{
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01E01.720p.HDTV-Sonarr\S01E05.mkv".AsOsAgnostic();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
[Test]
@@ -78,7 +78,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
_localEpisode.ParsedEpisodeInfo.EpisodeNumbers = new[] { 5, 6 };
_localEpisode.Path = @"C:\Test\Unsorted\Series.Title.S01E01E02.720p.HDTV-Sonarr\S01E05E06.mkv".AsOsAgnostic();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
}
}

View File

@@ -42,7 +42,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
public void should_return_true_for_existing_file()
{
_localEpisode.ExistingFile = true;
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
}
}

View File

@@ -48,7 +48,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
[Test]
public void should_return_true_if_not_in_working_folder()
{
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -59,7 +59,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenInWorkingFolder();
GivenLastWriteTimeUtc(DateTime.UtcNow.AddHours(-1));
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -68,7 +68,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenInWorkingFolder();
GivenLastWriteTimeUtc(DateTime.UtcNow);
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
[Test]
@@ -79,7 +79,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
GivenInWorkingFolder();
GivenLastWriteTimeUtc(DateTime.UtcNow.AddDays(-5));
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
}
}

View File

@@ -0,0 +1,96 @@
using System.Linq;
using FizzWare.NBuilder;
using FluentAssertions;
using Marr.Data;
using NUnit.Framework;
using NzbDrone.Core.MediaFiles;
using NzbDrone.Core.MediaFiles.EpisodeImport.Specifications;
using NzbDrone.Core.Parser.Model;
using NzbDrone.Core.Test.Framework;
using NzbDrone.Core.Tv;
namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
{
[TestFixture]
public class SameFileSpecificationFixture : CoreTest<SameFileSpecification>
{
private LocalEpisode _localEpisode;
[SetUp]
public void Setup()
{
_localEpisode = Builder<LocalEpisode>.CreateNew()
.With(l => l.Size = 150.Megabytes())
.Build();
}
[Test]
public void should_be_accepted_if_no_existing_file()
{
_localEpisode.Episodes = Builder<Episode>.CreateListOfSize(1)
.TheFirst(1)
.With(e => e.EpisodeFileId = 0)
.BuildList();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_be_accepted_if_multiple_existing_files()
{
_localEpisode.Episodes = Builder<Episode>.CreateListOfSize(2)
.TheFirst(1)
.With(e => e.EpisodeFileId = 1)
.With(e => e.EpisodeFile = new LazyLoaded<EpisodeFile>(
new EpisodeFile
{
Size = _localEpisode.Size
}))
.TheNext(1)
.With(e => e.EpisodeFileId = 2)
.With(e => e.EpisodeFile = new LazyLoaded<EpisodeFile>(
new EpisodeFile
{
Size = _localEpisode.Size
}))
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_be_accepted_if_file_size_is_different()
{
_localEpisode.Episodes = Builder<Episode>.CreateListOfSize(1)
.TheFirst(1)
.With(e => e.EpisodeFileId = 1)
.With(e => e.EpisodeFile = new LazyLoaded<EpisodeFile>(
new EpisodeFile
{
Size = _localEpisode.Size + 100.Megabytes()
}))
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
public void should_be_reject_if_file_size_is_the_same()
{
_localEpisode.Episodes = Builder<Episode>.CreateListOfSize(1)
.TheFirst(1)
.With(e => e.EpisodeFileId = 1)
.With(e => e.EpisodeFile = new LazyLoaded<EpisodeFile>(
new EpisodeFile
{
Size = _localEpisode.Size
}))
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
}
}

View File

@@ -45,7 +45,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -58,7 +58,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -75,7 +75,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -92,7 +92,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeTrue();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeTrue();
}
[Test]
@@ -109,7 +109,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
[Test]
@@ -126,7 +126,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
[Test]
@@ -150,7 +150,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport.Specifications
.Build()
.ToList();
Subject.IsSatisfiedBy(_localEpisode).Accepted.Should().BeFalse();
Subject.IsSatisfiedBy(_localEpisode, null).Accepted.Should().BeFalse();
}
}
}

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