Skip to content

Commit

Permalink
added a warning for recent media error instead of crashing
Browse files Browse the repository at this point in the history
  • Loading branch information
Aytackydln committed Jan 6, 2023
1 parent 675fe72 commit b7b7b6f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions Project-Aurora/Project-Aurora/Modules/MediaInfoModule.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Aurora.Modules.Media;
using Aurora.Utils;
using System;
using System.Windows;
using Aurora.Modules.Media;
using Lombok.NET;

namespace Aurora.Modules;
Expand All @@ -11,7 +12,19 @@ public sealed partial class MediaInfoModule : IAuroraModule
[Async]
public void Initialize()
{
_mediaMonitor = new MediaMonitor();
if (!Global.Configuration.EnableMediaInfo)
{
return;
}
try
{
_mediaMonitor = new MediaMonitor();
}
catch (Exception e)
{
MessageBox.Show("Media Info module could not be loaded.\nMedia playback data will not be detected.", "Aurora - Error");
Global.logger.Error("MediaInfo error", e);
}
}


Expand Down
1 change: 1 addition & 0 deletions Project-Aurora/Project-Aurora/Settings/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ public class Configuration : INotifyPropertyChanged
public bool HighPriority { get; set; } = false;
public BitmapAccuracy BitmapAccuracy { get; set; } = BitmapAccuracy.Okay;
public bool EnableAudioCapture { get; set; } = false;
public bool EnableMediaInfo { get; set; } = true;


public int UpdateDelay { get; set; } = 30;
Expand Down

0 comments on commit b7b7b6f

Please sign in to comment.