Fix some warnings

609 left
This commit is contained in:
Bond_009
2021-11-09 13:14:31 +01:00
parent 6f85e30475
commit 5726535a26
27 changed files with 61 additions and 53 deletions

View File

@@ -497,7 +497,7 @@ namespace Emby.Server.Implementations.Dto
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting {imageType} image info for {path}", image.Type, image.Path);
_logger.LogError(ex, "Error getting {ImageType} image info for {Path}", image.Type, image.Path);
return null;
}
}

View File

@@ -276,7 +276,7 @@ namespace Emby.Server.Implementations.IO
}
catch (Exception ex)
{
_logger.LogError(ex, "Error watching path: {path}", path);
_logger.LogError(ex, "Error watching path: {Path}", path);
}
});
}

View File

@@ -492,7 +492,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.LogError(ex, "Error in {resolver} resolving {path}", resolver.GetType().Name, args.Path);
_logger.LogError(ex, "Error in {Resolver} resolving {Path}", resolver.GetType().Name, args.Path);
return null;
}
}
@@ -799,7 +799,7 @@ namespace Emby.Server.Implementations.Library
{
var userRootPath = _configurationManager.ApplicationPaths.DefaultUserViewsPath;
_logger.LogDebug("Creating userRootPath at {path}", userRootPath);
_logger.LogDebug("Creating userRootPath at {Path}", userRootPath);
Directory.CreateDirectory(userRootPath);
var newItemId = GetNewItemId(userRootPath, typeof(UserRootFolder));
@@ -810,7 +810,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.LogError(ex, "Error creating UserRootFolder {path}", newItemId);
_logger.LogError(ex, "Error creating UserRootFolder {Path}", newItemId);
}
if (tmpItem == null)
@@ -827,7 +827,7 @@ namespace Emby.Server.Implementations.Library
}
_userRootFolder = tmpItem;
_logger.LogDebug("Setting userRootFolder: {folder}", _userRootFolder);
_logger.LogDebug("Setting userRootFolder: {Folder}", _userRootFolder);
}
}
}
@@ -1213,7 +1213,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.LogError(ex, "Error resolving shortcut file {file}", i);
_logger.LogError(ex, "Error resolving shortcut file {File}", i);
return null;
}
})
@@ -1698,7 +1698,7 @@ namespace Emby.Server.Implementations.Library
if (video == null)
{
_logger.LogError("Intro resolver returned null for {path}.", info.Path);
_logger.LogError("Intro resolver returned null for {Path}.", info.Path);
}
else
{
@@ -1717,7 +1717,7 @@ namespace Emby.Server.Implementations.Library
}
catch (Exception ex)
{
_logger.LogError(ex, "Error resolving path {path}.", info.Path);
_logger.LogError(ex, "Error resolving path {Path}.", info.Path);
}
}
else

View File

@@ -78,7 +78,7 @@ namespace Emby.Server.Implementations.Library.Validators
}
catch (Exception ex)
{
_logger.LogError(ex, "Error validating IBN entry {person}", person);
_logger.LogError(ex, "Error validating IBN entry {Person}", person);
}
// Update progress

View File

@@ -1308,16 +1308,16 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
await recorder.Record(directStreamProvider, mediaStreamInfo, recordPath, duration, onStarted, activeRecordingInfo.CancellationTokenSource.Token).ConfigureAwait(false);
recordingStatus = RecordingStatus.Completed;
_logger.LogInformation("Recording completed: {recordPath}", recordPath);
_logger.LogInformation("Recording completed: {RecordPath}", recordPath);
}
catch (OperationCanceledException)
{
_logger.LogInformation("Recording stopped: {recordPath}", recordPath);
_logger.LogInformation("Recording stopped: {RecordPath}", recordPath);
recordingStatus = RecordingStatus.Completed;
}
catch (Exception ex)
{
_logger.LogError(ex, "Error recording to {recordPath}", recordPath);
_logger.LogError(ex, "Error recording to {RecordPath}", recordPath);
recordingStatus = RecordingStatus.Error;
}
@@ -1404,7 +1404,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
catch (Exception ex)
{
_logger.LogError(ex, "Error deleting 0-byte failed recording file {path}", path);
_logger.LogError(ex, "Error deleting 0-byte failed recording file {Path}", path);
}
}
}

View File

