From 7af88037bbef45b6b70d15a6c2a431e31ba6073e Mon Sep 17 00:00:00 2001 From: Mitchell Cash Date: Sun, 11 Jun 2017 17:30:00 +1000 Subject: [PATCH 1/4] Fixed: Ensure an API Key is set when starting Radarr (#1652) --- .../Configuration/ConfigFileProvider.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 4b7543d5f..086cdac0f 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -141,7 +141,21 @@ public string BindAddress public bool LaunchBrowser => GetValueBoolean("LaunchBrowser", true); - public string ApiKey => GetValue("ApiKey", GenerateApiKey()); + public string ApiKey + { + get + { + var apiKey = GetValue("ApiKey", GenerateApiKey()); + + if (apiKey.IsNullOrWhiteSpace()) + { + apiKey = GenerateApiKey(); + SetValue("ApiKey", apiKey); + } + + return apiKey; + } + } public AuthenticationType AuthenticationMethod { From 28b523b504b438516f6a3621daca22ac35df36d5 Mon Sep 17 00:00:00 2001 From: Mitchell Cash Date: Sun, 11 Jun 2017 17:30:51 +1000 Subject: [PATCH 2/4] Fixed: Follow 301 redirects when fetching torrents (#1653) Closes #1564 --- src/NzbDrone.Core/Download/TorrentClientBase.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/NzbDrone.Core/Download/TorrentClientBase.cs b/src/NzbDrone.Core/Download/TorrentClientBase.cs index 70681f992..9ad0e0bda 100644 --- a/src/NzbDrone.Core/Download/TorrentClientBase.cs +++ b/src/NzbDrone.Core/Download/TorrentClientBase.cs @@ -33,7 +33,7 @@ protected TorrentClientBase(ITorrentFileInfoReader torrentFileInfoReader, _httpClient = httpClient; _torrentFileInfoReader = torrentFileInfoReader; } - + public override DownloadProtocol Protocol => DownloadProtocol.Torrent; public virtual bool PreferTorrentFile => false; @@ -149,7 +149,7 @@ public override string Download(RemoteEpisode remoteMovie) { magnetUrl = torrentInfo.MagnetUrl; } - + if (PreferTorrentFile) { if (torrentUrl.IsNotNullOrWhiteSpace()) @@ -221,7 +221,9 @@ private string DownloadFromWebUrl(RemoteMovie remoteEpisode, string torrentUrl) var response = _httpClient.Get(request); - if (response.StatusCode == HttpStatusCode.SeeOther || response.StatusCode == HttpStatusCode.Found) + if (response.StatusCode == HttpStatusCode.MovedPermanently || + response.StatusCode == HttpStatusCode.Found || + response.StatusCode == HttpStatusCode.SeeOther) { var locationHeader = response.Headers.GetSingleValue("Location"); @@ -321,7 +323,9 @@ private string DownloadFromWebUrl(RemoteEpisode remoteEpisode, string torrentUrl var response = _httpClient.Get(request); - if (response.StatusCode == HttpStatusCode.SeeOther || response.StatusCode == HttpStatusCode.Found) + if (response.StatusCode == HttpStatusCode.MovedPermanently || + response.StatusCode == HttpStatusCode.Found || + response.StatusCode == HttpStatusCode.SeeOther) { var locationHeader = response.Headers.GetSingleValue("Location"); From a620c4b5d848241cde29e3625bb06557bdde234c Mon Sep 17 00:00:00 2001 From: Mitchell Cash Date: Sun, 11 Jun 2017 17:31:27 +1000 Subject: [PATCH 3/4] Changed: Use cleancss for minification (#1654) --- gulp/less.js | 7 ++++--- package.json | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gulp/less.js b/gulp/less.js index 92d50a43e..e86f12f6c 100644 --- a/gulp/less.js +++ b/gulp/less.js @@ -5,7 +5,7 @@ var postcss = require('gulp-postcss'); var sourcemaps = require('gulp-sourcemaps'); var autoprefixer = require('autoprefixer-core'); var livereload = require('gulp-livereload'); - +var cleancss = require('gulp-clean-css'); var print = require('gulp-print'); var paths = require('./paths'); var errorHandler = require('./errorHandler'); @@ -36,12 +36,13 @@ gulp.task('less', function() { .pipe(sourcemaps.init()) .pipe(less({ dumpLineNumbers : 'false', - compress : true, - yuicompress : true, + compress : false, + yuicompress : false, ieCompat : true, strictImports : true })) .pipe(postcss([ autoprefixer({ browsers: ['last 2 versions'] }) ])) + .pipe(cleancss()) .on('error', errorHandler.onError) .pipe(sourcemaps.write(paths.dest.content)) .pipe(gulp.dest(paths.dest.content)) diff --git a/package.json b/package.json index 45f05450c..1db238240 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "del": "1.2.0", "gulp": "3.9.0", "gulp-cached": "1.1.0", + "gulp-clean-css": "^3.0.4", "gulp-concat": "2.6.0", "gulp-declare": "0.3.0", "gulp-handlebars": "3.0.1", From b1c5dd8167475e1736a17f499c1371bdc7831a0c Mon Sep 17 00:00:00 2001 From: Mitchell Cash Date: Sun, 11 Jun 2017 17:32:12 +1000 Subject: [PATCH 4/4] Changed: Remove redundant IE meta tag as we use http header instead (#1655) --- src/UI/index.html | 1 - src/UI/login.html | 1 - 2 files changed, 2 deletions(-) diff --git a/src/UI/index.html b/src/UI/index.html index 5d2bb4e54..72c1626a7 100644 --- a/src/UI/index.html +++ b/src/UI/index.html @@ -2,7 +2,6 @@ Radarr - diff --git a/src/UI/login.html b/src/UI/login.html index a73b84b38..124b4a0cd 100644 --- a/src/UI/login.html +++ b/src/UI/login.html @@ -2,7 +2,6 @@ Radarr - Login -