record mediastream comment

This commit is contained in:
Luke Pulverenti
2016-01-11 11:52:22 -05:00
parent 9fcdcc6eae
commit 81fb823c02
7 changed files with 78 additions and 18 deletions

View File

@@ -28,6 +28,38 @@ namespace MediaBrowser.Server.Implementations.Persistence
AddKeyFramesColumn();
AddRefFramesCommand();
AddCodecTagColumn();
AddCommentColumn();
}
private void AddCommentColumn()
{
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "PRAGMA table_info(mediastreams)";
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult))
{
while (reader.Read())
{
if (!reader.IsDBNull(1))
{
var name = reader.GetString(1);
if (string.Equals(name, "Comment", StringComparison.OrdinalIgnoreCase))
{
return;
}
}
}
}
}
var builder = new StringBuilder();
builder.AppendLine("alter table mediastreams");
builder.AppendLine("add column Comment TEXT");
_connection.RunQueries(new[] { builder.ToString() }, _logger);
}
private void AddCodecTagColumn()