Fixed: A few issues with the new alternative titles feature. (#2008) (Fixes #1919, #1927 and #1917)

Added: Ability to force download movies that could not be mapped correctly. This also shares these mappings with other users, so everyone can profit :)
Leonardo Galli 7 years ago committed by GitHub
parent efe49ef3c4
commit 09d51dca0f

@ -23,6 +23,7 @@ namespace Marr.Data.QGen
_innerQuery.BuildSelectClause(sql);
_innerQuery.BuildFromClause(sql);
_innerQuery.BuildJoinClauses(sql);
_innerQuery.BuildWhereClause(sql);
_innerQuery.BuildGroupBy(sql);
sql.Append(") ");

@ -253,12 +253,6 @@ namespace NzbDrone.Core.Datastore
.Take(pagingSpec.PageSize).ToList();
pagingSpec.TotalRecords = GetPagedQuery(Query, pagingSpec).GetRowCount();
var queryStr = GetPagedQuery(Query, pagingSpec).BuildQuery();
var beforeQuery = Query.BuildQuery();
pagingSpec.SortKey = beforeQuery;
pagingSpec.SortKey = queryStr;
return pagingSpec;
}

@ -104,7 +104,7 @@ namespace NzbDrone.Core.Tv
public override PagingSpec<Movie> GetPaged(PagingSpec<Movie> pagingSpec)
{
/*if (pagingSpec.SortKey == "downloadedQuality")
if (pagingSpec.SortKey == "downloadedQuality")
{
var mapper = _database.GetDataMapper();
var offset = pagingSpec.PagingOffset();
@ -114,7 +114,7 @@ namespace NzbDrone.Core.Tv
{
direction = "DESC";
}
var q = Query.Select($"SELECT * from \"Movies\" , \"MovieFiles\", \"QualityDefinitions\" WHERE Movies.MovieFileId=MovieFiles.Id AND instr(MovieFiles.Quality, ('quality\": ' || QualityDefinitions.Quality || \",\")) > 0 ORDER BY QualityDefinitions.Title {direction} LIMIT {offset},{limit};");
var q = mapper.Query<Movie>($"SELECT * from \"Movies\" , \"MovieFiles\", \"QualityDefinitions\" WHERE Movies.MovieFileId=MovieFiles.Id AND instr(MovieFiles.Quality, ('quality\": ' || QualityDefinitions.Quality || \",\")) > 0 ORDER BY QualityDefinitions.Title {direction} LIMIT {offset},{limit};");
var q2 = mapper.Query<Movie>("SELECT * from \"Movies\" , \"MovieFiles\", \"QualityDefinitions\" WHERE Movies.MovieFileId=MovieFiles.Id AND instr(MovieFiles.Quality, ('quality\": ' || QualityDefinitions.Quality || \",\")) > 0 ORDER BY QualityDefinitions.Title ASC;");
//var ok = q.BuildQuery();
@ -123,7 +123,7 @@ namespace NzbDrone.Core.Tv
pagingSpec.TotalRecords = q2.Count();
}
else*/
else
{
pagingSpec = base.GetPaged(pagingSpec);
//pagingSpec.Records = GetPagedQuery(Query, pagingSpec).ToList();
@ -220,7 +220,7 @@ namespace NzbDrone.Core.Tv
{
foreach (var belowCutoff in profile.QualityIds)
{
clauses.Add(string.Format("([t0].[ProfileId] = {0} AND [t1].[Quality] LIKE '%_quality_: {1},%')", profile.ProfileId, belowCutoff));
clauses.Add(string.Format("([t0].[ProfileId] = {0} AND [t2].[Quality] LIKE '%_quality_: {1},%')", profile.ProfileId, belowCutoff));
}
}

Loading…
Cancel
Save