|
|
|
@ -234,15 +234,16 @@ namespace NzbDrone.Core.Movies
|
|
|
|
|
cleanTitleWithArabicNumbers = cleanTitleWithArabicNumbers.Replace(romanNumber, arabicNumber);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return Query(q =>
|
|
|
|
|
Movie result = Query(q =>
|
|
|
|
|
{
|
|
|
|
|
Movie result = q.Where(s => s.CleanTitle == cleanTitle).FirstWithYear(year);
|
|
|
|
|
return q.Where(s => s.CleanTitle == cleanTitle).FirstWithYear(year);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if (result == null)
|
|
|
|
|
{
|
|
|
|
|
result =
|
|
|
|
|
q.Where(movie => movie.CleanTitle == cleanTitleWithArabicNumbers).FirstWithYear(year) ??
|
|
|
|
|
q.Where(movie => movie.CleanTitle == cleanTitleWithRomanNumbers).FirstWithYear(year);
|
|
|
|
|
Query(q => q.Where(movie => movie.CleanTitle == cleanTitleWithArabicNumbers).FirstWithYear(year)) ??
|
|
|
|
|
Query(q => q.Where(movie => movie.CleanTitle == cleanTitleWithRomanNumbers).FirstWithYear(year));
|
|
|
|
|
|
|
|
|
|
if (result == null)
|
|
|
|
|
{
|
|
|
|
@ -258,16 +259,15 @@ namespace NzbDrone.Core.Movies
|
|
|
|
|
|
|
|
|
|
//result = Query.Join<Movie, AlternativeTitle>(JoinType.Inner, m => m._newAltTitles,
|
|
|
|
|
//(m, t) => m.Id == t.MovieId && (t.CleanTitle == cleanTitle)).FirstWithYear(year);
|
|
|
|
|
result = q.Where<AlternativeTitle>(t =>
|
|
|
|
|
result = Query(q => q.Where<AlternativeTitle>(t =>
|
|
|
|
|
t.CleanTitle == cleanTitle || t.CleanTitle == cleanTitleWithArabicNumbers
|
|
|
|
|
|| t.CleanTitle == cleanTitleWithRomanNumbers)
|
|
|
|
|
.FirstWithYear(year);
|
|
|
|
|
.FirstWithYear(year));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
/*return year.HasValue
|
|
|
|
|
? results?.FirstOrDefault(movie => movie.Year == year.Value)
|
|
|
|
|