|
|
|
@ -3,8 +3,6 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using MediaBrowser.Model.Serialization;
|
|
|
|
|
using SQLitePCL.pretty;
|
|
|
|
|
|
|
|
|
|
namespace Emby.Server.Implementations.Data
|
|
|
|
@ -109,25 +107,6 @@ namespace Emby.Server.Implementations.Data
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Serializes to bytes.
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns>System.Byte[][].</returns>
|
|
|
|
|
/// <exception cref="ArgumentNullException">obj</exception>
|
|
|
|
|
public static byte[] SerializeToBytes(this IJsonSerializer json, object obj)
|
|
|
|
|
{
|
|
|
|
|
if (obj == null)
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentNullException(nameof(obj));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
using (var stream = new MemoryStream())
|
|
|
|
|
{
|
|
|
|
|
json.SerializeToStream(obj, stream);
|
|
|
|
|
return stream.ToArray();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void Attach(SQLiteDatabaseConnection db, string path, string alias)
|
|
|
|
|
{
|
|
|
|
|
var commandText = string.Format(
|
|
|
|
@ -383,11 +362,11 @@ namespace Emby.Server.Implementations.Data
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static IEnumerable<IReadOnlyList<IResultSetValue>> ExecuteQuery(this IStatement This)
|
|
|
|
|
public static IEnumerable<IReadOnlyList<IResultSetValue>> ExecuteQuery(this IStatement statement)
|
|
|
|
|
{
|
|
|
|
|
while (This.MoveNext())
|
|
|
|
|
while (statement.MoveNext())
|
|
|
|
|
{
|
|
|
|
|
yield return This.Current;
|
|
|
|
|
yield return statement.Current;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|