mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-17 21:26:22 -04:00
Compare commits
170 Commits
v2.0.0.432
...
v0.1-e
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a63587bb19 | ||
|
|
eb46343ce8 | ||
|
|
8fa43fb9f7 | ||
|
|
6d5e9ad4a1 | ||
|
|
70c8228605 | ||
|
|
82470bd995 | ||
|
|
a263558383 | ||
|
|
7d82e35650 | ||
|
|
8616bcedd4 | ||
|
|
2c66322121 | ||
|
|
1402bc883e | ||
|
|
1325822798 | ||
|
|
7a786d4c0e | ||
|
|
87c7afac16 | ||
|
|
06d39579a5 | ||
|
|
c8ea0a73e2 | ||
|
|
eeb3c88131 | ||
|
|
fd718b61ac | ||
|
|
4a3b2a0014 | ||
|
|
cbd87dcc38 | ||
|
|
956de03a62 | ||
|
|
2b74098040 | ||
|
|
402a9e1ee0 | ||
|
|
e68653463d | ||
|
|
0715962ec5 | ||
|
|
5668a3bcfd | ||
|
|
bd241dcbe0 | ||
|
|
69786b3968 | ||
|
|
6e2ded5d33 | ||
|
|
b47d5f7fa1 | ||
|
|
90ff73d45f | ||
|
|
c2c7015f39 | ||
|
|
579602419e | ||
|
|
28857e7fac | ||
|
|
6d23fb1b61 | ||
|
|
96332978a0 | ||
|
|
ad95fbfd4a | ||
|
|
1488c0a0fc | ||
|
|
d9d8cbacec | ||
|
|
80f2adad50 | ||
|
|
7a72f4a05b | ||
|
|
6d7ff628d8 | ||
|
|
e9f9f66b2f | ||
|
|
6ca88f98af | ||
|
|
631cf776f6 | ||
|
|
6ea9b4b94a | ||
|
|
d835c168d3 | ||
|
|
329786365d | ||
|
|
4f6380a73c | ||
|
|
cde1217356 | ||
|
|
2eedfca78a | ||
|
|
0d65984991 | ||
|
|
2a932fe7e8 | ||
|
|
0e02171938 | ||
|
|
a3dfa05f25 | ||
|
|
2a3b0304cb | ||
|
|
16e35f68bb | ||
|
|
74b1c846a5 | ||
|
|
1f930c18e4 | ||
|
|
d9e60eff6b | ||
|
|
097982334c | ||
|
|
be6e6b910e | ||
|
|
31b9ec1116 | ||
|
|
ff6c3b70d3 | ||
|
|
0fd0b31a60 | ||
|
|
76e6ebc63c | ||
|
|
2ea35adb98 | ||
|
|
782f63f510 | ||
|
|
c874122fc0 | ||
|
|
2efda4933d | ||
|
|
b7c70d750a | ||
|
|
5ebfac6cc8 | ||
|
|
74ca6149e3 | ||
|
|
40d7590f80 | ||
|
|
2cb27240dc | ||
|
|
837c2683df | ||
|
|
0b278c7db8 | ||
|
|
0b765d10fe | ||
|
|
20dbdfb344 | ||
|
|
426448ed98 | ||
|
|
03b83ed226 | ||
|
|
eafe79450e | ||
|
|
f286dba40a | ||
|
|
448f579723 | ||
|
|
1562081235 | ||
|
|
0214c8e0f0 | ||
|
|
f16dd069b5 | ||
|
|
aba613acd1 | ||
|
|
2e36538dcd | ||
|
|
c42e4d682c | ||
|
|
327536b684 | ||
|
|
7dbacf105d | ||
|
|
8d776abb48 | ||
|
|
7f8093de92 | ||
|
|
c1de7f26d1 | ||
|
|
4a82d30d3d | ||
|
|
da52e60f36 | ||
|
|
cf58e52f40 | ||
|
|
2a7ae96906 | ||
|
|
053f6fcaeb | ||
|
|
0c75d0bb03 | ||
|
|
0c9b5dc97e | ||
|
|
c99e92e6af | ||
|
|
3f64c01d5b | ||
|
|
f022dae1fa | ||
|
|
52ad8cf37f | ||
|
|
3d20fd8f96 | ||
|
|
cf662291d5 | ||
|
|
43d85bf59d | ||
|
|
4a149c356b | ||
|
|
740fc9154f | ||
|
|
0a657302f7 | ||
|
|
7b09b259a8 | ||
|
|
b093be3f4e | ||
|
|
3c8b263694 | ||
|
|
43c5d03f9a | ||
|
|
9fbe06ad68 | ||
|
|
db899a9bb8 | ||
|
|
d3890bd712 | ||
|
|
1a61796092 | ||
|
|
1251e294cd | ||
|
|
0411b82e65 | ||
|
|
9519f3137c | ||
|
|
f8d97cac7d | ||
|
|
f2ecbe776b | ||
|
|
1ac442d0e6 | ||
|
|
5f2aeb0cea | ||
|
|
2ece05cd1e | ||
|
|
25a3f83ebc | ||
|
|
cdce65a922 | ||
|
|
8f73a51522 | ||
|
|
bc438a6a63 | ||
|
|
4167ffe11a | ||
|
|
6fb1aa85d0 | ||
|
|
eb8ef6c337 | ||
|
|
c076f1ddb1 | ||
|
|
eeff79b288 | ||
|
|
697a62da0a | ||
|
|
f1a289cc74 | ||
|
|
c39a26d9e0 | ||
|
|
f2ccf94835 | ||
|
|
19d625c6c5 | ||
|
|
cd3b6000a0 | ||
|
|
ff33f15bac | ||
|
|
50a0e9514e | ||
|
|
7ef1ca8a00 | ||
|
|
e0d1e08f94 | ||
|
|
9fae76015a | ||
|
|
17bf438cad | ||
|
|
c0b0567c23 | ||
|
|
edc1e0b8d1 | ||
|
|
cd79b42f5f | ||
|
|
dc82e66dde | ||
|
|
b034d0c1b3 | ||
|
|
36a3e86882 | ||
|
|
e76fb8c90b | ||
|
|
e6288148ad | ||
|
|
bf8d68a873 | ||
|
|
080e2e9eff | ||
|
|
e3310e590c | ||
|
|
a0b4d3a38d | ||
|
|
a72b856fb8 | ||
|
|
522ef9d8d5 | ||
|
|
a486bff40b | ||
|
|
0de1f3f17a | ||
|
|
755fdce227 | ||
|
|
cd8659e684 | ||
|
|
a621f0d49b | ||
|
|
2e96c4e798 | ||
|
|
816cf608fc |
8
.gitignore
vendored
8
.gitignore
vendored
@@ -10,6 +10,7 @@ src/**/[Oo]bj/
|
|||||||
*.suo
|
*.suo
|
||||||
*.user
|
*.user
|
||||||
*.sln.docstates
|
*.sln.docstates
|
||||||
|
.vs/
|
||||||
|
|
||||||
# Build results
|
# Build results
|
||||||
*_i.c
|
*_i.c
|
||||||
@@ -41,6 +42,9 @@ src/**/[Oo]bj/
|
|||||||
_ReSharper*
|
_ReSharper*
|
||||||
_dotCover*
|
_dotCover*
|
||||||
|
|
||||||
|
# DevExpress CodeRush
|
||||||
|
src/.cr/
|
||||||
|
|
||||||
# NCrunch
|
# NCrunch
|
||||||
*.ncrunch*
|
*.ncrunch*
|
||||||
.*crunch*.local.xml
|
.*crunch*.local.xml
|
||||||
@@ -123,9 +127,13 @@ bin
|
|||||||
obj
|
obj
|
||||||
output/*
|
output/*
|
||||||
|
|
||||||
|
#Packages
|
||||||
|
Radarr_*/
|
||||||
|
Radarr_*.zip
|
||||||
|
|
||||||
#OS X metadata files
|
#OS X metadata files
|
||||||
._*
|
._*
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
_start
|
_start
|
||||||
_temp_*/**/*
|
_temp_*/**/*
|
||||||
|
|||||||
6
.idea/encodings.xml
generated
Normal file
6
.idea/encodings.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="PROJECT" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
1
.idea/jsLibraryMappings.xml
generated
1
.idea/jsLibraryMappings.xml
generated
@@ -1,7 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="JavaScriptLibraryMappings">
|
<component name="JavaScriptLibraryMappings">
|
||||||
<file url="file://$PROJECT_DIR$" libraries="{Sonarr node_modules}" />
|
|
||||||
<includedPredefinedLibrary name="ECMAScript 6" />
|
<includedPredefinedLibrary name="ECMAScript 6" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
||||||
12
.travis.yml
Normal file
12
.travis.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
language: csharp
|
||||||
|
solution: src/NzbDrone.sln
|
||||||
|
script: # the following commands are just examples, use whatever your build process requires
|
||||||
|
- ./build.sh
|
||||||
|
- chmod +x test.sh
|
||||||
|
# - ./test.sh Linux Unit Takes far too long, maybe even crashes travis :/
|
||||||
|
install:
|
||||||
|
- sudo apt-get install nodejs
|
||||||
|
- sudo apt-get install npm
|
||||||
|
after_success:
|
||||||
|
- chmod +x package.sh
|
||||||
|
- ./package.sh
|
||||||
@@ -8,8 +8,8 @@ Setup guides, FAQ, the more information we have on the wiki the better.
|
|||||||
## Development ##
|
## Development ##
|
||||||
|
|
||||||
### Tools required ###
|
### Tools required ###
|
||||||
- Visual Studio 2013
|
- Visual Studio 2015
|
||||||
- HTML/Javascript editor of choice (Sublime Text/Webstorm/etc)
|
- HTML/Javascript editor of choice (Sublime Text/Webstorm/Atom/etc)
|
||||||
- npm (node package manager)
|
- npm (node package manager)
|
||||||
- git
|
- git
|
||||||
|
|
||||||
|
|||||||
4
build.sh
4
build.sh
@@ -192,8 +192,8 @@ PackageOsxApp()
|
|||||||
rm -rf $outputFolderOsxApp
|
rm -rf $outputFolderOsxApp
|
||||||
mkdir $outputFolderOsxApp
|
mkdir $outputFolderOsxApp
|
||||||
|
|
||||||
cp -r ./osx/Sonarr.app $outputFolderOsxApp
|
cp -r ./osx/Radarr.app $outputFolderOsxApp
|
||||||
cp -r $outputFolderOsx $outputFolderOsxApp/Sonarr.app/Contents/MacOS
|
cp -r $outputFolderOsx $outputFolderOsxApp/Radarr.app/Contents/MacOS
|
||||||
|
|
||||||
echo "##teamcity[progressFinish 'Creating OS X App Package']"
|
echo "##teamcity[progressFinish 'Creating OS X App Package']"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,13 +19,16 @@ gulp.task('less', function() {
|
|||||||
paths.src.root + 'Series/series.less',
|
paths.src.root + 'Series/series.less',
|
||||||
paths.src.root + 'Activity/activity.less',
|
paths.src.root + 'Activity/activity.less',
|
||||||
paths.src.root + 'AddSeries/addSeries.less',
|
paths.src.root + 'AddSeries/addSeries.less',
|
||||||
|
paths.src.root + 'AddMovies/addMovies.less',
|
||||||
paths.src.root + 'Calendar/calendar.less',
|
paths.src.root + 'Calendar/calendar.less',
|
||||||
paths.src.root + 'Cells/cells.less',
|
paths.src.root + 'Cells/cells.less',
|
||||||
paths.src.root + 'ManualImport/manualimport.less',
|
paths.src.root + 'ManualImport/manualimport.less',
|
||||||
paths.src.root + 'Settings/settings.less',
|
paths.src.root + 'Settings/settings.less',
|
||||||
paths.src.root + 'System/Logs/logs.less',
|
paths.src.root + 'System/Logs/logs.less',
|
||||||
paths.src.root + 'System/Update/update.less',
|
paths.src.root + 'System/Update/update.less',
|
||||||
paths.src.root + 'System/Info/info.less'
|
paths.src.root + 'System/Info/info.less',
|
||||||
|
paths.src.root + 'Movies/movies.less',
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return gulp.src(src)
|
return gulp.src(src)
|
||||||
|
|||||||
50
package.sh
Normal file
50
package.sh
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
if [ $# -eq 0 ]; then
|
||||||
|
if [ "$TRAVIS_PULL_REQUEST" != false ]; then
|
||||||
|
echo "Need to supply version argument" && exit;
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then
|
||||||
|
VERSION="`date +%H:%M:%S`"
|
||||||
|
YEAR="`date +%Y`"
|
||||||
|
MONTH="`date +%m`"
|
||||||
|
DAY="`date +%d`"
|
||||||
|
else
|
||||||
|
VERSION=$1
|
||||||
|
fi
|
||||||
|
outputFolder='./_output'
|
||||||
|
outputFolderMono='./_output_mono'
|
||||||
|
outputFolderOsx='./_output_osx'
|
||||||
|
outputFolderOsxApp='./_output_osx_app'
|
||||||
|
|
||||||
|
tr -d "\r" < $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr > $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr2
|
||||||
|
rm $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr
|
||||||
|
chmod +x $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr2
|
||||||
|
mv $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr2 $outputFolderOsxApp/Sonarr.app/Contents/MacOS/Sonarr >& error.log
|
||||||
|
|
||||||
|
cp -r $outputFolder/ Radarr_Windows_$VERSION
|
||||||
|
cp -r $outputFolderMono/ Radarr_Mono_$VERSION
|
||||||
|
cp -r $outputFolderOsxApp/ Radarr_OSX_$VERSION
|
||||||
|
|
||||||
|
zip -r Radarr_Windows_$VERSION.zip Radarr_Windows_$VERSION >& /dev/null
|
||||||
|
zip -r Radarr_Mono_$VERSION.zip Radarr_Mono_$VERSION >& /dev/null
|
||||||
|
zip -r Radarr_OSX_$VERSION.zip Radarr_OSX_$VERSION >& /dev/null
|
||||||
|
|
||||||
|
ftp -n ftp.leonardogalli.ch << END_SCRIPT
|
||||||
|
passive
|
||||||
|
quote USER $FTP_USER
|
||||||
|
quote PASS $FTP_PASS
|
||||||
|
mkdir builds
|
||||||
|
cd builds
|
||||||
|
mkdir $YEAR
|
||||||
|
cd $YEAR
|
||||||
|
mkdir $MONTH
|
||||||
|
cd $MONTH
|
||||||
|
mkdir $DAY
|
||||||
|
cd $DAY
|
||||||
|
binary
|
||||||
|
put Radarr_Windows_$VERSION.zip
|
||||||
|
put Radarr_Mono_$VERSION.zip
|
||||||
|
put Radarr_OSX_$VERSION.zip
|
||||||
|
quit
|
||||||
|
END_SCRIPT
|
||||||
28
readme.md
28
readme.md
@@ -1,7 +1,26 @@
|
|||||||
# Sonarr #
|
# Radarr [](https://travis-ci.org/galli-leo/Radarr)#
|
||||||
|
|
||||||
|
This fork of Sonarr aims to turn it into something like Couchpotato.
|
||||||
|
|
||||||
Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS feeds for new episodes of your favorite shows and will grab, sort and rename them. It can also be configured to automatically upgrade the quality of files already downloaded when a better quality format becomes available.
|
## Currently working:
|
||||||
|
* Adding new movies
|
||||||
|
* Manually searching for releases of movies.
|
||||||
|
* Automatically searching for releases.
|
||||||
|
* Rarbg.to indexer (Other indexers are coming, I just need to find the right categories)
|
||||||
|
* QBittorrent download client (Other clients are coming)
|
||||||
|
|
||||||
|
## Planned Features:
|
||||||
|
* Scanning PreDB to know when a new release is available.
|
||||||
|
* Fixing the other Indexers and download clients.
|
||||||
|
* Fixing how movies are parsed.
|
||||||
|
* Fixing movie import.
|
||||||
|
* Importing of Sonarr config.
|
||||||
|
* New TorrentPotato Indexer.
|
||||||
|
|
||||||
|
## Download
|
||||||
|
The latest precompiled binary versions can be found here: https://github.com/galli-leo/Radarr/releases.
|
||||||
|
|
||||||
|
For more up to date versions (but also sometimes broken), daily builds can be found here: https://leonardogalli.ch/radarr/builds/.
|
||||||
|
|
||||||
## Major Features Include: ##
|
## Major Features Include: ##
|
||||||
|
|
||||||
@@ -17,11 +36,10 @@ Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS fee
|
|||||||
* Full support for specials and multi-episode releases
|
* Full support for specials and multi-episode releases
|
||||||
* And a beautiful UI
|
* And a beautiful UI
|
||||||
|
|
||||||
|
|
||||||
## Configuring Development Environment: ##
|
## Configuring Development Environment: ##
|
||||||
|
|
||||||
### Requirements ###
|
### Requirements ###
|
||||||
- Visual Studio 2015 [Free Community Edition](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx)
|
- Visual Studio 2015 [Free Community Edition](https://www.visualstudio.com/en-us/products/visual-studio-community-vs.aspx) or Mono
|
||||||
- [Git](http://git-scm.com/downloads)
|
- [Git](http://git-scm.com/downloads)
|
||||||
- [NodeJS](http://nodejs.org/download/)
|
- [NodeJS](http://nodejs.org/download/)
|
||||||
|
|
||||||
@@ -37,7 +55,7 @@ Sonarr is a PVR for Usenet and BitTorrent users. It can monitor multiple RSS fee
|
|||||||
|
|
||||||
|
|
||||||
### Development ###
|
### Development ###
|
||||||
- Open `NzbDrone.sln` in Visual Studio
|
- Open `NzbDrone.sln` in Visual Studio or run the build.sh script, if Mono is installed.
|
||||||
- Make sure `NzbDrone.Console` is set as the startup project
|
- Make sure `NzbDrone.Console` is set as the startup project
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -75,6 +75,8 @@
|
|||||||
<xs:enumeration value="seedtype" /> <!-- TBD, which criteria must be met. was going for 'ratio,seedtime,both' but afaik it's always 'either' -->
|
<xs:enumeration value="seedtype" /> <!-- TBD, which criteria must be met. was going for 'ratio,seedtime,both' but afaik it's always 'either' -->
|
||||||
<xs:enumeration value="minimumratio" />
|
<xs:enumeration value="minimumratio" />
|
||||||
<xs:enumeration value="minimumseedtime" />
|
<xs:enumeration value="minimumseedtime" />
|
||||||
|
<xs:enumeration value="downloadvolumefactor" /> <!-- factor for the download volume, in most cases it should be set to 1, if a torrent is set to freeleech set it to 0, if only 50% is counted set it to 0.5 -->
|
||||||
|
<xs:enumeration value="uploadvolumefactor" /> <!-- factor for the upload volume, in most cases it should be set to 1, if a torrent is set to neutral leech (upload is not counted) set it to 0, if it's set to double upload set it to 2 -->
|
||||||
</xs:restriction>
|
</xs:restriction>
|
||||||
</xs:simpleType>
|
</xs:simpleType>
|
||||||
<xs:element name="attr">
|
<xs:element name="attr">
|
||||||
|
|||||||
BIN
src/.DS_Store
vendored
Normal file
BIN
src/.DS_Store
vendored
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
// General Information about an assembly is controlled through the following
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="NLog" version="4.3.4" targetFramework="net40" />
|
<package id="NLog" version="4.3.11" targetFramework="net40" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -198,7 +198,8 @@ namespace Marr.Data.Mapping
|
|||||||
{
|
{
|
||||||
return AutoMapPropertiesWhere(m =>
|
return AutoMapPropertiesWhere(m =>
|
||||||
m.MemberType == MemberTypes.Property &&
|
m.MemberType == MemberTypes.Property &&
|
||||||
!DataHelper.IsSimpleType((m as PropertyInfo).PropertyType));
|
!DataHelper.IsSimpleType((m as PropertyInfo).PropertyType) &&
|
||||||
|
!MapRepository.Instance.TypeConverters.ContainsKey((m as PropertyInfo).PropertyType));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
|
||||||
using System.Linq.Expressions;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace Microsoft.AspNet.SignalR.Infrastructure
|
namespace Microsoft.AspNet.SignalR.Infrastructure
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ using System.Diagnostics;
|
|||||||
|
|
||||||
namespace Microsoft.AspNet.SignalR.Infrastructure
|
namespace Microsoft.AspNet.SignalR.Infrastructure
|
||||||
{
|
{
|
||||||
internal class NoOpPerformanceCounter : IPerformanceCounter
|
public class NoOpPerformanceCounter : IPerformanceCounter
|
||||||
{
|
{
|
||||||
public string CounterName
|
public string CounterName
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ using System.Diagnostics;
|
|||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.SignalR.Configuration;
|
using Microsoft.AspNet.SignalR.Configuration;
|
||||||
using Microsoft.AspNet.SignalR.Hosting;
|
using Microsoft.AspNet.SignalR.Hosting;
|
||||||
|
|||||||
@@ -1,13 +1,9 @@
|
|||||||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.md in the project root for license information.
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Reflection;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.SignalR.Infrastructure;
|
using Microsoft.AspNet.SignalR.Infrastructure;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.SignalR.Hosting;
|
using Microsoft.AspNet.SignalR.Hosting;
|
||||||
using Microsoft.AspNet.SignalR.Infrastructure;
|
using Microsoft.AspNet.SignalR.Infrastructure;
|
||||||
|
|||||||
@@ -7,11 +7,9 @@ using System.Security.Principal;
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using Microsoft.AspNet.SignalR.Owin.Infrastructure;
|
using Microsoft.AspNet.SignalR.Owin.Infrastructure;
|
||||||
using Microsoft.AspNet.SignalR.Hosting;
|
|
||||||
|
|
||||||
namespace Microsoft.AspNet.SignalR.Owin
|
namespace Microsoft.AspNet.SignalR.Owin
|
||||||
{
|
{
|
||||||
using WebSocketFunc = Func<IDictionary<string, object>, Task>;
|
|
||||||
public partial class ServerRequest :
|
public partial class ServerRequest :
|
||||||
#if NET45
|
#if NET45
|
||||||
IWebSocketRequest
|
IWebSocketRequest
|
||||||
|
|||||||
@@ -38,16 +38,20 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="FluentAssertions, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FizzWare.NBuilder, Version=4.0.0.115, Culture=neutral, PublicKeyToken=5651b03e12e42c12, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.dll</HintPath>
|
<HintPath>..\packages\NBuilder.4.0.0\lib\net40\FizzWare.NBuilder.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="FluentAssertions.Core, Version=4.2.1.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="nunit.framework, Version=3.2.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
<Reference Include="FluentAssertions.Core, Version=4.18.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NUnit.3.2.0\lib\net40\nunit.framework.dll</HintPath>
|
<HintPath>..\packages\FluentAssertions.4.18.0\lib\net40\FluentAssertions.Core.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="nunit.framework, Version=3.5.0.0, Culture=neutral, PublicKeyToken=2638cd05610744eb, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\NUnit.3.5.0\lib\net40\nunit.framework.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
@@ -57,9 +61,6 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="System.Xml.Linq" />
|
<Reference Include="System.Xml.Linq" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="FizzWare.NBuilder">
|
|
||||||
<HintPath>..\packages\NBuilder.3.0.1.1\lib\FizzWare.NBuilder.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="Moq">
|
<Reference Include="Moq">
|
||||||
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
|
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
|
<package id="FluentAssertions" version="4.18.0" targetFramework="net40" />
|
||||||
<package id="Moq" version="4.0.10827" />
|
<package id="Moq" version="4.0.10827" />
|
||||||
<package id="NBuilder" version="3.0.1.1" targetFramework="net40" />
|
<package id="NBuilder" version="4.0.0" targetFramework="net40" />
|
||||||
<package id="NUnit" version="3.2.0" targetFramework="net40" />
|
<package id="NUnit" version="3.5.0" targetFramework="net40" />
|
||||||
</packages>
|
</packages>
|
||||||
@@ -43,7 +43,7 @@ namespace NzbDrone.Api.Authentication
|
|||||||
expiry = DateTime.UtcNow.AddDays(7);
|
expiry = DateTime.UtcNow.AddDays(7);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.LoginAndRedirect(user.Identifier, expiry);
|
return this.LoginAndRedirect(user.Identifier, expiry, _configFileProvider.UrlBase + "/");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Response Logout()
|
private Response Logout()
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ namespace NzbDrone.Api.Authentication
|
|||||||
_configFileProvider = configFileProvider;
|
_configFileProvider = configFileProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Order { get { return 10; } }
|
public int Order => 10;
|
||||||
|
|
||||||
public void Register(IPipelines pipelines)
|
public void Register(IPipelines pipelines)
|
||||||
{
|
{
|
||||||
@@ -77,7 +77,7 @@ namespace NzbDrone.Api.Authentication
|
|||||||
if (context.Request.IsApiRequest())
|
if (context.Request.IsApiRequest())
|
||||||
{
|
{
|
||||||
if ((context.Response.StatusCode == HttpStatusCode.SeeOther &&
|
if ((context.Response.StatusCode == HttpStatusCode.SeeOther &&
|
||||||
context.Response.Headers["Location"].StartsWith("/login", StringComparison.InvariantCultureIgnoreCase)) ||
|
context.Response.Headers["Location"].StartsWith($"{_configFileProvider.UrlBase}/login", StringComparison.InvariantCultureIgnoreCase)) ||
|
||||||
context.Response.StatusCode == HttpStatusCode.Unauthorized)
|
context.Response.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
context.Response = new { Error = "Unauthorized" }.AsResponse(HttpStatusCode.Unauthorized);
|
context.Response = new { Error = "Unauthorized" }.AsResponse(HttpStatusCode.Unauthorized);
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Blacklisting;
|
||||||
using NzbDrone.Core.Blacklisting;
|
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Blacklist
|
namespace NzbDrone.Api.Blacklist
|
||||||
|
|||||||
@@ -2,31 +2,42 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using DDay.iCal;
|
using Ical.Net;
|
||||||
|
using Ical.Net.DataTypes;
|
||||||
|
using Ical.Net.Interfaces.Serialization;
|
||||||
|
using Ical.Net.Serialization;
|
||||||
|
using Ical.Net.Serialization.iCalendar.Factory;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
using Nancy.Responses;
|
using Nancy.Responses;
|
||||||
|
using NzbDrone.Core.Tags;
|
||||||
|
using NzbDrone.Common.Extensions;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Calendar
|
namespace NzbDrone.Api.Calendar
|
||||||
{
|
{
|
||||||
public class CalendarFeedModule : NzbDroneFeedModule
|
public class CalendarFeedModule : NzbDroneFeedModule
|
||||||
{
|
{
|
||||||
private readonly IEpisodeService _episodeService;
|
private readonly IEpisodeService _episodeService;
|
||||||
|
private readonly ITagService _tagService;
|
||||||
|
|
||||||
public CalendarFeedModule(IEpisodeService episodeService)
|
public CalendarFeedModule(IEpisodeService episodeService, ITagService tagService)
|
||||||
: base("calendar")
|
: base("calendar")
|
||||||
{
|
{
|
||||||
_episodeService = episodeService;
|
_episodeService = episodeService;
|
||||||
|
_tagService = tagService;
|
||||||
|
|
||||||
Get["/NzbDrone.ics"] = options => GetCalendarFeed();
|
Get["/NzbDrone.ics"] = options => GetCalendarFeed();
|
||||||
|
Get["/Sonarr.ics"] = options => GetCalendarFeed();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Response GetCalendarFeed()
|
private Response GetCalendarFeed()
|
||||||
{
|
{
|
||||||
var pastDays = 7;
|
var pastDays = 7;
|
||||||
var futureDays = 28;
|
var futureDays = 28;
|
||||||
var start = DateTime.Today.AddDays(-pastDays);
|
var start = DateTime.Today.AddDays(-pastDays);
|
||||||
var end = DateTime.Today.AddDays(futureDays);
|
var end = DateTime.Today.AddDays(futureDays);
|
||||||
var unmonitored = false;
|
var unmonitored = false;
|
||||||
|
var premiersOnly = false;
|
||||||
|
var tags = new List<int>();
|
||||||
|
|
||||||
// TODO: Remove start/end parameters in v3, they don't work well for iCal
|
// TODO: Remove start/end parameters in v3, they don't work well for iCal
|
||||||
var queryStart = Request.Query.Start;
|
var queryStart = Request.Query.Start;
|
||||||
@@ -34,6 +45,8 @@ namespace NzbDrone.Api.Calendar
|
|||||||
var queryPastDays = Request.Query.PastDays;
|
var queryPastDays = Request.Query.PastDays;
|
||||||
var queryFutureDays = Request.Query.FutureDays;
|
var queryFutureDays = Request.Query.FutureDays;
|
||||||
var queryUnmonitored = Request.Query.Unmonitored;
|
var queryUnmonitored = Request.Query.Unmonitored;
|
||||||
|
var queryPremiersOnly = Request.Query.PremiersOnly;
|
||||||
|
var queryTags = Request.Query.Tags;
|
||||||
|
|
||||||
if (queryStart.HasValue) start = DateTime.Parse(queryStart.Value);
|
if (queryStart.HasValue) start = DateTime.Parse(queryStart.Value);
|
||||||
if (queryEnd.HasValue) end = DateTime.Parse(queryEnd.Value);
|
if (queryEnd.HasValue) end = DateTime.Parse(queryEnd.Value);
|
||||||
@@ -55,33 +68,58 @@ namespace NzbDrone.Api.Calendar
|
|||||||
unmonitored = bool.Parse(queryUnmonitored.Value);
|
unmonitored = bool.Parse(queryUnmonitored.Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (queryPremiersOnly.HasValue)
|
||||||
|
{
|
||||||
|
premiersOnly = bool.Parse(queryPremiersOnly.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (queryTags.HasValue)
|
||||||
|
{
|
||||||
|
var tagInput = (string)queryTags.Value.ToString();
|
||||||
|
tags.AddRange(tagInput.Split(',').Select(_tagService.GetTag).Select(t => t.Id));
|
||||||
|
}
|
||||||
|
|
||||||
var episodes = _episodeService.EpisodesBetweenDates(start, end, unmonitored);
|
var episodes = _episodeService.EpisodesBetweenDates(start, end, unmonitored);
|
||||||
var icalCalendar = new iCalendar();
|
var calendar = new Ical.Net.Calendar
|
||||||
|
{
|
||||||
|
ProductId = "-//sonarr.tv//Sonarr//EN"
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value))
|
foreach (var episode in episodes.OrderBy(v => v.AirDateUtc.Value))
|
||||||
{
|
{
|
||||||
var occurrence = icalCalendar.Create<Event>();
|
if (premiersOnly && (episode.SeasonNumber == 0 || episode.EpisodeNumber != 1))
|
||||||
occurrence.UID = "NzbDrone_episode_" + episode.Id.ToString();
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (tags.Any() && tags.None(episode.Series.Tags.Contains))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var occurrence = calendar.Create<Event>();
|
||||||
|
occurrence.Uid = "NzbDrone_episode_" + episode.Id;
|
||||||
occurrence.Status = episode.HasFile ? EventStatus.Confirmed : EventStatus.Tentative;
|
occurrence.Status = episode.HasFile ? EventStatus.Confirmed : EventStatus.Tentative;
|
||||||
occurrence.Start = new iCalDateTime(episode.AirDateUtc.Value) { HasTime = true };
|
occurrence.Start = new CalDateTime(episode.AirDateUtc.Value) { HasTime = true };
|
||||||
occurrence.End = new iCalDateTime(episode.AirDateUtc.Value.AddMinutes(episode.Series.Runtime)) { HasTime = true };
|
occurrence.End = new CalDateTime(episode.AirDateUtc.Value.AddMinutes(episode.Series.Runtime)) { HasTime = true };
|
||||||
occurrence.Description = episode.Overview;
|
occurrence.Description = episode.Overview;
|
||||||
occurrence.Categories = new List<string>() { episode.Series.Network };
|
occurrence.Categories = new List<string>() { episode.Series.Network };
|
||||||
|
|
||||||
switch (episode.Series.SeriesType)
|
switch (episode.Series.SeriesType)
|
||||||
{
|
{
|
||||||
case SeriesTypes.Daily:
|
case SeriesTypes.Daily:
|
||||||
occurrence.Summary = string.Format("{0} - {1}", episode.Series.Title, episode.Title);
|
occurrence.Summary = $"{episode.Series.Title} - {episode.Title}";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
occurrence.Summary = string.Format("{0} - {1}x{2:00} - {3}", episode.Series.Title, episode.SeasonNumber, episode.EpisodeNumber, episode.Title);
|
occurrence.Summary =$"{episode.Series.Title} - {episode.SeasonNumber}x{episode.EpisodeNumber:00} - {episode.Title}";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var serializer = new DDay.iCal.Serialization.iCalendar.SerializerFactory().Build(icalCalendar.GetType(), new DDay.iCal.Serialization.SerializationContext()) as DDay.iCal.Serialization.IStringSerializer;
|
var serializer = (IStringSerializer) new SerializerFactory().Build(calendar.GetType(), new SerializationContext());
|
||||||
var icalendar = serializer.SerializeToString(icalCalendar);
|
var icalendar = serializer.SerializeToString(calendar);
|
||||||
|
|
||||||
return new TextResponse(icalendar, "text/calendar");
|
return new TextResponse(icalendar, "text/calendar");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.ClientSchema
|
namespace NzbDrone.Api.ClientSchema
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using FluentValidation;
|
||||||
using FluentValidation;
|
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Validation.Paths;
|
using NzbDrone.Core.Validation.Paths;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Config
|
namespace NzbDrone.Api.Config
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
using NzbDrone.Core.Authentication;
|
using NzbDrone.Core.Authentication;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Update;
|
using NzbDrone.Core.Update;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using FluentValidation;
|
||||||
using FluentValidation;
|
|
||||||
using NzbDrone.Api.Validation;
|
using NzbDrone.Api.Validation;
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Config
|
namespace NzbDrone.Api.Config
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using FluentValidation;
|
||||||
using FluentValidation;
|
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.Validation.Paths;
|
using NzbDrone.Core.Validation.Paths;
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
using NzbDrone.Core.MediaFiles;
|
using NzbDrone.Core.MediaFiles;
|
||||||
|
|
||||||
@@ -21,6 +20,7 @@ namespace NzbDrone.Api.Config
|
|||||||
|
|
||||||
public bool SkipFreeSpaceCheckWhenImporting { get; set; }
|
public bool SkipFreeSpaceCheckWhenImporting { get; set; }
|
||||||
public bool CopyUsingHardlinks { get; set; }
|
public bool CopyUsingHardlinks { get; set; }
|
||||||
|
public string ExtraFileExtensions { get; set; }
|
||||||
public bool EnableMediaInfo { get; set; }
|
public bool EnableMediaInfo { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +44,8 @@ namespace NzbDrone.Api.Config
|
|||||||
|
|
||||||
SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting,
|
SkipFreeSpaceCheckWhenImporting = model.SkipFreeSpaceCheckWhenImporting,
|
||||||
CopyUsingHardlinks = model.CopyUsingHardlinks,
|
CopyUsingHardlinks = model.CopyUsingHardlinks,
|
||||||
EnableMediaInfo = model.EnableMediaInfo,
|
ExtraFileExtensions = model.ExtraFileExtensions,
|
||||||
|
EnableMediaInfo = model.EnableMediaInfo
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
using NzbDrone.Core.Organizer;
|
using NzbDrone.Core.Organizer;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Config
|
namespace NzbDrone.Api.Config
|
||||||
|
|||||||
@@ -1,7 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Configuration;
|
||||||
using System.Linq;
|
|
||||||
using System.Reflection;
|
|
||||||
using NzbDrone.Core.Configuration;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Config
|
namespace NzbDrone.Api.Config
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
using NzbDrone.Core.Configuration;
|
using NzbDrone.Core.Configuration;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Config
|
namespace NzbDrone.Api.Config
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using NzbDrone.Core.DiskSpace;
|
using NzbDrone.Core.DiskSpace;
|
||||||
|
|
||||||
namespace NzbDrone.Api.DiskSpace
|
namespace NzbDrone.Api.DiskSpace
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.REST;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.DiskSpace
|
namespace NzbDrone.Api.DiskSpace
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Download;
|
||||||
using NzbDrone.Core.Download;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.DownloadClient
|
namespace NzbDrone.Api.DownloadClient
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.Indexers;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.DownloadClient
|
namespace NzbDrone.Api.DownloadClient
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.Datastore.Events;
|
using NzbDrone.Core.Datastore.Events;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using NzbDrone.Api.REST;
|
|||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
using NzbDrone.SignalR;
|
using NzbDrone.SignalR;
|
||||||
|
using Nancy;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Episodes
|
namespace NzbDrone.Api.Episodes
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Linq;
|
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Api.EpisodeFiles;
|
using NzbDrone.Api.EpisodeFiles;
|
||||||
using NzbDrone.Api.Extensions;
|
|
||||||
using NzbDrone.Api.Series;
|
using NzbDrone.Api.Series;
|
||||||
using NzbDrone.Core.Datastore.Events;
|
using NzbDrone.Core.Datastore.Events;
|
||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
|||||||
_cacheableSpecification = cacheableSpecification;
|
_cacheableSpecification = cacheableSpecification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Order { get { return 0; } }
|
public int Order => 0;
|
||||||
|
|
||||||
public void Register(IPipelines pipelines)
|
public void Register(IPipelines pipelines)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
|||||||
{
|
{
|
||||||
public class CorsPipeline : IRegisterNancyPipeline
|
public class CorsPipeline : IRegisterNancyPipeline
|
||||||
{
|
{
|
||||||
public int Order { get { return 0; } }
|
public int Order => 0;
|
||||||
|
|
||||||
public void Register(IPipelines pipelines)
|
public void Register(IPipelines pipelines)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
|||||||
{
|
{
|
||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
public int Order { get { return 0; } }
|
public int Order => 0;
|
||||||
|
|
||||||
public GzipCompressionPipeline(Logger logger)
|
public GzipCompressionPipeline(Logger logger)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
|||||||
_cacheableSpecification = cacheableSpecification;
|
_cacheableSpecification = cacheableSpecification;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Order { get { return 0; } }
|
public int Order => 0;
|
||||||
|
|
||||||
public void Register(IPipelines pipelines)
|
public void Register(IPipelines pipelines)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
|||||||
{
|
{
|
||||||
public class NzbDroneVersionPipeline : IRegisterNancyPipeline
|
public class NzbDroneVersionPipeline : IRegisterNancyPipeline
|
||||||
{
|
{
|
||||||
public int Order { get { return 0; } }
|
public int Order => 0;
|
||||||
|
|
||||||
public void Register(IPipelines pipelines)
|
public void Register(IPipelines pipelines)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using Nancy;
|
using Nancy;
|
||||||
using Nancy.Bootstrapper;
|
using Nancy.Bootstrapper;
|
||||||
@@ -23,7 +22,7 @@ namespace NzbDrone.Api.Extensions.Pipelines
|
|||||||
_errorPipeline = errorPipeline;
|
_errorPipeline = errorPipeline;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Order { get { return 100; } }
|
public int Order => 100;
|
||||||
|
|
||||||
public void Register(IPipelines pipelines)
|
public void Register(IPipelines pipelines)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using Nancy;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.IO;
|
||||||
using System.IO;
|
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Common.Http;
|
using NzbDrone.Common.Http;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Nancy;
|
|||||||
using NzbDrone.Api.Episodes;
|
using NzbDrone.Api.Episodes;
|
||||||
using NzbDrone.Api.Extensions;
|
using NzbDrone.Api.Extensions;
|
||||||
using NzbDrone.Api.Series;
|
using NzbDrone.Api.Series;
|
||||||
|
using NzbDrone.Api.Movie;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
using NzbDrone.Core.Download;
|
using NzbDrone.Core.Download;
|
||||||
@@ -34,12 +35,18 @@ namespace NzbDrone.Api.History
|
|||||||
|
|
||||||
resource.Series = model.Series.ToResource();
|
resource.Series = model.Series.ToResource();
|
||||||
resource.Episode = model.Episode.ToResource();
|
resource.Episode = model.Episode.ToResource();
|
||||||
|
resource.Movie = model.Movie.ToResource();
|
||||||
|
|
||||||
if (model.Series != null)
|
if (model.Series != null)
|
||||||
{
|
{
|
||||||
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Series.Profile.Value, model.Quality);
|
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Series.Profile.Value, model.Quality);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (model.Movie != null)
|
||||||
|
{
|
||||||
|
resource.QualityCutoffNotMet = _qualityUpgradableSpecification.CutoffNotMet(model.Movie.Profile.Value, model.Quality);
|
||||||
|
}
|
||||||
|
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -47,6 +54,8 @@ namespace NzbDrone.Api.History
|
|||||||
{
|
{
|
||||||
var episodeId = Request.Query.EpisodeId;
|
var episodeId = Request.Query.EpisodeId;
|
||||||
|
|
||||||
|
var movieId = Request.Query.MovieId;
|
||||||
|
|
||||||
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending);
|
var pagingSpec = pagingResource.MapToPagingSpec<HistoryResource, Core.History.History>("date", SortDirection.Descending);
|
||||||
|
|
||||||
if (pagingResource.FilterKey == "eventType")
|
if (pagingResource.FilterKey == "eventType")
|
||||||
@@ -61,6 +70,12 @@ namespace NzbDrone.Api.History
|
|||||||
pagingSpec.FilterExpression = h => h.EpisodeId == i;
|
pagingSpec.FilterExpression = h => h.EpisodeId == i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (movieId.HasValue)
|
||||||
|
{
|
||||||
|
int i = (int)movieId;
|
||||||
|
pagingSpec.FilterExpression = h => h.MovieId == i;
|
||||||
|
}
|
||||||
|
|
||||||
return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource);
|
return ApplyToPage(_historyService.Paged, pagingSpec, MapToResource);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||||||
using NzbDrone.Api.Episodes;
|
using NzbDrone.Api.Episodes;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.Series;
|
using NzbDrone.Api.Series;
|
||||||
|
using NzbDrone.Api.Movie;
|
||||||
using NzbDrone.Core.History;
|
using NzbDrone.Core.History;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
|
||||||
@@ -12,6 +13,7 @@ namespace NzbDrone.Api.History
|
|||||||
public class HistoryResource : RestResource
|
public class HistoryResource : RestResource
|
||||||
{
|
{
|
||||||
public int EpisodeId { get; set; }
|
public int EpisodeId { get; set; }
|
||||||
|
public int MovieId { get; set; }
|
||||||
public int SeriesId { get; set; }
|
public int SeriesId { get; set; }
|
||||||
public string SourceTitle { get; set; }
|
public string SourceTitle { get; set; }
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
@@ -22,7 +24,7 @@ namespace NzbDrone.Api.History
|
|||||||
public HistoryEventType EventType { get; set; }
|
public HistoryEventType EventType { get; set; }
|
||||||
|
|
||||||
public Dictionary<string, string> Data { get; set; }
|
public Dictionary<string, string> Data { get; set; }
|
||||||
|
public MovieResource Movie { get; set; }
|
||||||
public EpisodeResource Episode { get; set; }
|
public EpisodeResource Episode { get; set; }
|
||||||
public SeriesResource Series { get; set; }
|
public SeriesResource Series { get; set; }
|
||||||
}
|
}
|
||||||
@@ -39,6 +41,7 @@ namespace NzbDrone.Api.History
|
|||||||
|
|
||||||
EpisodeId = model.EpisodeId,
|
EpisodeId = model.EpisodeId,
|
||||||
SeriesId = model.SeriesId,
|
SeriesId = model.SeriesId,
|
||||||
|
MovieId = model.MovieId,
|
||||||
SourceTitle = model.SourceTitle,
|
SourceTitle = model.SourceTitle,
|
||||||
Quality = model.Quality,
|
Quality = model.Quality,
|
||||||
//QualityCutoffNotMet
|
//QualityCutoffNotMet
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.Indexers;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Indexers
|
namespace NzbDrone.Api.Indexers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Indexers;
|
||||||
using NzbDrone.Core.Indexers;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Indexers
|
namespace NzbDrone.Api.Indexers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ namespace NzbDrone.Api.Indexers
|
|||||||
private readonly Logger _logger;
|
private readonly Logger _logger;
|
||||||
|
|
||||||
private readonly ICached<RemoteEpisode> _remoteEpisodeCache;
|
private readonly ICached<RemoteEpisode> _remoteEpisodeCache;
|
||||||
|
private readonly ICached<RemoteMovie> _remoteMovieCache;
|
||||||
|
|
||||||
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
public ReleaseModule(IFetchAndParseRss rssFetcherAndParser,
|
||||||
ISearchForNzb nzbSearchService,
|
ISearchForNzb nzbSearchService,
|
||||||
@@ -49,6 +50,7 @@ namespace NzbDrone.Api.Indexers
|
|||||||
PostValidator.RuleFor(s => s.Guid).NotEmpty();
|
PostValidator.RuleFor(s => s.Guid).NotEmpty();
|
||||||
|
|
||||||
_remoteEpisodeCache = cacheManager.GetCache<RemoteEpisode>(GetType(), "remoteEpisodes");
|
_remoteEpisodeCache = cacheManager.GetCache<RemoteEpisode>(GetType(), "remoteEpisodes");
|
||||||
|
_remoteMovieCache = cacheManager.GetCache<RemoteMovie>(GetType(), "remoteMovies");
|
||||||
}
|
}
|
||||||
|
|
||||||
private Response DownloadRelease(ReleaseResource release)
|
private Response DownloadRelease(ReleaseResource release)
|
||||||
@@ -59,7 +61,26 @@ namespace NzbDrone.Api.Indexers
|
|||||||
{
|
{
|
||||||
_logger.Debug("Couldn't find requested release in cache, cache timeout probably expired.");
|
_logger.Debug("Couldn't find requested release in cache, cache timeout probably expired.");
|
||||||
|
|
||||||
return new NotFoundResponse();
|
var remoteMovie = _remoteMovieCache.Find(release.Guid);
|
||||||
|
|
||||||
|
if (remoteMovie == null)
|
||||||
|
{
|
||||||
|
return new NotFoundResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
_downloadService.DownloadReport(remoteMovie);
|
||||||
|
}
|
||||||
|
catch (ReleaseDownloadException ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex, ex.Message);
|
||||||
|
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
return release.AsResponse();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -82,6 +103,11 @@ namespace NzbDrone.Api.Indexers
|
|||||||
return GetEpisodeReleases(Request.Query.episodeId);
|
return GetEpisodeReleases(Request.Query.episodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Request.Query.movieId != null)
|
||||||
|
{
|
||||||
|
return GetMovieReleases(Request.Query.movieId);
|
||||||
|
}
|
||||||
|
|
||||||
return GetRss();
|
return GetRss();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,6 +128,27 @@ namespace NzbDrone.Api.Indexers
|
|||||||
return new List<ReleaseResource>();
|
return new List<ReleaseResource>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<ReleaseResource> GetMovieReleases(int movieId)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
var decisions = _nzbSearchService.MovieSearch(movieId, true);
|
||||||
|
var prioritizedDecisions = _prioritizeDownloadDecision.PrioritizeDecisionsForMovies(decisions);
|
||||||
|
|
||||||
|
return MapDecisions(prioritizedDecisions);
|
||||||
|
}
|
||||||
|
catch (NotImplementedException ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex, "One or more indexer you selected does not support movie search yet: " + ex.Message);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.Error(ex, "Movie search failed: " + ex.Message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return new List<ReleaseResource>();
|
||||||
|
}
|
||||||
|
|
||||||
private List<ReleaseResource> GetRss()
|
private List<ReleaseResource> GetRss()
|
||||||
{
|
{
|
||||||
var reports = _rssFetcherAndParser.Fetch();
|
var reports = _rssFetcherAndParser.Fetch();
|
||||||
@@ -113,7 +160,15 @@ namespace NzbDrone.Api.Indexers
|
|||||||
|
|
||||||
protected override ReleaseResource MapDecision(DownloadDecision decision, int initialWeight)
|
protected override ReleaseResource MapDecision(DownloadDecision decision, int initialWeight)
|
||||||
{
|
{
|
||||||
_remoteEpisodeCache.Set(decision.RemoteEpisode.Release.Guid, decision.RemoteEpisode, TimeSpan.FromMinutes(30));
|
if (decision.IsForMovie)
|
||||||
|
{
|
||||||
|
_remoteMovieCache.Set(decision.RemoteMovie.Release.Guid, decision.RemoteMovie, TimeSpan.FromMinutes(30));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_remoteEpisodeCache.Set(decision.RemoteEpisode.Release.Guid, decision.RemoteEpisode, TimeSpan.FromMinutes(30));
|
||||||
|
}
|
||||||
|
|
||||||
return base.MapDecision(decision, initialWeight);
|
return base.MapDecision(decision, initialWeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using NzbDrone.Core.DecisionEngine;
|
using NzbDrone.Core.DecisionEngine;
|
||||||
using NzbDrone.Core.Indexers;
|
|
||||||
using NzbDrone.Core.Parser.Model;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Indexers
|
namespace NzbDrone.Api.Indexers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using System.Linq;
|
|||||||
using NzbDrone.Core.Parser.Model;
|
using NzbDrone.Core.Parser.Model;
|
||||||
using NzbDrone.Api.Extensions;
|
using NzbDrone.Api.Extensions;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Core.Indexers;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Indexers
|
namespace NzbDrone.Api.Indexers
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ namespace NzbDrone.Api.Indexers
|
|||||||
public string Indexer { get; set; }
|
public string Indexer { get; set; }
|
||||||
public string ReleaseGroup { get; set; }
|
public string ReleaseGroup { get; set; }
|
||||||
public string ReleaseHash { get; set; }
|
public string ReleaseHash { get; set; }
|
||||||
|
public string Edition { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
public bool FullSeason { get; set; }
|
public bool FullSeason { get; set; }
|
||||||
public int SeasonNumber { get; set; }
|
public int SeasonNumber { get; set; }
|
||||||
@@ -86,6 +87,60 @@ namespace NzbDrone.Api.Indexers
|
|||||||
var parsedEpisodeInfo = model.RemoteEpisode.ParsedEpisodeInfo;
|
var parsedEpisodeInfo = model.RemoteEpisode.ParsedEpisodeInfo;
|
||||||
var remoteEpisode = model.RemoteEpisode;
|
var remoteEpisode = model.RemoteEpisode;
|
||||||
var torrentInfo = (model.RemoteEpisode.Release as TorrentInfo) ?? new TorrentInfo();
|
var torrentInfo = (model.RemoteEpisode.Release as TorrentInfo) ?? new TorrentInfo();
|
||||||
|
var downloadAllowed = model.RemoteEpisode.DownloadAllowed;
|
||||||
|
if (model.IsForMovie)
|
||||||
|
{
|
||||||
|
downloadAllowed = model.RemoteMovie.DownloadAllowed;
|
||||||
|
var parsedMovieInfo = model.RemoteMovie.ParsedMovieInfo;
|
||||||
|
|
||||||
|
return new ReleaseResource
|
||||||
|
{
|
||||||
|
Guid = releaseInfo.Guid,
|
||||||
|
Quality = parsedMovieInfo.Quality,
|
||||||
|
//QualityWeight
|
||||||
|
Age = releaseInfo.Age,
|
||||||
|
AgeHours = releaseInfo.AgeHours,
|
||||||
|
AgeMinutes = releaseInfo.AgeMinutes,
|
||||||
|
Size = releaseInfo.Size,
|
||||||
|
IndexerId = releaseInfo.IndexerId,
|
||||||
|
Indexer = releaseInfo.Indexer,
|
||||||
|
ReleaseGroup = parsedMovieInfo.ReleaseGroup,
|
||||||
|
ReleaseHash = parsedMovieInfo.ReleaseHash,
|
||||||
|
Title = releaseInfo.Title,
|
||||||
|
FullSeason = parsedMovieInfo.FullSeason,
|
||||||
|
SeasonNumber = parsedMovieInfo.SeasonNumber,
|
||||||
|
Language = parsedMovieInfo.Language,
|
||||||
|
AirDate = "",
|
||||||
|
SeriesTitle = parsedMovieInfo.MovieTitle,
|
||||||
|
EpisodeNumbers = new int[0],
|
||||||
|
AbsoluteEpisodeNumbers = new int[0],
|
||||||
|
Approved = model.Approved,
|
||||||
|
TemporarilyRejected = model.TemporarilyRejected,
|
||||||
|
Rejected = model.Rejected,
|
||||||
|
TvdbId = releaseInfo.TvdbId,
|
||||||
|
TvRageId = releaseInfo.TvRageId,
|
||||||
|
Rejections = model.Rejections.Select(r => r.Reason).ToList(),
|
||||||
|
PublishDate = releaseInfo.PublishDate,
|
||||||
|
CommentUrl = releaseInfo.CommentUrl,
|
||||||
|
DownloadUrl = releaseInfo.DownloadUrl,
|
||||||
|
InfoUrl = releaseInfo.InfoUrl,
|
||||||
|
DownloadAllowed = downloadAllowed,
|
||||||
|
//ReleaseWeight
|
||||||
|
|
||||||
|
MagnetUrl = torrentInfo.MagnetUrl,
|
||||||
|
InfoHash = torrentInfo.InfoHash,
|
||||||
|
Seeders = torrentInfo.Seeders,
|
||||||
|
Leechers = (torrentInfo.Peers.HasValue && torrentInfo.Seeders.HasValue) ? (torrentInfo.Peers.Value - torrentInfo.Seeders.Value) : (int?)null,
|
||||||
|
Protocol = releaseInfo.DownloadProtocol,
|
||||||
|
|
||||||
|
Edition = parsedMovieInfo.Edition,
|
||||||
|
|
||||||
|
IsDaily = false,
|
||||||
|
IsAbsoluteNumbering = false,
|
||||||
|
IsPossibleSpecialEpisode = false,
|
||||||
|
Special = parsedMovieInfo.Special,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Clean this mess up. don't mix data from multiple classes, use sub-resources instead? (Got a huge Deja Vu, didn't we talk about this already once?)
|
// TODO: Clean this mess up. don't mix data from multiple classes, use sub-resources instead? (Got a huge Deja Vu, didn't we talk about this already once?)
|
||||||
return new ReleaseResource
|
return new ReleaseResource
|
||||||
@@ -119,7 +174,7 @@ namespace NzbDrone.Api.Indexers
|
|||||||
CommentUrl = releaseInfo.CommentUrl,
|
CommentUrl = releaseInfo.CommentUrl,
|
||||||
DownloadUrl = releaseInfo.DownloadUrl,
|
DownloadUrl = releaseInfo.DownloadUrl,
|
||||||
InfoUrl = releaseInfo.InfoUrl,
|
InfoUrl = releaseInfo.InfoUrl,
|
||||||
DownloadAllowed = remoteEpisode.DownloadAllowed,
|
DownloadAllowed = downloadAllowed,
|
||||||
//ReleaseWeight
|
//ReleaseWeight
|
||||||
|
|
||||||
MagnetUrl = torrentInfo.MagnetUrl,
|
MagnetUrl = torrentInfo.MagnetUrl,
|
||||||
|
|||||||
@@ -31,13 +31,6 @@ namespace NzbDrone.Api.Logs
|
|||||||
return Path.Combine(_appFolderInfo.GetLogFolder(), filename);
|
return Path.Combine(_appFolderInfo.GetLogFolder(), filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string DownloadUrlRoot
|
protected override string DownloadUrlRoot => "logfile";
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "logfile";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Common.Disk;
|
using NzbDrone.Common.Disk;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Instrumentation;
|
||||||
using NzbDrone.Core.Instrumentation;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Logs
|
namespace NzbDrone.Api.Logs
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -38,12 +37,6 @@ namespace NzbDrone.Api.Logs
|
|||||||
return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename);
|
return Path.Combine(_appFolderInfo.GetUpdateLogFolder(), filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string DownloadUrlRoot
|
protected override string DownloadUrlRoot => "updatelogfile";
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return "updatelogfile";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Extras.Metadata;
|
||||||
using NzbDrone.Core.Metadata;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Metadata
|
namespace NzbDrone.Api.Metadata
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace NzbDrone.Api.Metadata
|
||||||
|
|
||||||
namespace NzbDrone.Api.Metadata
|
|
||||||
{
|
{
|
||||||
public class MetadataResource : ProviderResource
|
public class MetadataResource : ProviderResource
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
using System;
|
using System.Linq;
|
||||||
using System.Linq;
|
|
||||||
using Nancy;
|
|
||||||
using Nancy.Bootstrapper;
|
using Nancy.Bootstrapper;
|
||||||
using Nancy.Diagnostics;
|
using Nancy.Diagnostics;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Api.ErrorManagement;
|
|
||||||
using NzbDrone.Api.Extensions.Pipelines;
|
using NzbDrone.Api.Extensions.Pipelines;
|
||||||
using NzbDrone.Common.EnvironmentInfo;
|
using NzbDrone.Common.EnvironmentInfo;
|
||||||
using NzbDrone.Common.Instrumentation;
|
using NzbDrone.Common.Instrumentation;
|
||||||
@@ -55,17 +52,8 @@ namespace NzbDrone.Api
|
|||||||
return _tinyIoCContainer;
|
return _tinyIoCContainer;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override DiagnosticsConfiguration DiagnosticsConfiguration
|
protected override DiagnosticsConfiguration DiagnosticsConfiguration => new DiagnosticsConfiguration { Password = @"password" };
|
||||||
{
|
|
||||||
get { return new DiagnosticsConfiguration { Password = @"password" }; }
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override byte[] FavIcon
|
protected override byte[] FavIcon => null;
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using NzbDrone.Core.Notifications;
|
||||||
using NzbDrone.Core.Notifications;
|
|
||||||
|
|
||||||
namespace NzbDrone.Api.Notifications
|
namespace NzbDrone.Api.Notifications
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,36 +40,50 @@
|
|||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Reference Include="antlr.runtime, Version=2.7.6.2, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\antlr.runtime.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
<Reference Include="FluentValidation, Version=6.2.1.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="FluentValidation, Version=6.2.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\FluentValidation.6.2.1.0\lib\portable-net40+sl50+wp80+win8+wpa81\FluentValidation.dll</HintPath>
|
<HintPath>..\packages\FluentValidation.6.2.1.0\lib\portable-net40+sl50+wp80+win8+wpa81\FluentValidation.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Nancy, Version=0.23.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Ical.Net, Version=2.1.0.30332, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\Ical.Net.dll</HintPath>
|
||||||
<HintPath>..\packages\Nancy.0.23.2\lib\net40\Nancy.dll</HintPath>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Nancy.Authentication.Basic, Version=0.23.2.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Ical.Net.Collections, Version=2.1.0.30331, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\Ical.Net.Collections.dll</HintPath>
|
||||||
<HintPath>..\packages\Nancy.Authentication.Basic.0.23.2\lib\net40\Nancy.Authentication.Basic.dll</HintPath>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Nancy.Authentication.Forms">
|
<Reference Include="Nancy, Version=1.4.2.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\Nancy.Authentication.Forms.0.23.2\lib\net40\Nancy.Authentication.Forms.dll</HintPath>
|
<HintPath>..\packages\Nancy.1.4.3\lib\net40\Nancy.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nancy.Authentication.Basic, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Nancy.Authentication.Basic.1.4.1\lib\net40\Nancy.Authentication.Basic.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Nancy.Authentication.Forms, Version=1.4.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Nancy.Authentication.Forms.1.4.1\lib\net40\Nancy.Authentication.Forms.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
|
||||||
<HintPath>..\packages\NLog.4.3.4\lib\net40\NLog.dll</HintPath>
|
<HintPath>..\packages\NLog.4.3.11\lib\net40\NLog.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="NodaTime, Version=1.3.0.0, Culture=neutral, PublicKeyToken=4226afe0d9b296d1, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Ical.Net.2.2.25\lib\net40\NodaTime.dll</HintPath>
|
||||||
<Private>True</Private>
|
<Private>True</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="Microsoft.CSharp" />
|
<Reference Include="Microsoft.CSharp" />
|
||||||
<Reference Include="DDay.iCal">
|
|
||||||
<HintPath>..\packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll</HintPath>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System.Data.SQLite, Version=1.0.84.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
<Reference Include="System.Data.SQLite, Version=1.0.84.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\Libraries\Sqlite\System.Data.SQLite.dll</HintPath>
|
<HintPath>..\Libraries\Sqlite\System.Data.SQLite.dll</HintPath>
|
||||||
@@ -217,8 +231,11 @@
|
|||||||
<Compile Include="Series\SeasonResource.cs" />
|
<Compile Include="Series\SeasonResource.cs" />
|
||||||
<Compile Include="SeasonPass\SeasonPassModule.cs" />
|
<Compile Include="SeasonPass\SeasonPassModule.cs" />
|
||||||
<Compile Include="Series\SeriesEditorModule.cs" />
|
<Compile Include="Series\SeriesEditorModule.cs" />
|
||||||
|
<Compile Include="Series\MovieLookupModule.cs" />
|
||||||
<Compile Include="Series\SeriesLookupModule.cs" />
|
<Compile Include="Series\SeriesLookupModule.cs" />
|
||||||
|
<Compile Include="Series\MovieModule.cs" />
|
||||||
<Compile Include="Series\SeriesModule.cs" />
|
<Compile Include="Series\SeriesModule.cs" />
|
||||||
|
<Compile Include="Series\MovieResource.cs" />
|
||||||
<Compile Include="Series\SeriesResource.cs" />
|
<Compile Include="Series\SeriesResource.cs" />
|
||||||
<Compile Include="Series\SeasonStatisticsResource.cs" />
|
<Compile Include="Series\SeasonStatisticsResource.cs" />
|
||||||
<Compile Include="System\Backup\BackupModule.cs" />
|
<Compile Include="System\Backup\BackupModule.cs" />
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Linq;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.Validation;
|
using NzbDrone.Api.Validation;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using NzbDrone.Api.Episodes;
|
using NzbDrone.Api.Episodes;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Api.Series;
|
using NzbDrone.Api.Series;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using Newtonsoft.Json;
|
||||||
using Newtonsoft.Json;
|
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Profiles.Languages
|
namespace NzbDrone.Api.Profiles.Languages
|
||||||
@@ -9,6 +8,6 @@ namespace NzbDrone.Api.Profiles.Languages
|
|||||||
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
|
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Include)]
|
||||||
public new int Id { get; set; }
|
public new int Id { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string NameLower { get { return Name.ToLowerInvariant(); } }
|
public string NameLower => Name.ToLowerInvariant();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Text;
|
||||||
using System.Text;
|
|
||||||
using Nancy;
|
using Nancy;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Profiles
|
namespace NzbDrone.Api.Profiles
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using NzbDrone.Core.Profiles;
|
using NzbDrone.Core.Profiles;
|
||||||
using NzbDrone.Core.Qualities;
|
|
||||||
using NzbDrone.Core.Validation;
|
using NzbDrone.Core.Validation;
|
||||||
|
|
||||||
namespace NzbDrone.Api.Profiles
|
namespace NzbDrone.Api.Profiles
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.Parser;
|
using NzbDrone.Core.Parser;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using NzbDrone.Api.REST;
|
|||||||
using NzbDrone.Core.Qualities;
|
using NzbDrone.Core.Qualities;
|
||||||
using NzbDrone.Api.Series;
|
using NzbDrone.Api.Series;
|
||||||
using NzbDrone.Api.Episodes;
|
using NzbDrone.Api.Episodes;
|
||||||
|
using NzbDrone.Api.Movie;
|
||||||
using NzbDrone.Core.Download.TrackedDownloads;
|
using NzbDrone.Core.Download.TrackedDownloads;
|
||||||
using NzbDrone.Core.Indexers;
|
using NzbDrone.Core.Indexers;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
@@ -14,6 +15,7 @@ namespace NzbDrone.Api.Queue
|
|||||||
{
|
{
|
||||||
public SeriesResource Series { get; set; }
|
public SeriesResource Series { get; set; }
|
||||||
public EpisodeResource Episode { get; set; }
|
public EpisodeResource Episode { get; set; }
|
||||||
|
public MovieResource Movie { get; set; }
|
||||||
public QualityModel Quality { get; set; }
|
public QualityModel Quality { get; set; }
|
||||||
public decimal Size { get; set; }
|
public decimal Size { get; set; }
|
||||||
public string Title { get; set; }
|
public string Title { get; set; }
|
||||||
@@ -49,7 +51,8 @@ namespace NzbDrone.Api.Queue
|
|||||||
TrackedDownloadStatus = model.TrackedDownloadStatus,
|
TrackedDownloadStatus = model.TrackedDownloadStatus,
|
||||||
StatusMessages = model.StatusMessages,
|
StatusMessages = model.StatusMessages,
|
||||||
DownloadId = model.DownloadId,
|
DownloadId = model.DownloadId,
|
||||||
Protocol = model.Protocol
|
Protocol = model.Protocol,
|
||||||
|
Movie = model.Movie.ToResource()
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,12 +8,6 @@ namespace NzbDrone.Api.REST
|
|||||||
public int Id { get; set; }
|
public int Id { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public virtual string ResourceName
|
public virtual string ResourceName => GetType().Name.ToLowerInvariant().Replace("resource", "");
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
return GetType().Name.ToLower().Replace("resource", "");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.RemotePathMappings;
|
using NzbDrone.Core.RemotePathMappings;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using FluentValidation.Results;
|
using FluentValidation.Results;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
using NzbDrone.Core.Restrictions;
|
using NzbDrone.Core.Restrictions;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.Restrictions;
|
using NzbDrone.Core.Restrictions;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Api.REST;
|
using NzbDrone.Api.REST;
|
||||||
using NzbDrone.Core.RootFolders;
|
using NzbDrone.Core.RootFolders;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using System.Collections.Generic;
|
using Nancy;
|
||||||
using Nancy;
|
|
||||||
using NzbDrone.Api.Extensions;
|
using NzbDrone.Api.Extensions;
|
||||||
using NzbDrone.Core.Tv;
|
using NzbDrone.Core.Tv;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
using System;
|
namespace NzbDrone.Api.Series
|
||||||
|
|
||||||
namespace NzbDrone.Api.Series
|
|
||||||
{
|
{
|
||||||
public class AlternateTitleResource
|
public class AlternateTitleResource
|
||||||
{
|
{
|
||||||
|
|||||||
44
src/NzbDrone.Api/Series/MovieLookupModule.cs
Normal file
44
src/NzbDrone.Api/Series/MovieLookupModule.cs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Nancy;
|
||||||
|
using NzbDrone.Api.Extensions;
|
||||||
|
using NzbDrone.Core.MediaCover;
|
||||||
|
using NzbDrone.Core.MetadataSource;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace NzbDrone.Api.Movie
|
||||||
|
{
|
||||||
|
public class MovieLookupModule : NzbDroneRestModule<MovieResource>
|
||||||
|
{
|
||||||
|
private readonly ISearchForNewMovie _searchProxy;
|
||||||
|
|
||||||
|
public MovieLookupModule(ISearchForNewMovie searchProxy)
|
||||||
|
: base("/movies/lookup")
|
||||||
|
{
|
||||||
|
_searchProxy = searchProxy;
|
||||||
|
Get["/"] = x => Search();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private Response Search()
|
||||||
|
{
|
||||||
|
var imdbResults = _searchProxy.SearchForNewMovie((string)Request.Query.term);
|
||||||
|
return MapToResource(imdbResults).AsResponse();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private static IEnumerable<MovieResource> MapToResource(IEnumerable<Core.Tv.Movie> movies)
|
||||||
|
{
|
||||||
|
foreach (var currentSeries in movies)
|
||||||
|
{
|
||||||
|
var resource = currentSeries.ToResource();
|
||||||
|
var poster = currentSeries.Images.FirstOrDefault(c => c.CoverType == MediaCoverTypes.Poster);
|
||||||
|
if (poster != null)
|
||||||
|
{
|
||||||
|
resource.RemotePoster = poster.Url;
|
||||||
|
}
|
||||||
|
|
||||||
|
yield return resource;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
225
src/NzbDrone.Api/Series/MovieModule.cs
Normal file
225
src/NzbDrone.Api/Series/MovieModule.cs
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using FluentValidation;
|
||||||
|
using NzbDrone.Common.Extensions;
|
||||||
|
using NzbDrone.Core.Datastore.Events;
|
||||||
|
using NzbDrone.Core.MediaCover;
|
||||||
|
using NzbDrone.Core.MediaFiles;
|
||||||
|
using NzbDrone.Core.MediaFiles.Events;
|
||||||
|
using NzbDrone.Core.Messaging.Events;
|
||||||
|
using NzbDrone.Core.MovieStats;
|
||||||
|
using NzbDrone.Core.Tv;
|
||||||
|
using NzbDrone.Core.Tv.Events;
|
||||||
|
using NzbDrone.Core.Validation.Paths;
|
||||||
|
using NzbDrone.Core.DataAugmentation.Scene;
|
||||||
|
using NzbDrone.Core.Validation;
|
||||||
|
using NzbDrone.SignalR;
|
||||||
|
|
||||||
|
namespace NzbDrone.Api.Movie
|
||||||
|
{
|
||||||
|
public class MovieModule : NzbDroneRestModuleWithSignalR<MovieResource, Core.Tv.Movie>,
|
||||||
|
IHandle<EpisodeImportedEvent>,
|
||||||
|
IHandle<EpisodeFileDeletedEvent>,
|
||||||
|
IHandle<MovieUpdatedEvent>,
|
||||||
|
IHandle<MovieEditedEvent>,
|
||||||
|
IHandle<MovieDeletedEvent>,
|
||||||
|
IHandle<MovieRenamedEvent>,
|
||||||
|
IHandle<MediaCoversUpdatedEvent>
|
||||||
|
|
||||||
|
{
|
||||||
|
private readonly IMovieService _moviesService;
|
||||||
|
private readonly IMovieStatisticsService _moviesStatisticsService;
|
||||||
|
private readonly IMapCoversToLocal _coverMapper;
|
||||||
|
|
||||||
|
public MovieModule(IBroadcastSignalRMessage signalRBroadcaster,
|
||||||
|
IMovieService moviesService,
|
||||||
|
IMovieStatisticsService moviesStatisticsService,
|
||||||
|
ISceneMappingService sceneMappingService,
|
||||||
|
IMapCoversToLocal coverMapper,
|
||||||
|
RootFolderValidator rootFolderValidator,
|
||||||
|
MoviePathValidator moviesPathValidator,
|
||||||
|
MovieExistsValidator moviesExistsValidator,
|
||||||
|
DroneFactoryValidator droneFactoryValidator,
|
||||||
|
MovieAncestorValidator moviesAncestorValidator,
|
||||||
|
ProfileExistsValidator profileExistsValidator
|
||||||
|
)
|
||||||
|
: base(signalRBroadcaster)
|
||||||
|
{
|
||||||
|
_moviesService = moviesService;
|
||||||
|
_moviesStatisticsService = moviesStatisticsService;
|
||||||
|
|
||||||
|
_coverMapper = coverMapper;
|
||||||
|
|
||||||
|
GetResourceAll = AllMovie;
|
||||||
|
GetResourceById = GetMovie;
|
||||||
|
CreateResource = AddMovie;
|
||||||
|
UpdateResource = UpdateMovie;
|
||||||
|
DeleteResource = DeleteMovie;
|
||||||
|
|
||||||
|
Validation.RuleBuilderExtensions.ValidId(SharedValidator.RuleFor(s => s.ProfileId));
|
||||||
|
|
||||||
|
SharedValidator.RuleFor(s => s.Path)
|
||||||
|
.Cascade(CascadeMode.StopOnFirstFailure)
|
||||||
|
.IsValidPath()
|
||||||
|
.SetValidator(rootFolderValidator)
|
||||||
|
.SetValidator(moviesPathValidator)
|
||||||
|
.SetValidator(droneFactoryValidator)
|
||||||
|
.SetValidator(moviesAncestorValidator)
|
||||||
|
.When(s => !s.Path.IsNullOrWhiteSpace());
|
||||||
|
|
||||||
|
SharedValidator.RuleFor(s => s.ProfileId).SetValidator(profileExistsValidator);
|
||||||
|
|
||||||
|
PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace());
|
||||||
|
PostValidator.RuleFor(s => s.RootFolderPath).IsValidPath().When(s => s.Path.IsNullOrWhiteSpace());
|
||||||
|
PostValidator.RuleFor(s => s.Title).NotEmpty();
|
||||||
|
PostValidator.RuleFor(s => s.TmdbId).NotNull().NotEmpty().SetValidator(moviesExistsValidator);
|
||||||
|
|
||||||
|
PutValidator.RuleFor(s => s.Path).IsValidPath();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MovieResource GetMovie(int id)
|
||||||
|
{
|
||||||
|
var movies = _moviesService.GetMovie(id);
|
||||||
|
return MapToResource(movies);
|
||||||
|
}
|
||||||
|
|
||||||
|
private MovieResource MapToResource(Core.Tv.Movie movies)
|
||||||
|
{
|
||||||
|
if (movies == null) return null;
|
||||||
|
|
||||||
|
var resource = movies.ToResource();
|
||||||
|
MapCoversToLocal(resource);
|
||||||
|
FetchAndLinkMovieStatistics(resource);
|
||||||
|
PopulateAlternateTitles(resource);
|
||||||
|
|
||||||
|
return resource;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<MovieResource> AllMovie()
|
||||||
|
{
|
||||||
|
var moviesStats = _moviesStatisticsService.MovieStatistics();
|
||||||
|
var moviesResources = _moviesService.GetAllMovies().ToResource();
|
||||||
|
|
||||||
|
MapCoversToLocal(moviesResources.ToArray());
|
||||||
|
LinkMovieStatistics(moviesResources, moviesStats);
|
||||||
|
PopulateAlternateTitles(moviesResources);
|
||||||
|
|
||||||
|
return moviesResources;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int AddMovie(MovieResource moviesResource)
|
||||||
|
{
|
||||||
|
var model = moviesResource.ToModel();
|
||||||
|
|
||||||
|
return _moviesService.AddMovie(model).Id;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateMovie(MovieResource moviesResource)
|
||||||
|
{
|
||||||
|
var model = moviesResource.ToModel(_moviesService.GetMovie(moviesResource.Id));
|
||||||
|
|
||||||
|
_moviesService.UpdateMovie(model);
|
||||||
|
|
||||||
|
BroadcastResourceChange(ModelAction.Updated, moviesResource);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DeleteMovie(int id)
|
||||||
|
{
|
||||||
|
var deleteFiles = false;
|
||||||
|
var deleteFilesQuery = Request.Query.deleteFiles;
|
||||||
|
|
||||||
|
if (deleteFilesQuery.HasValue)
|
||||||
|
{
|
||||||
|
deleteFiles = Convert.ToBoolean(deleteFilesQuery.Value);
|
||||||
|
}
|
||||||
|
|
||||||
|
_moviesService.DeleteMovie(id, deleteFiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MapCoversToLocal(params MovieResource[] movies)
|
||||||
|
{
|
||||||
|
foreach (var moviesResource in movies)
|
||||||
|
{
|
||||||
|
_coverMapper.ConvertToLocalUrls(moviesResource.Id, moviesResource.Images);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void FetchAndLinkMovieStatistics(MovieResource resource)
|
||||||
|
{
|
||||||
|
LinkMovieStatistics(resource, _moviesStatisticsService.MovieStatistics(resource.Id));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkMovieStatistics(List<MovieResource> resources, List<MovieStatistics> moviesStatistics)
|
||||||
|
{
|
||||||
|
var dictMovieStats = moviesStatistics.ToDictionary(v => v.MovieId);
|
||||||
|
|
||||||
|
foreach (var movies in resources)
|
||||||
|
{
|
||||||
|
var stats = dictMovieStats.GetValueOrDefault(movies.Id);
|
||||||
|
if (stats == null) continue;
|
||||||
|
|
||||||
|
LinkMovieStatistics(movies, stats);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LinkMovieStatistics(MovieResource resource, MovieStatistics moviesStatistics)
|
||||||
|
{
|
||||||
|
resource.SizeOnDisk = moviesStatistics.SizeOnDisk;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PopulateAlternateTitles(List<MovieResource> resources)
|
||||||
|
{
|
||||||
|
foreach (var resource in resources)
|
||||||
|
{
|
||||||
|
PopulateAlternateTitles(resource);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PopulateAlternateTitles(MovieResource resource)
|
||||||
|
{
|
||||||
|
//var mappings = null;//_sceneMappingService.FindByTvdbId(resource.TvdbId);
|
||||||
|
|
||||||
|
//if (mappings == null) return;
|
||||||
|
|
||||||
|
//resource.AlternateTitles = mappings.Select(v => new AlternateTitleResource { Title = v.Title, SeasonNumber = v.SeasonNumber, SceneSeasonNumber = v.SceneSeasonNumber }).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(EpisodeImportedEvent message)
|
||||||
|
{
|
||||||
|
//BroadcastResourceChange(ModelAction.Updated, message.ImportedEpisode.MovieId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(EpisodeFileDeletedEvent message)
|
||||||
|
{
|
||||||
|
if (message.Reason == DeleteMediaFileReason.Upgrade) return;
|
||||||
|
|
||||||
|
//BroadcastResourceChange(ModelAction.Updated, message.EpisodeFile.MovieId);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(MovieUpdatedEvent message)
|
||||||
|
{
|
||||||
|
BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(MovieEditedEvent message)
|
||||||
|
{
|
||||||
|
BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(MovieDeletedEvent message)
|
||||||
|
{
|
||||||
|
BroadcastResourceChange(ModelAction.Deleted, message.Movie.ToResource());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(MovieRenamedEvent message)
|
||||||
|
{
|
||||||
|
BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Handle(MediaCoversUpdatedEvent message)
|
||||||
|
{
|
||||||
|
//BroadcastResourceChange(ModelAction.Updated, message.Movie.Id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
192
src/NzbDrone.Api/Series/MovieResource.cs
Normal file
192
src/NzbDrone.Api/Series/MovieResource.cs
Normal file
@@ -0,0 +1,192 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using NzbDrone.Api.REST;
|
||||||
|
using NzbDrone.Core.MediaCover;
|
||||||
|
using NzbDrone.Core.Tv;
|
||||||
|
using NzbDrone.Api.Series;
|
||||||
|
|
||||||
|
namespace NzbDrone.Api.Movie
|
||||||
|
{
|
||||||
|
public class MovieResource : RestResource
|
||||||
|
{
|
||||||
|
public MovieResource()
|
||||||
|
{
|
||||||
|
Monitored = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Todo: Sorters should be done completely on the client
|
||||||
|
//Todo: Is there an easy way to keep IgnoreArticlesWhenSorting in sync between, Series, History, Missing?
|
||||||
|
//Todo: We should get the entire Profile instead of ID and Name separately
|
||||||
|
|
||||||
|
//View Only
|
||||||
|
public string Title { get; set; }
|
||||||
|
public List<AlternateTitleResource> AlternateTitles { get; set; }
|
||||||
|
public string SortTitle { get; set; }
|
||||||
|
public long? SizeOnDisk { get; set; }
|
||||||
|
public MovieStatusType Status { get; set; }
|
||||||
|
public string Overview { get; set; }
|
||||||
|
public DateTime? InCinemas { get; set; }
|
||||||
|
public List<MediaCover> Images { get; set; }
|
||||||
|
public string Website { get; set; }
|
||||||
|
|
||||||
|
public string RemotePoster { get; set; }
|
||||||
|
public int Year { get; set; }
|
||||||
|
|
||||||
|
//View & Edit
|
||||||
|
public string Path { get; set; }
|
||||||
|
public int ProfileId { get; set; }
|
||||||
|
|
||||||
|
//Editing Only
|
||||||
|
public bool Monitored { get; set; }
|
||||||
|
public int Runtime { get; set; }
|
||||||
|
public DateTime? LastInfoSync { get; set; }
|
||||||
|
public string CleanTitle { get; set; }
|
||||||
|
public string ImdbId { get; set; }
|
||||||
|
public int TmdbId { get; set; }
|
||||||
|
public string TitleSlug { get; set; }
|
||||||
|
public string RootFolderPath { get; set; }
|
||||||
|
public string Certification { get; set; }
|
||||||
|
public List<string> Genres { get; set; }
|
||||||
|
public HashSet<int> Tags { get; set; }
|
||||||
|
public DateTime Added { get; set; }
|
||||||
|
public AddMovieOptions AddOptions { get; set; }
|
||||||
|
public Ratings Ratings { get; set; }
|
||||||
|
public List<string> AlternativeTitles { get; set; }
|
||||||
|
|
||||||
|
//TODO: Add series statistics as a property of the series (instead of individual properties)
|
||||||
|
|
||||||
|
//Used to support legacy consumers
|
||||||
|
public int QualityProfileId
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return ProfileId;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value > 0 && ProfileId == 0)
|
||||||
|
{
|
||||||
|
ProfileId = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class MovieResourceMapper
|
||||||
|
{
|
||||||
|
public static MovieResource ToResource(this Core.Tv.Movie model)
|
||||||
|
{
|
||||||
|
if (model == null) return null;
|
||||||
|
|
||||||
|
return new MovieResource
|
||||||
|
{
|
||||||
|
Id = model.Id,
|
||||||
|
TmdbId = model.TmdbId,
|
||||||
|
Title = model.Title,
|
||||||
|
//AlternateTitles
|
||||||
|
SortTitle = model.SortTitle,
|
||||||
|
InCinemas = model.InCinemas,
|
||||||
|
//TotalEpisodeCount
|
||||||
|
//EpisodeCount
|
||||||
|
//EpisodeFileCount
|
||||||
|
//SizeOnDisk
|
||||||
|
Status = model.Status,
|
||||||
|
Overview = model.Overview,
|
||||||
|
//NextAiring
|
||||||
|
//PreviousAiring
|
||||||
|
Images = model.Images,
|
||||||
|
|
||||||
|
Year = model.Year,
|
||||||
|
|
||||||
|
Path = model.Path,
|
||||||
|
ProfileId = model.ProfileId,
|
||||||
|
|
||||||
|
Monitored = model.Monitored,
|
||||||
|
|
||||||
|
Runtime = model.Runtime,
|
||||||
|
LastInfoSync = model.LastInfoSync,
|
||||||
|
CleanTitle = model.CleanTitle,
|
||||||
|
ImdbId = model.ImdbId,
|
||||||
|
TitleSlug = model.TitleSlug,
|
||||||
|
RootFolderPath = model.RootFolderPath,
|
||||||
|
Certification = model.Certification,
|
||||||
|
Website = model.Website,
|
||||||
|
Genres = model.Genres,
|
||||||
|
Tags = model.Tags,
|
||||||
|
Added = model.Added,
|
||||||
|
AddOptions = model.AddOptions,
|
||||||
|
AlternativeTitles = model.AlternativeTitles,
|
||||||
|
Ratings = model.Ratings
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Core.Tv.Movie ToModel(this MovieResource resource)
|
||||||
|
{
|
||||||
|
if (resource == null) return null;
|
||||||
|
|
||||||
|
return new Core.Tv.Movie
|
||||||
|
{
|
||||||
|
Id = resource.Id,
|
||||||
|
TmdbId = resource.TmdbId,
|
||||||
|
|
||||||
|
Title = resource.Title,
|
||||||
|
//AlternateTitles
|
||||||
|
SortTitle = resource.SortTitle,
|
||||||
|
InCinemas = resource.InCinemas,
|
||||||
|
//TotalEpisodeCount
|
||||||
|
//EpisodeCount
|
||||||
|
//EpisodeFileCount
|
||||||
|
//SizeOnDisk
|
||||||
|
Overview = resource.Overview,
|
||||||
|
//NextAiring
|
||||||
|
//PreviousAiring
|
||||||
|
Images = resource.Images,
|
||||||
|
|
||||||
|
Year = resource.Year,
|
||||||
|
|
||||||
|
Path = resource.Path,
|
||||||
|
ProfileId = resource.ProfileId,
|
||||||
|
|
||||||
|
Monitored = resource.Monitored,
|
||||||
|
|
||||||
|
Runtime = resource.Runtime,
|
||||||
|
LastInfoSync = resource.LastInfoSync,
|
||||||
|
CleanTitle = resource.CleanTitle,
|
||||||
|
ImdbId = resource.ImdbId,
|
||||||
|
TitleSlug = resource.TitleSlug,
|
||||||
|
RootFolderPath = resource.RootFolderPath,
|
||||||
|
Certification = resource.Certification,
|
||||||
|
Website = resource.Website,
|
||||||
|
Genres = resource.Genres,
|
||||||
|
Tags = resource.Tags,
|
||||||
|
Added = resource.Added,
|
||||||
|
AddOptions = resource.AddOptions,
|
||||||
|
AlternativeTitles = resource.AlternativeTitles,
|
||||||
|
Ratings = resource.Ratings
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Core.Tv.Movie ToModel(this MovieResource resource, Core.Tv.Movie movie)
|
||||||
|
{
|
||||||
|
movie.ImdbId = resource.ImdbId;
|
||||||
|
movie.TmdbId = resource.TmdbId;
|
||||||
|
|
||||||
|
movie.Path = resource.Path;
|
||||||
|
movie.ProfileId = resource.ProfileId;
|
||||||
|
|
||||||
|
movie.Monitored = resource.Monitored;
|
||||||
|
|
||||||
|
movie.RootFolderPath = resource.RootFolderPath;
|
||||||
|
movie.Tags = resource.Tags;
|
||||||
|
movie.AddOptions = resource.AddOptions;
|
||||||
|
|
||||||
|
return movie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<MovieResource> ToResource(this IEnumerable<Core.Tv.Movie> movies)
|
||||||
|
{
|
||||||
|
return movies.Select(ToResource).ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,4 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using NzbDrone.Core.Datastore.Events;
|
using NzbDrone.Core.Datastore.Events;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using NzbDrone.Core.Tags;
|
using NzbDrone.Core.Tags;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user