3.0.5582.2

This commit is contained in:
Luke Pulverenti
2015-04-15 23:23:13 -04:00
parent 71e1283c2f
commit c7b95a2513
10 changed files with 128 additions and 78 deletions

View File

@@ -522,7 +522,7 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
}
public IEnumerable<Guid> GetItemsOfType(Type type)
public IEnumerable<BaseItem> GetItemsOfType(Type type)
{
if (type == null)
{
@@ -530,7 +530,37 @@ namespace MediaBrowser.Server.Implementations.Persistence
}
CheckDisposed();
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "select type,data from TypedBaseItems where type = @type";
cmd.Parameters.Add(cmd, "@type", DbType.String).Value = type.FullName;
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
{
while (reader.Read())
{
var item = GetItem(reader);
if (item != null)
{
yield return item;
}
}
}
}
}
public IEnumerable<Guid> GetItemIdsOfType(Type type)
{
if (type == null)
{
throw new ArgumentNullException("type");
}
CheckDisposed();
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "select guid from TypedBaseItems where type = @type";