More fixes to the new config. Module loader reworked

This commit is contained in:
2024-08-06 22:47:59 +03:00
parent 27e25a9166
commit 18a059af0e
51 changed files with 390 additions and 301 deletions

View File

@@ -29,13 +29,13 @@ public class MusicPlayer
{
if (isQueueRunning)
{
Application.CurrentApplication.Logger.Log("Another queue is running !", typeof(MusicPlayer), LogType.Warning);
Application.Logger.Log("Another queue is running !", typeof(MusicPlayer), LogType.Warning);
return;
}
if (Variables.audioClient is null)
{
Application.CurrentApplication.Logger.Log("Audio Client is null", typeof(MusicPlayer), LogType.Warning);
Application.Logger.Log("Audio Client is null", typeof(MusicPlayer), LogType.Warning);
return;
}
@@ -44,7 +44,7 @@ public class MusicPlayer
string? ffmpegPath = await Application.CurrentApplication.PluginManager.GetDependencyLocation("FFMPEG");
if(ffmpegPath is null)
{
Application.CurrentApplication.Logger.Log("FFMPEG is missing. Please install it and try again.", typeof(MusicPlayer), LogType.Error);
Application.Logger.Log("FFMPEG is missing. Please install it and try again.", typeof(MusicPlayer), LogType.Error);
isQueueRunning = false;
return;
}
@@ -61,7 +61,7 @@ public class MusicPlayer
using var ffmpeg = CreateStream(ffmpegPath, CurrentlyPlaying.Location);
if (ffmpeg is null)
{
Application.CurrentApplication.Logger.Log($"Failed to start ffmpeg process. FFMPEG is missing or the {CurrentlyPlaying.Location} has an invalid format.", typeof(MusicPlayer), LogType.Error);
Application.Logger.Log($"Failed to start ffmpeg process. FFMPEG is missing or the {CurrentlyPlaying.Location} has an invalid format.", typeof(MusicPlayer), LogType.Error);
continue;
}
await using var ffmpegOut = ffmpeg.StandardOutput.BaseStream;
@@ -111,7 +111,7 @@ public class MusicPlayer
}
catch (Exception ex)
{
Application.CurrentApplication.Logger.LogException(ex, this);
Application.Logger.LogException(ex, this);
break;
}
}