diff options
| author | Cody Robibero <cody@robibe.ro> | 2021-11-05 10:40:45 -0600 |
|---|---|---|
| committer | Cody Robibero <cody@robibe.ro> | 2021-11-05 12:57:24 -0600 |
| commit | 17264a6020774ac50b48bf5fe61ca9a3b1ec4d19 (patch) | |
| tree | 13a943670ac6ffe46496d9b17ff46775e75f5fef /MediaBrowser.Controller/ClientEvent | |
| parent | 3398f7f953864c47d66b49287fcc2b613b0c03de (diff) | |
Use client info from claims
Diffstat (limited to 'MediaBrowser.Controller/ClientEvent')
| -rw-r--r-- | MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs | 4 | ||||
| -rw-r--r-- | MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs b/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs index 870070d35..2dff0f931 100644 --- a/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs +++ b/MediaBrowser.Controller/ClientEvent/ClientEventLogger.cs @@ -44,9 +44,9 @@ namespace MediaBrowser.Controller.ClientEvent } /// <inheritdoc /> - public async Task<string> WriteDocumentAsync(AuthorizationInfo authorizationInfo, Stream fileContents) + public async Task<string> WriteDocumentAsync(string clientName, string clientVersion, Stream fileContents) { - var fileName = $"upload_{authorizationInfo.Client}_{(authorizationInfo.IsApiKey ? "apikey" : authorizationInfo.Version)}_{DateTime.UtcNow:yyyyMMddHHmmss}.log"; + var fileName = $"upload_{clientName}_{clientVersion}_{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); diff --git a/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs b/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs index 6fc54faf2..34968d493 100644 --- a/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs +++ b/MediaBrowser.Controller/ClientEvent/IClientEventLogger.cs @@ -19,9 +19,13 @@ namespace MediaBrowser.Controller.ClientEvent /// <summary> /// Writes a file to the log directory. /// </summary> - /// <param name="authorizationInfo">The current authorization info.</param> + /// <param name="clientName">The client name writing the document.</param> + /// <param name="clientVersion">The client version writing the document.</param> /// <param name="fileContents">The file contents to write.</param> /// <returns>The created file name.</returns> - Task<string> WriteDocumentAsync(AuthorizationInfo authorizationInfo, Stream fileContents); + Task<string> WriteDocumentAsync( + string clientName, + string clientVersion, + Stream fileContents); } } |
