aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/ClientEvent
diff options
context:
space:
mode:
authorCody Robibero <cody@robibe.ro>2021-10-28 16:11:14 -0600
committerCody Robibero <cody@robibe.ro>2021-10-28 16:13:37 -0600
commit0e584f68409e71204f6b9387cde8efe2adb0fbed (patch)
tree3864bc9f2e71cb79fbe8f101db20a691cdf390ea /MediaBrowser.Controller/ClientEvent
parent91204fc9f0e704a61300a7bd54f52d56f02f44b3 (diff)
Update documentation; use information from authorization; return generated filename
Diffstat (limited to 'MediaBrowser.Controller/ClientEvent')
-rw-r--r--MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs3
-rw-r--r--MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs4
2 files changed, 4 insertions, 3 deletions
diff --git a/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs b/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs
index 04d0a3c43..870070d35 100644
--- a/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs
+++ b/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs
@@ -44,13 +44,14 @@ namespace MediaBrowser.Controller.ClientEvent
}
/// <inheritdoc />
- public async Task WriteDocumentAsync(AuthorizationInfo authorizationInfo, Stream fileContents)
+ public async Task<string> WriteDocumentAsync(AuthorizationInfo authorizationInfo, Stream fileContents)
{
var fileName = $"upload_{authorizationInfo.Client}_{(authorizationInfo.IsApiKey ? "apikey" : authorizationInfo.Version)}_{DateTime.UtcNow:yyyyMMddHHmmss}.log";
var logFilePath = Path.Combine(_applicationPaths.LogDirectoryPath, fileName);
await using var fileStream = new FileStream(logFilePath, FileMode.CreateNew, FileAccess.Write, FileShare.None);
await fileContents.CopyToAsync(fileStream).ConfigureAwait(false);
await fileStream.FlushAsync().ConfigureAwait(false);
+ return fileName;
}
}
}
diff --git a/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs b/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs
index ee8e5806b..6fc54faf2 100644
--- a/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs
+++ b/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs
@@ -21,7 +21,7 @@ namespace MediaBrowser.Controller.ClientEvent
/// </summary>
/// <param name="authorizationInfo">The current authorization info.</param>
/// <param name="fileContents">The file contents to write.</param>
- /// <returns>A <see cref="Task"/> representing the asynchronous operation.</returns>
- Task WriteDocumentAsync(AuthorizationInfo authorizationInfo, Stream fileContents);
+ /// <returns>The created file name.</returns>
+ Task<string> WriteDocumentAsync(AuthorizationInfo authorizationInfo, Stream fileContents);
}
}