|
|
@ -13,7 +13,6 @@ namespace NzbDrone.Core.Tv
|
|
|
|
public interface IMovieRepository : IBasicRepository<Movie>
|
|
|
|
public interface IMovieRepository : IBasicRepository<Movie>
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool MoviePathExists(string path);
|
|
|
|
bool MoviePathExists(string path);
|
|
|
|
Movie FindByAlternativeTitle(string cleanTitle);
|
|
|
|
|
|
|
|
Movie FindByTitle(string cleanTitle);
|
|
|
|
Movie FindByTitle(string cleanTitle);
|
|
|
|
Movie FindByTitle(string cleanTitle, int year);
|
|
|
|
Movie FindByTitle(string cleanTitle, int year);
|
|
|
|
Movie FindByImdbId(string imdbid);
|
|
|
|
Movie FindByImdbId(string imdbid);
|
|
|
@ -62,13 +61,16 @@ namespace NzbDrone.Core.Tv
|
|
|
|
cleanTitle = cleanTitle.ToLowerInvariant();
|
|
|
|
cleanTitle = cleanTitle.ToLowerInvariant();
|
|
|
|
|
|
|
|
|
|
|
|
var cleanRoman = cleanTitle;
|
|
|
|
var cleanRoman = cleanTitle;
|
|
|
|
|
|
|
|
|
|
|
|
var cleanNum = cleanTitle;
|
|
|
|
var cleanNum = cleanTitle;
|
|
|
|
|
|
|
|
|
|
|
|
foreach (KeyValuePair<string, string> entry in romanNumeralsMapper)
|
|
|
|
foreach (KeyValuePair<string, string> entry in romanNumeralsMapper)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
string num = entry.Key;
|
|
|
|
string num = entry.Key;
|
|
|
|
string roman = entry.Value.ToLower();
|
|
|
|
string roman = entry.Value.ToLower();
|
|
|
|
|
|
|
|
|
|
|
|
cleanRoman = cleanRoman.Replace(num, roman);
|
|
|
|
cleanRoman = cleanRoman.Replace(num, roman);
|
|
|
|
|
|
|
|
|
|
|
|
cleanNum = cleanNum.Replace(roman, num);
|
|
|
|
cleanNum = cleanNum.Replace(roman, num);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -100,33 +102,6 @@ namespace NzbDrone.Core.Tv
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public Movie FindByAlternativeTitle(string cleanTitle)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
cleanTitle = cleanTitle.ToLowerInvariant();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cleanRoman = cleanTitle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var cleanNum = cleanTitle;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (KeyValuePair<string, string> entry in romanNumeralsMapper)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
string num = entry.Key;
|
|
|
|
|
|
|
|
string roman = entry.Value.ToLower();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cleanRoman = cleanRoman.Replace(num, roman);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cleanNum = cleanNum.Replace(roman, num);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var result = Query.Where(m => m.AlternativeTitles.Any(t =>
|
|
|
|
|
|
|
|
Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanTitle ||
|
|
|
|
|
|
|
|
Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanRoman ||
|
|
|
|
|
|
|
|
Parser.Parser.CleanSeriesTitle(t.ToLower()) == cleanNum))
|
|
|
|
|
|
|
|
.FirstOrDefault();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Movie FindByTitle(string cleanTitle, int year)
|
|
|
|
public Movie FindByTitle(string cleanTitle, int year)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
cleanTitle = cleanTitle.ToLowerInvariant();
|
|
|
|
cleanTitle = cleanTitle.ToLowerInvariant();
|
|
|
|