add activity log feature

This commit is contained in:
Luke Pulverenti
2014-08-10 18:13:17 -04:00
parent 0f508dab47
commit e84ba17b9f
59 changed files with 1539 additions and 303 deletions

View File

@@ -206,46 +206,6 @@ namespace MediaBrowser.Server.Implementations.Notifications
return notification;
}
/// <summary>
/// Gets the notification.
/// </summary>
/// <param name="id">The id.</param>
/// <param name="userId">The user id.</param>
/// <returns>Notification.</returns>
/// <exception cref="System.ArgumentNullException">
/// id
/// or
/// userId
/// </exception>
public Notification GetNotification(string id, string userId)
{
if (string.IsNullOrEmpty(id))
{
throw new ArgumentNullException("id");
}
if (string.IsNullOrEmpty(userId))
{
throw new ArgumentNullException("userId");
}
using (var cmd = _connection.CreateCommand())
{
cmd.CommandText = "select Id,UserId,Date,Name,Description,Url,Level,IsRead,Category,RelatedId where Id=@Id And UserId = @UserId";
cmd.Parameters.Add(cmd, "@Id", DbType.Guid).Value = new Guid(id);
cmd.Parameters.Add(cmd, "@UserId", DbType.Guid).Value = new Guid(userId);
using (var reader = cmd.ExecuteReader(CommandBehavior.SequentialAccess | CommandBehavior.SingleResult | CommandBehavior.SingleRow))
{
if (reader.Read())
{
return GetNotification(reader);
}
}
return null;
}
}
/// <summary>
/// Gets the level.
/// </summary>
@@ -289,32 +249,6 @@ namespace MediaBrowser.Server.Implementations.Notifications
}
}
/// <summary>
/// Updates the notification.
/// </summary>
/// <param name="notification">The notification.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
public async Task UpdateNotification(Notification notification, CancellationToken cancellationToken)
{
await ReplaceNotification(notification, cancellationToken).ConfigureAwait(false);
if (NotificationUpdated != null)
{
try
{
NotificationUpdated(this, new NotificationUpdateEventArgs
{
Notification = notification
});
}
catch (Exception ex)
{
_logger.ErrorException("Error in NotificationUpdated event handler", ex);
}
}
}
/// <summary>
/// Replaces the notification.
/// </summary>