aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-07-09 01:52:25 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-07-09 01:52:25 -0400
commitd4fad83ee239983776b4e942ab112669057c4993 (patch)
tree268dd0c32591b23b7dd2c877f5b3735a379e9209 /MediaBrowser.Server.Implementations
parent6d7e6068124033e58a8673b1f7b452eaab15eb0d (diff)
update favorites page
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Collections/CollectionManager.cs1
-rw-r--r--MediaBrowser.Server.Implementations/Library/ResolverHelper.cs4
-rw-r--r--MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs17
-rw-r--r--MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs1
4 files changed, 16 insertions, 7 deletions
diff --git a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
index 796d5f651..04f82db6f 100644
--- a/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
+++ b/MediaBrowser.Server.Implementations/Collections/CollectionManager.cs
@@ -75,7 +75,6 @@ namespace MediaBrowser.Server.Implementations.Collections
var collection = new BoxSet
{
Name = name,
- Parent = parentFolder,
Path = path,
IsLocked = options.IsLocked,
ProviderIds = options.ProviderIds,
diff --git a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
index b6a93408a..dac658095 100644
--- a/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
+++ b/MediaBrowser.Server.Implementations/Library/ResolverHelper.cs
@@ -34,7 +34,7 @@ namespace MediaBrowser.Server.Implementations.Library
// If the resolver didn't specify this
if (parent != null)
{
- item.Parent = parent;
+ item.SetParent(parent);
}
item.Id = libraryManager.GetNewItemId(item.Path, item.GetType());
@@ -68,7 +68,7 @@ namespace MediaBrowser.Server.Implementations.Library
// If the resolver didn't specify this
if (args.Parent != null)
{
- item.Parent = args.Parent;
+ item.SetParent(args.Parent);
}
item.Id = libraryManager.GetNewItemId(item.Path, item.GetType());
diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
index cc4b7f074..b65ea50f4 100644
--- a/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
+++ b/MediaBrowser.Server.Implementations/Persistence/SqliteItemRepository.cs
@@ -1,4 +1,3 @@
-using System.Runtime.Serialization;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.TV;
@@ -14,6 +13,7 @@ using System.Data;
using System.Globalization;
using System.IO;
using System.Linq;
+using System.Runtime.Serialization;
using System.Threading;
using System.Threading.Tasks;
@@ -154,6 +154,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
_connection.AddColumn(_logger, "TypedBaseItems", "ParentIndexNumber", "INT");
_connection.AddColumn(_logger, "TypedBaseItems", "PremiereDate", "DATETIME");
_connection.AddColumn(_logger, "TypedBaseItems", "ProductionYear", "INT");
+ _connection.AddColumn(_logger, "TypedBaseItems", "ParentId", "GUID");
PrepareStatements();
@@ -193,10 +194,11 @@ namespace MediaBrowser.Server.Implementations.Persistence
"Overview",
"ParentIndexNumber",
"PremiereDate",
- "ProductionYear"
+ "ProductionYear",
+ "ParentId"
};
_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)";
+ _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)";
for (var i = 1; i <= saveColumns.Count; i++)
{
_saveItemCommand.Parameters.Add(_saveItemCommand, "@" + i.ToString(CultureInfo.InvariantCulture));
@@ -330,6 +332,15 @@ namespace MediaBrowser.Server.Implementations.Persistence
_saveItemCommand.GetParameter(index++).Value = item.PremiereDate;
_saveItemCommand.GetParameter(index++).Value = item.ProductionYear;
+ if (item.ParentId == Guid.Empty)
+ {
+ _saveItemCommand.GetParameter(index++).Value = null;
+ }
+ else
+ {
+ _saveItemCommand.GetParameter(index++).Value = item.ParentId;
+ }
+
_saveItemCommand.Transaction = transaction;
_saveItemCommand.ExecuteNonQuery();
diff --git a/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs b/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs
index a5cc0e0de..311cb9b51 100644
--- a/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs
+++ b/MediaBrowser.Server.Implementations/Playlists/PlaylistManager.cs
@@ -113,7 +113,6 @@ namespace MediaBrowser.Server.Implementations.Playlists
var playlist = new Playlist
{
Name = name,
- Parent = parentFolder,
Path = path
};