From 7fafefbe9982b0d55a7141c560d7fda92718f467 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Fri, 24 Jan 2014 14:03:39 -0800 Subject: [PATCH 1/8] updated readme --- readme.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.md b/readme.md index 6d966203d..5c40aa75d 100644 --- a/readme.md +++ b/readme.md @@ -42,3 +42,7 @@ NZBDrone is a PVR for newsgroup users. It can monitor multiple RSS feeds for new ## License * [GNU GPL v3](http://www.gnu.org/licenses/gpl.html) Copyright 2010-2013 + + +### Sponsers +####JetBrains##### for providing us with free licenses From e205e5a77eb29cefa244680c776826a0813bf082 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Fri, 24 Jan 2014 14:03:50 -0800 Subject: [PATCH 2/8] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 5c40aa75d..477bde5d5 100644 --- a/readme.md +++ b/readme.md @@ -45,4 +45,4 @@ Copyright 2010-2013 ### Sponsers -####JetBrains##### for providing us with free licenses +####JetBrains for providing us with free licenses From 9c9839ea299bcaa0826ea6fcb00c2dd1c02bc0bb Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Fri, 24 Jan 2014 14:04:12 -0800 Subject: [PATCH 3/8] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 477bde5d5..8d46e5e0f 100644 --- a/readme.md +++ b/readme.md @@ -45,4 +45,4 @@ Copyright 2010-2013 ### Sponsers -####JetBrains for providing us with free licenses +####JetBrains for providing us with free licenses to their great tools From 6b90a3a1eb4bf795170914fd8b907660a653a5dd Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Jan 2014 08:23:03 -0800 Subject: [PATCH 4/8] Fixed: Clean series title in season folder of reserved characters --- src/NzbDrone.Core/Organizer/FileNameBuilder.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index fa156552a..72a4ab75c 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -175,6 +175,8 @@ namespace NzbDrone.Core.Organizer seasonFolder = ReplaceTokens(seasonFolder, tokenValues); } + seasonFolder = CleanFilename(seasonFolder); + path = Path.Combine(path, seasonFolder); } From 8292d4d2674f6c8dfc3874ccdbed59601af92c22 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Jan 2014 08:35:05 -0800 Subject: [PATCH 5/8] Fixed: API Authentication issues with Apache Basic Auth --- .../Authentication/EnableStatelessAuthInNancy.cs | 5 ++++- src/UI/Mixins/jquery.ajax.js | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Api/Authentication/EnableStatelessAuthInNancy.cs b/src/NzbDrone.Api/Authentication/EnableStatelessAuthInNancy.cs index 82ace5314..34d59ad94 100644 --- a/src/NzbDrone.Api/Authentication/EnableStatelessAuthInNancy.cs +++ b/src/NzbDrone.Api/Authentication/EnableStatelessAuthInNancy.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Nancy; using Nancy.Bootstrapper; using NzbDrone.Api.Extensions; @@ -33,7 +34,9 @@ namespace NzbDrone.Api.Authentication return response; } - var apiKey = context.Request.Headers.Authorization; + var authorizationHeader = context.Request.Headers.Authorization; + var apiKeyHeader = context.Request.Headers["X-Api-Key"].FirstOrDefault(); + var apiKey = String.IsNullOrWhiteSpace(apiKeyHeader) ? authorizationHeader : apiKeyHeader; if (context.Request.IsApiRequest() && !ValidApiKey(apiKey) && !_authenticationService.IsAuthenticated(context)) { diff --git a/src/UI/Mixins/jquery.ajax.js b/src/UI/Mixins/jquery.ajax.js index 0fe0b047f..5105d8ae8 100644 --- a/src/UI/Mixins/jquery.ajax.js +++ b/src/UI/Mixins/jquery.ajax.js @@ -25,7 +25,7 @@ define( if (xhr) { xhr.headers = xhr.headers || {}; - xhr.headers.Authorization = window.NzbDrone.ApiKey; + xhr.headers['X-Api-Key'] = window.NzbDrone.ApiKey; } return original.apply(this, arguments); From a228bd8f1c94c05eff88fd928cba49ae7412f432 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Jan 2014 11:26:41 -0800 Subject: [PATCH 6/8] Added test for series folder name --- .../OrganizerTests/BuildFilePathFixture.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs b/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs index 11866ea54..b7821aaf8 100644 --- a/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs +++ b/src/NzbDrone.Core.Test/OrganizerTests/BuildFilePathFixture.cs @@ -43,5 +43,23 @@ namespace NzbDrone.Core.Test.OrganizerTests Subject.BuildFilePath(fakeSeries, seasonNumber, filename, ".mkv").Should().Be(expectedPath.AsOsAgnostic()); } + + [Test] + public void should_clean_season_folder_when_it_contains_illegal_characters_in_series_title() + { + var filename = @"S01E05 - Episode Title"; + var seasonNumber = 1; + var expectedPath = @"C:\Test\NCIS- Los Angeles\NCIS- Los Angeles Season 1\S01E05 - Episode Title.mkv"; + + var fakeSeries = Builder.CreateNew() + .With(s => s.Title = "NCIS: Los Angeles") + .With(s => s.Path = @"C:\Test\NCIS- Los Angeles".AsOsAgnostic()) + .With(s => s.SeasonFolder = true) + .Build(); + + namingConfig.SeasonFolderFormat = "{Series Title} Season {season:0}"; + + Subject.BuildFilePath(fakeSeries, seasonNumber, filename, ".mkv").Should().Be(expectedPath.AsOsAgnostic()); + } } } \ No newline at end of file From 204015d4caa57aff2dd8ca79ef349bb025a6c6fd Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Jan 2014 14:13:18 -0800 Subject: [PATCH 7/8] Fixed up readme a bit --- readme.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 8d46e5e0f..447c04ba4 100644 --- a/readme.md +++ b/readme.md @@ -39,10 +39,12 @@ NZBDrone is a PVR for newsgroup users. It can monitor multiple RSS feeds for new - Make sure `NzbDrone.Console` is set as the startup project -## License +### License ### * [GNU GPL v3](http://www.gnu.org/licenses/gpl.html) Copyright 2010-2013 -### Sponsers -####JetBrains for providing us with free licenses to their great tools +### Sponsors ### +- [JetBrains](http://www.jetbrains.com/) for providing us with free licenses to their great tools + - [ReSharper](http://www.jetbrains.com/resharper/) + - [WebStorm](http://www.jetbrains.com/webstorm/) \ No newline at end of file From 6d61d57ba11aba39e6213802e1912aea6c884518 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 24 Jan 2014 14:20:03 -0800 Subject: [PATCH 8/8] Added link to teamcity --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 447c04ba4..8dedd3217 100644 --- a/readme.md +++ b/readme.md @@ -47,4 +47,5 @@ Copyright 2010-2013 ### Sponsors ### - [JetBrains](http://www.jetbrains.com/) for providing us with free licenses to their great tools - [ReSharper](http://www.jetbrains.com/resharper/) - - [WebStorm](http://www.jetbrains.com/webstorm/) \ No newline at end of file + - [WebStorm](http://www.jetbrains.com/webstorm/) + - [TeamCity](http://www.jetbrains.com/teamcity/)