mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge pull request #1587 from MediaBrowser/dev
add critic rating column
This commit is contained in:
commit
988a87f024
@ -686,6 +686,18 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public string OfficialRating { get; set; }
|
public string OfficialRating { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the critic rating.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The critic rating.</value>
|
||||||
|
public float? CriticRating { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets or sets the critic rating summary.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The critic rating summary.</value>
|
||||||
|
public string CriticRatingSummary { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the official rating description.
|
/// Gets or sets the official rating description.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -803,11 +803,6 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.Budget");
|
Logger.Debug("Query requires post-filtering due to ItemSortBy.Budget");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (query.SortBy.Contains(ItemSortBy.CriticRating, StringComparer.OrdinalIgnoreCase))
|
|
||||||
{
|
|
||||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.CriticRating");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
if (query.SortBy.Contains(ItemSortBy.DateLastContentAdded, StringComparer.OrdinalIgnoreCase))
|
if (query.SortBy.Contains(ItemSortBy.DateLastContentAdded, StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.DateLastContentAdded");
|
Logger.Debug("Query requires post-filtering due to ItemSortBy.DateLastContentAdded");
|
||||||
|
@ -68,18 +68,6 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
/// <value>The revenue.</value>
|
/// <value>The revenue.</value>
|
||||||
public double? Revenue { get; set; }
|
public double? Revenue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the critic rating.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The critic rating.</value>
|
|
||||||
public float? CriticRating { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the critic rating summary.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The critic rating summary.</value>
|
|
||||||
public string CriticRatingSummary { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the name of the TMDB collection.
|
/// Gets or sets the name of the TMDB collection.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -59,18 +59,6 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// <value>The revenue.</value>
|
/// <value>The revenue.</value>
|
||||||
public double? Revenue { get; set; }
|
public double? Revenue { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the critic rating.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The critic rating.</value>
|
|
||||||
public float? CriticRating { get; set; }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets or sets the critic rating summary.
|
|
||||||
/// </summary>
|
|
||||||
/// <value>The critic rating summary.</value>
|
|
||||||
public string CriticRatingSummary { get; set; }
|
|
||||||
|
|
||||||
protected override string CreateUserDataKey()
|
protected override string CreateUserDataKey()
|
||||||
{
|
{
|
||||||
var key = Movie.GetMovieUserDataKey(this);
|
var key = Movie.GetMovieUserDataKey(this);
|
||||||
|
@ -79,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
|
|
||||||
private IDbCommand _updateInheritedRatingCommand;
|
private IDbCommand _updateInheritedRatingCommand;
|
||||||
|
|
||||||
private const int LatestSchemaVersion = 52;
|
private const int LatestSchemaVersion = 53;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
|
||||||
@ -221,6 +221,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
_connection.AddColumn(Logger, "TypedBaseItems", "IsItemByName", "BIT");
|
_connection.AddColumn(Logger, "TypedBaseItems", "IsItemByName", "BIT");
|
||||||
_connection.AddColumn(Logger, "TypedBaseItems", "SourceType", "Text");
|
_connection.AddColumn(Logger, "TypedBaseItems", "SourceType", "Text");
|
||||||
_connection.AddColumn(Logger, "TypedBaseItems", "TrailerTypes", "Text");
|
_connection.AddColumn(Logger, "TypedBaseItems", "TrailerTypes", "Text");
|
||||||
|
_connection.AddColumn(Logger, "TypedBaseItems", "CriticRating", "Float");
|
||||||
|
_connection.AddColumn(Logger, "TypedBaseItems", "CriticRatingSummary", "Text");
|
||||||
|
|
||||||
PrepareStatements();
|
PrepareStatements();
|
||||||
|
|
||||||
@ -455,7 +457,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
"TopParentId",
|
"TopParentId",
|
||||||
"IsItemByName",
|
"IsItemByName",
|
||||||
"SourceType",
|
"SourceType",
|
||||||
"TrailerTypes"
|
"TrailerTypes",
|
||||||
|
"CriticRating",
|
||||||
|
"CriticRatingSummary"
|
||||||
};
|
};
|
||||||
_saveItemCommand = _connection.CreateCommand();
|
_saveItemCommand = _connection.CreateCommand();
|
||||||
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
|
||||||
@ -746,6 +750,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
_saveItemCommand.GetParameter(index++).Value = null;
|
_saveItemCommand.GetParameter(index++).Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.CriticRating;
|
||||||
|
_saveItemCommand.GetParameter(index++).Value = item.CriticRatingSummary;
|
||||||
|
|
||||||
_saveItemCommand.Transaction = transaction;
|
_saveItemCommand.Transaction = transaction;
|
||||||
|
|
||||||
_saveItemCommand.ExecuteNonQuery();
|
_saveItemCommand.ExecuteNonQuery();
|
||||||
@ -1471,7 +1478,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
|
|
||||||
cmd.CommandText += "; select count (guid) from TypedBaseItems" + whereTextWithoutPaging;
|
cmd.CommandText += "; select count (guid) from TypedBaseItems" + whereTextWithoutPaging;
|
||||||
|
|
||||||
Logger.Debug(cmd.CommandText);
|
//Logger.Debug(cmd.CommandText);
|
||||||
|
|
||||||
var list = new List<BaseItem>();
|
var list = new List<BaseItem>();
|
||||||
var count = 0;
|
var count = 0;
|
||||||
@ -1562,7 +1569,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
|
|
||||||
var list = new List<Guid>();
|
var list = new List<Guid>();
|
||||||
|
|
||||||
Logger.Debug(cmd.CommandText);
|
//Logger.Debug(cmd.CommandText);
|
||||||
|
|
||||||
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
|
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
|
||||||
{
|
{
|
||||||
@ -1684,7 +1691,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
|
|||||||
var list = new List<Guid>();
|
var list = new List<Guid>();
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
Logger.Debug(cmd.CommandText);
|
//Logger.Debug(cmd.CommandText);
|
||||||
|
|
||||||
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
|
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
|
||||||
{
|
{
|
||||||
|
@ -18,12 +18,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
|||||||
/// <returns>System.Int32.</returns>
|
/// <returns>System.Int32.</returns>
|
||||||
public int Compare(BaseItem x, BaseItem y)
|
public int Compare(BaseItem x, BaseItem y)
|
||||||
{
|
{
|
||||||
if (!x.EnableAlphaNumericSorting || !y.EnableAlphaNumericSorting)
|
return string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase);
|
||||||
{
|
|
||||||
return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase);
|
|
||||||
}
|
|
||||||
|
|
||||||
return AlphanumComparator.CompareValues(x.Name, y.Name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user