Merge branch 'develop'
This commit is contained in:
commit
ef1cea55f3
|
@ -39,6 +39,13 @@ 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
|
- Make sure `NzbDrone.Console` is set as the startup project
|
||||||
|
|
||||||
|
|
||||||
## License
|
### License ###
|
||||||
* [GNU GPL v3](http://www.gnu.org/licenses/gpl.html)
|
* [GNU GPL v3](http://www.gnu.org/licenses/gpl.html)
|
||||||
Copyright 2010-2013
|
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/)
|
||||||
|
- [TeamCity](http://www.jetbrains.com/teamcity/)
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Nancy;
|
using Nancy;
|
||||||
using Nancy.Bootstrapper;
|
using Nancy.Bootstrapper;
|
||||||
using NzbDrone.Api.Extensions;
|
using NzbDrone.Api.Extensions;
|
||||||
|
@ -33,7 +34,9 @@ namespace NzbDrone.Api.Authentication
|
||||||
return response;
|
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))
|
if (context.Request.IsApiRequest() && !ValidApiKey(apiKey) && !_authenticationService.IsAuthenticated(context))
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,5 +43,23 @@ namespace NzbDrone.Core.Test.OrganizerTests
|
||||||
|
|
||||||
Subject.BuildFilePath(fakeSeries, seasonNumber, filename, ".mkv").Should().Be(expectedPath.AsOsAgnostic());
|
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<Series>.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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -175,6 +175,8 @@ namespace NzbDrone.Core.Organizer
|
||||||
seasonFolder = ReplaceTokens(seasonFolder, tokenValues);
|
seasonFolder = ReplaceTokens(seasonFolder, tokenValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
seasonFolder = CleanFilename(seasonFolder);
|
||||||
|
|
||||||
path = Path.Combine(path, seasonFolder);
|
path = Path.Combine(path, seasonFolder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ define(
|
||||||
|
|
||||||
if (xhr) {
|
if (xhr) {
|
||||||
xhr.headers = xhr.headers || {};
|
xhr.headers = xhr.headers || {};
|
||||||
xhr.headers.Authorization = window.NzbDrone.ApiKey;
|
xhr.headers['X-Api-Key'] = window.NzbDrone.ApiKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
return original.apply(this, arguments);
|
return original.apply(this, arguments);
|
||||||
|
|
Loading…
Reference in New Issue