aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
diff options
context:
space:
mode:
authorErwin de Haan <EraYaN@users.noreply.github.com>2019-01-25 21:33:58 +0100
committerBond-009 <bond.009@outlook.com>2019-01-25 23:32:06 +0100
commitd1a0497f55c7f41fe9f01bbed328967e381fd394 (patch)
treec67c1d3da5af32beac90e8480cf3f8827d042a39 /Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
parente0315b569591b71938829a8f35ac264399ef66bd (diff)
Revert "Merge pull request #452 from Bond-009/activitydb"
This reverts commit 48ad18d12baeeb42ec0ec7df9473330dcbc76754, reversing changes made to fe197415cac19c0e4005c52761c5e7a37b8a4557.
Diffstat (limited to 'Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs')
-rw-r--r--Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs93
1 files changed, 46 insertions, 47 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
index aef72c697..a8e8f815a 100644
--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
@@ -2,7 +2,6 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
-using System.Threading.Tasks;
using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Plugins;
using MediaBrowser.Common.Updates;
@@ -93,18 +92,18 @@ namespace Emby.Server.Implementations.Activity
_appHost.ApplicationUpdated += _appHost_ApplicationUpdated;
}
- async void _deviceManager_CameraImageUploaded(object sender, GenericEventArgs<CameraImageUploadInfo> e)
+ void _deviceManager_CameraImageUploaded(object sender, GenericEventArgs<CameraImageUploadInfo> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("CameraImageUploadedFrom"), e.Argument.Device.Name),
Type = NotificationType.CameraImageUploaded.ToString()
});
}
- async void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e)
+ void _userManager_UserLockedOut(object sender, GenericEventArgs<User> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserLockedOutWithName"), e.Argument.Name),
Type = NotificationType.UserLockedOut.ToString(),
@@ -112,9 +111,9 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _subManager_SubtitleDownloadFailure(object sender, SubtitleDownloadFailureEventArgs e)
+ void _subManager_SubtitleDownloadFailure(object sender, SubtitleDownloadFailureEventArgs e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("SubtitleDownloadFailureFromForItem"), e.Provider, Notifications.Notifications.GetItemName(e.Item)),
Type = "SubtitleDownloadFailure",
@@ -123,7 +122,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _sessionManager_PlaybackStopped(object sender, PlaybackStopEventArgs e)
+ void _sessionManager_PlaybackStopped(object sender, PlaybackStopEventArgs e)
{
var item = e.MediaInfo;
@@ -146,7 +145,7 @@ namespace Emby.Server.Implementations.Activity
var user = e.Users.First();
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserStoppedPlayingItemWithValues"), user.Name, GetItemName(item), e.DeviceName),
Type = GetPlaybackStoppedNotificationType(item.MediaType),
@@ -154,7 +153,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e)
+ void _sessionManager_PlaybackStart(object sender, PlaybackProgressEventArgs e)
{
var item = e.MediaInfo;
@@ -177,7 +176,7 @@ namespace Emby.Server.Implementations.Activity
var user = e.Users.First();
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserStartedPlayingItemWithValues"), user.Name, GetItemName(item), e.DeviceName),
Type = GetPlaybackNotificationType(item.MediaType),
@@ -238,7 +237,7 @@ namespace Emby.Server.Implementations.Activity
return null;
}
- async void _sessionManager_SessionEnded(object sender, SessionEventArgs e)
+ void _sessionManager_SessionEnded(object sender, SessionEventArgs e)
{
string name;
var session = e.SessionInfo;
@@ -255,7 +254,7 @@ namespace Emby.Server.Implementations.Activity
name = string.Format(_localization.GetLocalizedString("UserOfflineFromDevice"), session.UserName, session.DeviceName);
}
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = name,
Type = "SessionEnded",
@@ -264,11 +263,11 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _sessionManager_AuthenticationSucceeded(object sender, GenericEventArgs<AuthenticationResult> e)
+ void _sessionManager_AuthenticationSucceeded(object sender, GenericEventArgs<AuthenticationResult> e)
{
var user = e.Argument.User;
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("AuthenticationSucceededWithUserName"), user.Name),
Type = "AuthenticationSucceeded",
@@ -277,9 +276,9 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _sessionManager_AuthenticationFailed(object sender, GenericEventArgs<AuthenticationRequest> e)
+ void _sessionManager_AuthenticationFailed(object sender, GenericEventArgs<AuthenticationRequest> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("FailedLoginAttemptWithUserName"), e.Argument.Username),
Type = "AuthenticationFailed",
@@ -288,9 +287,9 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _appHost_ApplicationUpdated(object sender, GenericEventArgs<PackageVersionInfo> e)
+ void _appHost_ApplicationUpdated(object sender, GenericEventArgs<PackageVersionInfo> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("MessageApplicationUpdatedTo"), e.Argument.versionStr),
Type = NotificationType.ApplicationUpdateInstalled.ToString(),
@@ -298,27 +297,27 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _config_NamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
+ void _config_NamedConfigurationUpdated(object sender, ConfigurationUpdateEventArgs e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("MessageNamedServerConfigurationUpdatedWithValue"), e.Key),
Type = "NamedConfigurationUpdated"
});
}
- async void _config_ConfigurationUpdated(object sender, EventArgs e)
+ void _config_ConfigurationUpdated(object sender, EventArgs e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = _localization.GetLocalizedString("MessageServerConfigurationUpdated"),
Type = "ServerConfigurationUpdated"
});
}
- async void _userManager_UserPolicyUpdated(object sender, GenericEventArgs<User> e)
+ void _userManager_UserPolicyUpdated(object sender, GenericEventArgs<User> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserPolicyUpdatedWithName"), e.Argument.Name),
Type = "UserPolicyUpdated",
@@ -326,18 +325,18 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _userManager_UserDeleted(object sender, GenericEventArgs<User> e)
+ void _userManager_UserDeleted(object sender, GenericEventArgs<User> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserDeletedWithName"), e.Argument.Name),
Type = "UserDeleted"
});
}
- async void _userManager_UserPasswordChanged(object sender, GenericEventArgs<User> e)
+ void _userManager_UserPasswordChanged(object sender, GenericEventArgs<User> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserPasswordChangedWithName"), e.Argument.Name),
Type = "UserPasswordChanged",
@@ -345,9 +344,9 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _userManager_UserCreated(object sender, GenericEventArgs<User> e)
+ void _userManager_UserCreated(object sender, GenericEventArgs<User> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("UserCreatedWithName"), e.Argument.Name),
Type = "UserCreated",
@@ -355,9 +354,9 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _subManager_SubtitlesDownloaded(object sender, SubtitleDownloadEventArgs e)
+ void _subManager_SubtitlesDownloaded(object sender, SubtitleDownloadEventArgs e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("SubtitlesDownloadedForItem"), Notifications.Notifications.GetItemName(e.Item)),
Type = "SubtitlesDownloaded",
@@ -366,7 +365,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _sessionManager_SessionStarted(object sender, SessionEventArgs e)
+ void _sessionManager_SessionStarted(object sender, SessionEventArgs e)
{
string name;
var session = e.SessionInfo;
@@ -383,7 +382,7 @@ namespace Emby.Server.Implementations.Activity
name = string.Format(_localization.GetLocalizedString("UserOnlineFromDevice"), session.UserName, session.DeviceName);
}
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = name,
Type = "SessionStarted",
@@ -392,9 +391,9 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _installationManager_PluginUpdated(object sender, GenericEventArgs<Tuple<IPlugin, PackageVersionInfo>> e)
+ void _installationManager_PluginUpdated(object sender, GenericEventArgs<Tuple<IPlugin, PackageVersionInfo>> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("PluginUpdatedWithName"), e.Argument.Item1.Name),
Type = NotificationType.PluginUpdateInstalled.ToString(),
@@ -403,18 +402,18 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _installationManager_PluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
+ void _installationManager_PluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("PluginUninstalledWithName"), e.Argument.Name),
Type = NotificationType.PluginUninstalled.ToString()
});
}
- async void _installationManager_PluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> e)
+ void _installationManager_PluginInstalled(object sender, GenericEventArgs<PackageVersionInfo> e)
{
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("PluginInstalledWithName"), e.Argument.name),
Type = NotificationType.PluginInstalled.ToString(),
@@ -422,11 +421,11 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _installationManager_PackageInstallationFailed(object sender, InstallationFailedEventArgs e)
+ void _installationManager_PackageInstallationFailed(object sender, InstallationFailedEventArgs e)
{
var installationInfo = e.InstallationInfo;
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("NameInstallFailed"), installationInfo.Name),
Type = NotificationType.InstallationFailed.ToString(),
@@ -435,7 +434,7 @@ namespace Emby.Server.Implementations.Activity
});
}
- async void _taskManager_TaskCompleted(object sender, TaskCompletionEventArgs e)
+ void _taskManager_TaskCompleted(object sender, TaskCompletionEventArgs e)
{
var result = e.Result;
var task = e.Task;
@@ -462,7 +461,7 @@ namespace Emby.Server.Implementations.Activity
vals.Add(e.Result.LongErrorMessage);
}
- await CreateLogEntry(new ActivityLogEntry
+ CreateLogEntry(new ActivityLogEntry
{
Name = string.Format(_localization.GetLocalizedString("ScheduledTaskFailedWithName"), task.Name),
Type = NotificationType.TaskFailed.ToString(),
@@ -473,11 +472,11 @@ namespace Emby.Server.Implementations.Activity
}
}
- private async Task CreateLogEntry(ActivityLogEntry entry)
+ private void CreateLogEntry(ActivityLogEntry entry)
{
try
{
- await _activityManager.CreateAsync(entry);
+ _activityManager.Create(entry);
}
catch
{