update photos

This commit is contained in:
Luke Pulverenti 2015-08-26 14:17:38 -04:00
parent 7f25be3e0d
commit d4050fbf2c
4 changed files with 49 additions and 14 deletions

View File

@ -317,7 +317,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.Listings
{ {
info.OfficialRating = details.contentRating[0].code.Replace("TV", "TV-").Replace("--", "-"); info.OfficialRating = details.contentRating[0].code.Replace("TV", "TV-").Replace("--", "-");
var invalid = new[] { "N/A", "Approved", "Not Rated" }; var invalid = new[] { "N/A", "Approved", "Not Rated", "Passed" };
if (invalid.Contains(info.OfficialRating, StringComparer.OrdinalIgnoreCase)) if (invalid.Contains(info.OfficialRating, StringComparer.OrdinalIgnoreCase))
{ {
info.OfficialRating = null; info.OfficialRating = null;

View File

@ -2,6 +2,7 @@
using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.LiveTv;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -52,7 +53,10 @@ namespace MediaBrowser.Server.Implementations.Persistence
var itemIds = _libraryManager.GetItemIds(new InternalItemsQuery var itemIds = _libraryManager.GetItemIds(new InternalItemsQuery
{ {
IsCurrentSchema = false, IsCurrentSchema = false,
Limit = 50000 Limit = 100000,
// These are constantly getting regenerated so don't bother with them here
ExcludeItemTypes = new[] { typeof(LiveTvProgram).Name }
}); });
var numComplete = 0; var numComplete = 0;
@ -62,6 +66,8 @@ namespace MediaBrowser.Server.Implementations.Persistence
foreach (var itemId in itemIds) foreach (var itemId in itemIds)
{ {
cancellationToken.ThrowIfCancellationRequested();
var item = _libraryManager.GetItemById(itemId); var item = _libraryManager.GetItemById(itemId);
if (item != null) if (item != null)

View File

@ -72,7 +72,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
private IDbCommand _deletePeopleCommand; private IDbCommand _deletePeopleCommand;
private IDbCommand _savePersonCommand; private IDbCommand _savePersonCommand;
private const int LatestSchemaVersion = 2; private const int LatestSchemaVersion = 4;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="SqliteItemRepository"/> class. /// Initializes a new instance of the <see cref="SqliteItemRepository"/> class.
@ -163,6 +163,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(_logger, "TypedBaseItems", "Genres", "Text"); _connection.AddColumn(_logger, "TypedBaseItems", "Genres", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "ParentalRatingValue", "INT"); _connection.AddColumn(_logger, "TypedBaseItems", "ParentalRatingValue", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "SchemaVersion", "INT"); _connection.AddColumn(_logger, "TypedBaseItems", "SchemaVersion", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "SortName", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "RunTimeTicks", "BIGINT");
_connection.AddColumn(_logger, "TypedBaseItems", "OfficialRatingDescription", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "HomePageUrl", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "VoteCount", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "DisplayMediaType", "Text");
_connection.AddColumn(_logger, "TypedBaseItems", "DateCreated", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "DateModified", "DATETIME");
PrepareStatements(); PrepareStatements();
@ -206,14 +215,30 @@ namespace MediaBrowser.Server.Implementations.Persistence
"ParentId", "ParentId",
"Genres", "Genres",
"ParentalRatingValue", "ParentalRatingValue",
"SchemaVersion" "SchemaVersion",
"SortName",
"RunTimeTicks",
"OfficialRatingDescription",
"HomePageUrl",
"VoteCount",
"DisplayMediaType",
"DateCreated",
"DateModified"
}; };
_saveItemCommand = _connection.CreateCommand(); _saveItemCommand = _connection.CreateCommand();
_saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (@1, @2, @3, @4, @5, @6, @7, @8, @9, @10, @11, @12, @13, @14, @15, @16, @17, @18, @19, @20, @21, @22, @23, @24, @25)"; _saveItemCommand.CommandText = "replace into TypedBaseItems (" + string.Join(",", saveColumns.ToArray()) + ") values (";
for (var i = 1; i <= saveColumns.Count; i++) for (var i = 1; i <= saveColumns.Count; i++)
{ {
if (i > 1)
{
_saveItemCommand.CommandText += ",";
}
_saveItemCommand.CommandText += "@" + i.ToString(CultureInfo.InvariantCulture);
_saveItemCommand.Parameters.Add(_saveItemCommand, "@" + i.ToString(CultureInfo.InvariantCulture)); _saveItemCommand.Parameters.Add(_saveItemCommand, "@" + i.ToString(CultureInfo.InvariantCulture));
} }
_saveItemCommand.CommandText += ")";
_deleteChildrenCommand = _connection.CreateCommand(); _deleteChildrenCommand = _connection.CreateCommand();
_deleteChildrenCommand.CommandText = "delete from ChildrenIds where ParentId=@ParentId"; _deleteChildrenCommand.CommandText = "delete from ChildrenIds where ParentId=@ParentId";
@ -356,6 +381,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = item.GetParentalRatingValue(); _saveItemCommand.GetParameter(index++).Value = item.GetParentalRatingValue();
_saveItemCommand.GetParameter(index++).Value = LatestSchemaVersion; _saveItemCommand.GetParameter(index++).Value = LatestSchemaVersion;
_saveItemCommand.GetParameter(index++).Value = item.SortName;
_saveItemCommand.GetParameter(index++).Value = item.RunTimeTicks;
_saveItemCommand.GetParameter(index++).Value = item.OfficialRatingDescription;
_saveItemCommand.GetParameter(index++).Value = item.HomePageUrl;
_saveItemCommand.GetParameter(index++).Value = item.VoteCount;
_saveItemCommand.GetParameter(index++).Value = item.DisplayMediaType;
_saveItemCommand.GetParameter(index++).Value = item.DateCreated;
_saveItemCommand.GetParameter(index++).Value = item.DateModified;
_saveItemCommand.Transaction = transaction; _saveItemCommand.Transaction = transaction;
@ -772,11 +806,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
private string MapOrderByField(string name) private string MapOrderByField(string name)
{ {
if (string.Equals(name, "sortname", StringComparison.OrdinalIgnoreCase))
{
return "name";
}
return name; return name;
} }

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
//[assembly: AssemblyVersion("3.0.*")] [assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5713.3")] //[assembly: AssemblyVersion("3.0.5713.3")]