@@ -225,13 +225,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
try
{
_logger.LogInformation("Stopping ffmpeg recording process for {path}", _targetPath);
_logger.LogInformation("Stopping ffmpeg recording process for {Path}", _targetPath);
_process.StandardInput.WriteLine("q");
}
catch (Exception ex)
{
_logger.LogError(ex, "Error stopping recording transcoding job for {path}", _targetPath);
_logger.LogError(ex, "Error stopping recording transcoding job for {Path}", _targetPath);
}
if (_hasExited)
@@ -241,7 +241,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
try
{
_logger.LogInformation("Calling recording process.WaitForExit for {path}", _targetPath);
_logger.LogInformation("Calling recording process.WaitForExit for {Path}", _targetPath);
if (_process.WaitForExit(10000))
{
@@ -250,7 +250,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
}
catch (Exception ex)
{
_logger.LogError(ex, "Error waiting for recording process to exit for {path}", _targetPath);
_logger.LogError(ex, "Error waiting for recording process to exit for {Path}", _targetPath);
}
if (_hasExited)
@@ -260,13 +260,13 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
try
{
_logger.LogInformation("Killing ffmpeg recording process for {path}", _targetPath);
_logger.LogInformation("Killing ffmpeg recording process for {Path}", _targetPath);
_process.Kill();
}
catch (Exception ex)
{
_logger.LogError(ex, "Error killing recording transcoding job for {path}", _targetPath);
_logger.LogError(ex, "Error killing recording transcoding job for {Path}", _targetPath);
}
}
}

View File

@@ -393,7 +393,7 @@ namespace Emby.Server.Implementations.LiveTv
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting image info for {name}", info.Name);
_logger.LogError(ex, "Error getting image info for {Name}", info.Name);
}
return null;

View File

@@ -1054,7 +1054,7 @@ namespace Emby.Server.Implementations.LiveTv
{
cancellationToken.ThrowIfCancellationRequested();
_logger.LogDebug("Refreshing guide from {name}", service.Name);
_logger.LogDebug("Refreshing guide from {Name}", service.Name);
try
{
@@ -1135,7 +1135,7 @@ namespace Emby.Server.Implementations.LiveTv
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting channel information for {name}", channelInfo.Item2.Name);
_logger.LogError(ex, "Error getting channel information for {Name}", channelInfo.Item2.Name);
}
numComplete++;
@@ -1248,7 +1248,7 @@ namespace Emby.Server.Implementations.LiveTv
}
catch (Exception ex)
{
_logger.LogError(ex, "Error getting programs for channel {name}", currentChannel.Name);
_logger.LogError(ex, "Error getting programs for channel {Name}", currentChannel.Name);
}
numComplete++;

View File

@@ -82,7 +82,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
Directory.CreateDirectory(Path.GetDirectoryName(TempFilePath));
Logger.LogInformation("Opening HDHR UDP Live stream from {host}", uri.Host);
Logger.LogInformation("Opening HDHR UDP Live stream from {Host}", uri.Host);
var remoteAddress = IPAddress.Parse(uri.Host);
IPAddress localAddress = null;

View File

@@ -161,11 +161,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
}
catch (UnauthorizedAccessException ex)
{
_logger.LogError(ex, "Error deleting directory {path}", directory);
_logger.LogError(ex, "Error deleting directory {Path}", directory);
}
catch (IOException ex)
{
_logger.LogError(ex, "Error deleting directory {path}", directory);
_logger.LogError(ex, "Error deleting directory {Path}", directory);
}
}
}
@@ -179,11 +179,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
}
catch (UnauthorizedAccessException ex)
{
_logger.LogError(ex, "Error deleting file {path}", path);
_logger.LogError(ex, "Error deleting file {Path}", path);
}
catch (IOException ex)
{
_logger.LogError(ex, "Error deleting file {path}", path);
_logger.LogError(ex, "Error deleting file {Path}", path);
}
}
}

View File

@@ -141,11 +141,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
}
catch (UnauthorizedAccessException ex)
{
_logger.LogError(ex, "Error deleting directory {path}", directory);
_logger.LogError(ex, "Error deleting directory {Path}", directory);
}
catch (IOException ex)
{
_logger.LogError(ex, "Error deleting directory {path}", directory);
_logger.LogError(ex, "Error deleting directory {Path}", directory);
}
}
}
@@ -159,11 +159,11 @@ namespace Emby.Server.Implementations.ScheduledTasks.Tasks
}
catch (UnauthorizedAccessException ex)
{
_logger.LogError(ex, "Error deleting file {path}", path);
_logger.LogError(ex, "Error deleting file {Path}", path);
}
catch (IOException ex)
{
_logger.LogError(ex, "Error deleting file {path}", path);
_logger.LogError(ex, "Error deleting file {Path}", path);
}
}
}