Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/Sonarr/commit/bf1fbd7fc4b10e16e142f813c771a98d6d9565c8 You should set ROOT_URL correctly, otherwise the web may not work correctly.

Fixed: Remove leading space from file names

Fixes 
pull/2536/head
Mark McDowall 7 years ago
parent 401530db65
commit bf1fbd7fc4

@ -337,7 +337,7 @@
<Compile Include="Qualities\RevisionComparableFixture.cs" />
<Compile Include="QueueTests\QueueServiceFixture.cs" />
<Compile Include="RemotePathMappingsTests\RemotePathMappingServiceFixture.cs" />
<Compile Include="OrganizerTests\CleanFixture.cs" />
<Compile Include="OrganizerTests\CleanFilenameFixture.cs" />
<Compile Include="MediaFiles\MediaFileServiceTests\FilterFixture.cs" />
<Compile Include="MediaFiles\MediaFileTableCleanupServiceFixture.cs" />
<Compile Include="MediaFiles\MediaInfo\UpdateMediaInfoServiceFixture.cs" />

@ -0,0 +1,30 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Organizer;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.OrganizerTests
{
[TestFixture]
public class CleanFilenameFixture : CoreTest
{
[TestCase("Law & Order: Criminal Intent - S10E07 - Icarus [HDTV-720p]", "Law & Order- Criminal Intent - S10E07 - Icarus [HDTV-720p]")]
public void should_replaace_invalid_characters(string name, string expectedName)
{
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
}
[TestCase(".hack s01e01", "hack s01e01")]
public void should_remove_periods_from_start(string name, string expectedName)
{
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
}
[TestCase(" Series Title - S01E01 - Episode Title", "Series Title - S01E01 - Episode Title")]
[TestCase("Series Title - S01E01 - Episode Title ", "Series Title - S01E01 - Episode Title")]
public void should_remove_spaces_from_start_and_end(string name, string expectedName)
{
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
}
}
}

@ -1,19 +0,0 @@
using FluentAssertions;
using NUnit.Framework;
using NzbDrone.Core.Organizer;
using NzbDrone.Core.Test.Framework;
namespace NzbDrone.Core.Test.OrganizerTests
{
[TestFixture]
public class CleanFixture : CoreTest
{
[TestCase("Law & Order: Criminal Intent - S10E07 - Icarus [HDTV-720p]",
"Law & Order- Criminal Intent - S10E07 - Icarus [HDTV-720p]")]
public void CleanFileName(string name, string expectedName)
{
FileNameBuilder.CleanFileName(name).Should().Be(expectedName);
}
}
}

@ -274,7 +274,7 @@ namespace NzbDrone.Core.Organizer
result = result.Replace(badCharacters[i], replace ? goodCharacters[i] : string.Empty);
}
return result.Trim();
return result.TrimStart(' ', '.').TrimEnd(' ');
}
public static string CleanFolderName(string name)

Loading…
Cancel
Save