diff --git a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs
index f88173afe..54d2cc337 100644
--- a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs
+++ b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs
@@ -267,7 +267,8 @@ namespace NzbDrone.Common.Instrumentation.Sentry
if (message.IsNotNullOrWhiteSpace() && message.Length < 200)
{
- sentryFingerprint.Add(message);
+ // Windows gives a trailing '.' for NullReferenceException but mono doesn't
+ sentryFingerprint.Add(message.TrimEnd('.'));
}
}
}
diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
index 4a40c277f..b93803de2 100644
--- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
+++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj
@@ -362,6 +362,7 @@
+
@@ -613,4 +614,4 @@
-
\ No newline at end of file
+
diff --git a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetAlbumsFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetAlbumsFixture.cs
new file mode 100644
index 000000000..4a696478a
--- /dev/null
+++ b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetAlbumsFixture.cs
@@ -0,0 +1,38 @@
+using Moq;
+using NUnit.Framework;
+using NzbDrone.Core.Parser;
+using NzbDrone.Core.Test.Framework;
+using NzbDrone.Core.Music;
+using FizzWare.NBuilder;
+using NzbDrone.Core.IndexerSearch.Definitions;
+using NzbDrone.Core.Parser.Model;
+using FluentAssertions;
+using System.Linq;
+using System.Collections.Generic;
+
+namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests
+{
+ [TestFixture]
+ public class GetAlbumsFixture : CoreTest
+ {
+ [Test]
+ public void should_not_fail_if_search_criteria_contains_multiple_albums_with_the_same_name()
+ {
+ var artist = Builder.CreateNew().Build();
+ var albums = Builder.CreateListOfSize(2).All().With(x => x.Title = "IdenticalTitle").Build().ToList();
+ var criteria = new AlbumSearchCriteria {
+ Artist = artist,
+ Albums = albums
+ };
+
+ var parsed = new ParsedAlbumInfo {
+ AlbumTitle = "IdenticalTitle"
+ };
+
+ Subject.GetAlbums(parsed, artist, criteria).Should().BeEquivalentTo(new List());
+
+ Mocker.GetMock()
+ .Verify(s => s.FindByTitle(artist.ArtistMetadataId, "IdenticalTitle"), Times.Once());
+ }
+ }
+}
diff --git a/src/NzbDrone.Core/HealthCheck/Checks/FpcalcCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/FpcalcCheck.cs
index d90f6a0d2..156a4946f 100644
--- a/src/NzbDrone.Core/HealthCheck/Checks/FpcalcCheck.cs
+++ b/src/NzbDrone.Core/HealthCheck/Checks/FpcalcCheck.cs
@@ -32,7 +32,7 @@ namespace NzbDrone.Core.HealthCheck.Checks
}
var fpcalcVersion = _fingerprintingService.FpcalcVersion();
- if (fpcalcVersion == null || fpcalcVersion < new Version("1.2.0"))
+ if (fpcalcVersion == null || fpcalcVersion < new Version("1.4.3"))
{
return new HealthCheck(GetType(), HealthCheckResult.Warning, $"You have an old version of fpcalc. Please upgrade to 1.4.3.", "#fpcalc-upgrade");
}
diff --git a/src/NzbDrone.Core/Parser/ParsingService.cs b/src/NzbDrone.Core/Parser/ParsingService.cs
index 101592cb4..f8c658bbf 100644
--- a/src/NzbDrone.Core/Parser/ParsingService.cs
+++ b/src/NzbDrone.Core/Parser/ParsingService.cs
@@ -18,7 +18,6 @@ namespace NzbDrone.Core.Parser
RemoteAlbum Map(ParsedAlbumInfo parsedAlbumInfo, SearchCriteriaBase searchCriteria = null);
RemoteAlbum Map(ParsedAlbumInfo parsedAlbumInfo, int artistId, IEnumerable albumIds);
List GetAlbums(ParsedAlbumInfo parsedAlbumInfo, Artist artist, SearchCriteriaBase searchCriteria = null);
- Album GetAlbum(Artist artist, ParsedTrackInfo parsedTrackInfo);
// Music stuff here
Album GetLocalAlbum(string filename, Artist artist);
@@ -150,7 +149,7 @@ namespace NzbDrone.Core.Parser
if (searchCriteria != null)
{
- albumInfo = searchCriteria.Albums.SingleOrDefault(e => e.Title == albumTitle);
+ albumInfo = searchCriteria.Albums.ExclusiveOrDefault(e => e.Title == albumTitle);
}
if (albumInfo == null)
@@ -236,50 +235,5 @@ namespace NzbDrone.Core.Parser
return tracksInAlbum.Count == 1 ? _albumService.GetAlbum(tracksInAlbum.First().AlbumId) : null;
}
-
- public Album GetAlbum(Artist artist, ParsedTrackInfo parsedTrackInfo)
- {
- Album album = null;
-
- if (parsedTrackInfo == null)
- {
- return null;
- }
-
- if (parsedTrackInfo.ReleaseMBId.IsNotNullOrWhiteSpace())
- {
- album = _albumService.FindAlbumByRelease(parsedTrackInfo.ReleaseMBId);
- }
-
- if (album == null && parsedTrackInfo.AlbumTitle.IsNullOrWhiteSpace())
- {
- _logger.Debug("Album title could not be parsed for {0}", parsedTrackInfo);
- return null;
- }
-
- var cleanAlbumTitle = Parser.CleanAlbumTitle(parsedTrackInfo.AlbumTitle);
- _logger.Debug("Cleaning Album title of common matching issues. Cleaned album title is '{0}'", cleanAlbumTitle);
-
- if (album == null)
- {
- album = _albumService.FindByTitle(artist.ArtistMetadataId, cleanAlbumTitle);
- }
-
- if (album == null)
- {
- _logger.Debug("Trying inexact album match for {0}", parsedTrackInfo);
- album = _albumService.FindByTitleInexact(artist.ArtistMetadataId, cleanAlbumTitle);
- }
-
- if (album == null)
- {
- _logger.Debug("Parsed album title not found in Db for {0}", parsedTrackInfo);
- return null;
- }
-
- _logger.Debug("Album {0} selected for {1}", album, parsedTrackInfo);
-
- return album;
- }
}
}