From ef9bbdc60ed7514bf0cc92c8b4ff3322a1e7082e Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 19 Jun 2011 23:28:42 -0700 Subject: [PATCH] Removed leftover code from old ages ;) --- NzbDrone.Core.Test/SeriesProviderTest.cs | Bin 9493 -> 8228 bytes NzbDrone.Core/Providers/SeriesProvider.cs | 11 ---- NzbDrone.Core/Providers/TvDbProvider.cs | 66 ---------------------- 3 files changed, 77 deletions(-) diff --git a/NzbDrone.Core.Test/SeriesProviderTest.cs b/NzbDrone.Core.Test/SeriesProviderTest.cs index 9064eb8d57faabac5a03b5a86a0302715a82ced5..bced5c070b2389c8a7c02e700326959ad14fa62b 100644 GIT binary patch delta 29 lcmbR0wZvfq7t`bhN!HC@*cNe5{w2aS*-cVt^FE<)Apod33Z?)6 delta 718 zcmZ{i-!20|6vm^WXlb?er$`tpVjHz}E!C)0WFlyDY z6w025?Lz_&vDr?wsny^;HYez4sf2V%X$d!RouDNos0KlbS$C;pQvp(A8Q4$8;U$@# z(eV*c2=)#Pu3KrCmPWjy4+|c*32j&mPR1rDrCpO5BK7f9k~J<5YJEfe?o*{UO`C;~ z_WK=PM+aL*wDAGB&CbJPBpH`0nBf|xq$K*t1)hX8T=6s3>WN7iEe42^C^Jc>W&5p00|w~1cJvxy0ro#?CPe)j8l1;Q zhI!?Nb8y7R_PfRWe=S1ekhMIYB)8eJ{<}%*yLqHOX@~!)ZsM9nM0ksi!c{gC$F57X zz%@J#Pv<4RD_eY3ROd6wvQSyvQ+JSJILCCaeGT5CLvYrefr~`9@OOk<(DbxySt4|F fq3n c.SeriesId == id && c.Monitored); } - public virtual TvdbSeries MapPathToSeries(string path) - { - var seriesPath = new DirectoryInfo(path); - var searchResults = _tvDbProvider.GetSeries(seriesPath.Name); - - if (searchResults == null) - return null; - - return _tvDbProvider.GetSeries(searchResults.Id, false); - } - public virtual Series UpdateSeriesInfo(int seriesId) { var tvDbSeries = _tvDbProvider.GetSeries(seriesId, true); diff --git a/NzbDrone.Core/Providers/TvDbProvider.cs b/NzbDrone.Core/Providers/TvDbProvider.cs index 7b3a91ac1..9225a9c69 100644 --- a/NzbDrone.Core/Providers/TvDbProvider.cs +++ b/NzbDrone.Core/Providers/TvDbProvider.cs @@ -38,43 +38,6 @@ namespace NzbDrone.Core.Providers } - public virtual TvdbSearchResult GetSeries(string title) - { - lock (_handler) - { - var searchResults = SearchSeries(title); - if (searchResults.Count == 0) - return null; - - foreach (var tvdbSearchResult in searchResults) - { - if (IsTitleMatch(tvdbSearchResult.SeriesName, title)) - { - Logger.Debug("Search for '{0}' was successful", title); - return tvdbSearchResult; - } - } - } - return null; - } - - public virtual int GetBestMatch(List searchResults, string title) - { - if (searchResults.Count == 0) - return 0; - - foreach (var tvdbSearchResult in searchResults) - { - if (IsTitleMatch(tvdbSearchResult.SeriesName, title)) - { - Logger.Debug("Search for '{0}' was successful", title); - return tvdbSearchResult.Id; - } - } - - return searchResults[0].Id; - } - public virtual TvdbSeries GetSeries(int id, bool loadEpisodes) { lock (_handler) @@ -116,34 +79,5 @@ namespace NzbDrone.Core.Providers } } - /// - /// Determines whether a title in a search result is equal to the title searched for. - /// - /// Name of the directory. - /// The TVDB title. - /// - /// true if the titles are found to be same; otherwise, false. - /// - public static bool IsTitleMatch(string directoryName, string tvdbTitle) - { - var result = false; - - if (String.IsNullOrEmpty(directoryName)) - throw new ArgumentException("directoryName"); - if (String.IsNullOrEmpty(tvdbTitle)) - throw new ArgumentException("tvdbTitle"); - - if (String.Equals(directoryName, tvdbTitle, StringComparison.CurrentCultureIgnoreCase)) - { - result = true; - } - else if (String.Equals(CleanUpRegex.Replace(directoryName, ""), CleanUpRegex.Replace(tvdbTitle, ""), - StringComparison.InvariantCultureIgnoreCase)) - result = true; - - Logger.Debug("Match between '{0}' and '{1}' was {2}", tvdbTitle, directoryName, result); - - return result; - } } } \ No newline at end of file