aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Providers/TV/TvdbSeriesProvider.cs')
-rw-r--r--MediaBrowser.Providers/TV/TvdbSeriesProvider.cs22
1 files changed, 12 insertions, 10 deletions
diff --git a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
index 73fd4e4984..f3909e2c68 100644
--- a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
+++ b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
@@ -56,6 +56,18 @@ namespace MediaBrowser.Providers.TV
if (string.IsNullOrEmpty(seriesId))
{
seriesId = await FindSeries(itemId.Name, cancellationToken).ConfigureAwait(false);
+
+ if (string.IsNullOrEmpty(seriesId))
+ {
+ int? yearInName = null;
+ string nameWithoutYear;
+ NameParser.ParseName(itemId.Name, out nameWithoutYear, out yearInName);
+
+ if (!string.IsNullOrEmpty(nameWithoutYear) && !string.Equals(nameWithoutYear, itemId.Name, StringComparison.OrdinalIgnoreCase))
+ {
+ seriesId = await FindSeries(nameWithoutYear, cancellationToken).ConfigureAwait(false);
+ }
+ }
}
cancellationToken.ThrowIfCancellationRequested();
@@ -248,16 +260,6 @@ namespace MediaBrowser.Providers.TV
}
}
- // Try stripping off the year if it was supplied
- var parenthIndex = name.LastIndexOf('(');
-
- if (parenthIndex != -1)
- {
- var newName = name.Substring(0, parenthIndex);
-
- return await FindSeries(newName, cancellationToken);
- }
-
_logger.Info("TVDb Provider - Could not find " + name + ". Check name on Thetvdb.org.");
return null;
}