diff --git a/frontend/src/AddArtist/ImportArtist/Import/SelectArtist/ImportArtistSelectArtist.js b/frontend/src/AddArtist/ImportArtist/Import/SelectArtist/ImportArtistSelectArtist.js
index 189c73aa6..59a7a2746 100644
--- a/frontend/src/AddArtist/ImportArtist/Import/SelectArtist/ImportArtistSelectArtist.js
+++ b/frontend/src/AddArtist/ImportArtist/Import/SelectArtist/ImportArtistSelectArtist.js
@@ -227,6 +227,7 @@ class ImportArtistSelectArtist extends Component {
canSpin={true}
isSpinning={isFetching}
onPress={this.onRefreshPress}
+ title="Refresh"
>
diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs
index 70ecc4b21..4c6586b87 100644
--- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs
+++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs
@@ -47,6 +47,24 @@ namespace NzbDrone.Core.Test.ParserTests
title.CleanArtistName().Should().Be("carnivale");
}
+ [TestCase("Songs of Experience (Deluxe Edition)", "Songs of Experience")]
+ [TestCase("Mr. Bad Guy [Special Edition]", "Mr. Bad Guy")]
+ [TestCase("Sweet Dreams (Album)", "Sweet Dreams")]
+ public void should_remove_common_tags_from_album_title(string title, string correct)
+ {
+ var result = Parser.Parser.CleanAlbumTitle(title);
+ result.Should().Be(correct);
+ }
+
+ [TestCase("Songs of Experience (Deluxe Edition)", "Songs of Experience")]
+ [TestCase("Mr. Bad Guy [Special Edition]", "Mr. Bad Guy")]
+ [TestCase("Smooth Criminal (single)", "Smooth Criminal")]
+ public void should_remove_common_tags_from_track_title(string title, string correct)
+ {
+ var result = Parser.Parser.CleanTrackTitle(title);
+ result.Should().Be(correct);
+ }
+
[TestCase("Discovery TV - Gold Rush : 02 Road From Hell [S04].mp4")]
public void should_clean_up_invalid_path_characters(string postTitle)
{
diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs
index f4d3e02e9..8eba68f55 100644
--- a/src/NzbDrone.Core/Parser/Parser.cs
+++ b/src/NzbDrone.Core/Parser/Parser.cs
@@ -200,9 +200,10 @@ namespace NzbDrone.Core.Parser
private static readonly string[] Numbers = new[] { "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
+ private static readonly Regex CommonTagRegex = new Regex(@"(\[|\(){1}(version|deluxe|single|clean|album|special|bonus)+\s*.*(\]|\)){1}", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+
public static ParsedTrackInfo ParseMusicPath(string path)
{
-
var fileInfo = new FileInfo(path);
var result = new ParsedTrackInfo { };
@@ -210,6 +211,12 @@ namespace NzbDrone.Core.Parser
if (MediaFiles.MediaFileExtensions.Extensions.Contains(fileInfo.Extension))
{
result = ParseAudioTags(path);
+
+ if (CommonTagRegex.IsMatch(result.AlbumTitle))
+ {
+ result.AlbumTitle = CleanAlbumTitle(result.AlbumTitle);
+ Logger.Debug("Cleaning Album title of common matching issues. Cleaned album title is '{0}'", result.AlbumTitle);
+ }
}
else
{
@@ -219,6 +226,8 @@ namespace NzbDrone.Core.Parser
// TODO: Check if it is common that we might need to fallback to parser to gather details
//var result = ParseMusicTitle(fileInfo.Name);
+
+
if (result == null)
{
Logger.Debug("Attempting to parse track info using directory and file names. {0}", fileInfo.Directory.Name);
@@ -327,6 +336,7 @@ namespace NzbDrone.Core.Parser
Logger.Debug("Parsing string '{0}'", title);
+
if (ReversedTitleRegex.IsMatch(title))
{
var titleWithoutExtension = RemoveFileExtension(title).ToCharArray();
@@ -407,6 +417,7 @@ namespace NzbDrone.Core.Parser
Logger.Debug("Parsing string '{0}'", title);
+
if (ReversedTitleRegex.IsMatch(title))
{
var titleWithoutExtension = RemoveFileExtension(title).ToCharArray();
@@ -582,6 +593,16 @@ namespace NzbDrone.Core.Parser
return title;
}
+ public static string CleanAlbumTitle(string album)
+ {
+ return CommonTagRegex.Replace(album, string.Empty).Trim();
+ }
+
+ public static string CleanTrackTitle(string title)
+ {
+ return CommonTagRegex.Replace(title, string.Empty).Trim();
+ }
+
private static ParsedTrackInfo ParseAudioTags(string path)
{
var file = TagLib.File.Create(path);
diff --git a/src/NzbDrone.Core/Parser/ParsingService.cs b/src/NzbDrone.Core/Parser/ParsingService.cs
index cc4350356..d02126e76 100644
--- a/src/NzbDrone.Core/Parser/ParsingService.cs
+++ b/src/NzbDrone.Core/Parser/ParsingService.cs
@@ -245,7 +245,8 @@ namespace NzbDrone.Core.Parser
}
var tracks = GetTracks(artist, parsedTrackInfo);
- var album = _albumService.FindByTitle(artist.Id, parsedTrackInfo.AlbumTitle);
+ //var album = _albumService.FindByTitle(artist.Id, parsedTrackInfo.AlbumTitle);
+ var album = tracks.FirstOrDefault()?.Album;
return new LocalTrack
{
@@ -270,6 +271,9 @@ namespace NzbDrone.Core.Parser
return new List