aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-03-24 22:54:38 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-03-24 22:54:38 -0400
commit71b6d5d4393b654909519640c5be4cde28244028 (patch)
treead694dbdefd4286d0e2184d3c5fa3df3e2bcb118 /MediaBrowser.Server.Implementations
parent5661f0989909df11533f84753f3bd79fdc5180e8 (diff)
add critic rating column
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs17
-rw-r--r--MediaBrowser.Server.Implementations/Sorting/NameComparer.cs7
2 files changed, 13 insertions, 11 deletions
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index 395b51623..af275faee 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -79,7 +79,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _updateInheritedRatingCommand;
- private const int LatestSchemaVersion = 52;
+ private const int LatestSchemaVersion = 53;
/// <summary>
/// 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", "SourceType", "Text");
_connection.AddColumn(Logger, "TypedBaseItems", "TrailerTypes", "Text");
+ _connection.AddColumn(Logger, "TypedBaseItems", "CriticRating", "Float");
+ _connection.AddColumn(Logger, "TypedBaseItems", "CriticRatingSummary", "Text");
PrepareStatements();
@@ -455,7 +457,9 @@ namespace MediaBrowser.Server.Implementations.Persistence
"TopParentId",
"IsItemByName",
"SourceType",
- "TrailerTypes"
+ "TrailerTypes",
+ "CriticRating",
+ "CriticRatingSummary"
};
_saveItemCommand = _connection.CreateCommand();
_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 = item.CriticRating;
+ _saveItemCommand.GetParameter(index++).Value = item.CriticRatingSummary;
+
_saveItemCommand.Transaction = transaction;
_saveItemCommand.ExecuteNonQuery();
@@ -1471,7 +1478,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
cmd.CommandText += "; select count (guid) from TypedBaseItems" + whereTextWithoutPaging;
- Logger.Debug(cmd.CommandText);
+ //Logger.Debug(cmd.CommandText);
var list = new List<BaseItem>();
var count = 0;
@@ -1562,7 +1569,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
var list = new List<Guid>();
- Logger.Debug(cmd.CommandText);
+ //Logger.Debug(cmd.CommandText);
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
{
@@ -1684,7 +1691,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
var list = new List<Guid>();
var count = 0;
- Logger.Debug(cmd.CommandText);
+ //Logger.Debug(cmd.CommandText);
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess))
{
diff --git a/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs b/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
index 18fddb903..49f86c485 100644
--- a/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
+++ b/MediaBrowser.Server.Implementations/Sorting/NameComparer.cs
@@ -18,12 +18,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
/// <returns>System.Int32.</returns>
public int Compare(BaseItem x, BaseItem y)
{
- if (!x.EnableAlphaNumericSorting || !y.EnableAlphaNumericSorting)
- {
- return string.Compare(x.SortName, y.SortName, StringComparison.CurrentCultureIgnoreCase);
- }
-
- return AlphanumComparator.CompareValues(x.Name, y.Name);
+ return string.Compare(x.Name, y.Name, StringComparison.CurrentCultureIgnoreCase);
}
/// <summary>