Code styling

This commit is contained in:
2022-11-17 23:41:03 +01:00
parent e80f06d8bf
commit 38a7856a0f
9 changed files with 39 additions and 39 deletions

View File

@ -49,12 +49,12 @@ namespace unison
private MpdStatus _currentStatus;
private IMpdFile _currentSong;
private BitmapImage _cover;
public Statistics _stats;
private readonly Statistics _stats;
private readonly System.Timers.Timer _elapsedTimer;
private DispatcherTimer _retryTimer;
private readonly DispatcherTimer _retryTimer;
bool _isUpdatingStatus = false;
bool _isUpdatingSong = false;
private bool _isUpdatingStatus = false;
private bool _isUpdatingSong = false;
public IPAddress _ipAddress;
@ -70,6 +70,8 @@ namespace unison
public CancellationTokenSource _cancelCommand;
private CancellationTokenSource _cancelConnect;
private bool UpdateStarted = false;
public MPDHandler()
{
Startup(null, null);
@ -154,7 +156,7 @@ namespace unison
if (_commandConnection == null || !IsConnected())
{
Trace.WriteLine("[SafelySendCommandAsync] no command connection");
return default(T);
return default;
}
try
@ -176,7 +178,7 @@ namespace unison
Trace.WriteLine($"Sending {command.GetType().Name} failed: {e.Message}");
}
return default(T);
return default;
}
public async void Startup(object sender, EventArgs e)
@ -334,8 +336,6 @@ namespace unison
}, token).ConfigureAwait(false);
}
private bool UpdateStarted = false;
private async Task HandleIdleResponseAsync(string subsystems)
{
try
@ -637,12 +637,12 @@ namespace unison
{
if (_Playlist == null)
return 0;
return _Playlist.ToArray().Count();
return _Playlist.ToArray().Length;
}
public void UpdateDB() => SendCommand(new UpdateCommand());
private string FormatTime(TimeSpan time)
private static string FormatTime(TimeSpan time)
{
string FormattedTime = "";