Skip to content

Commit b7b7b6f

Browse files
committed
added a warning for recent media error instead of crashing
1 parent 675fe72 commit b7b7b6f

2 files changed

Lines changed: 17 additions & 3 deletions

File tree

Project-Aurora/Project-Aurora/Modules/MediaInfoModule.cs

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
using Aurora.Modules.Media;
2-
using Aurora.Utils;
1+
using System;
2+
using System.Windows;
3+
using Aurora.Modules.Media;
34
using Lombok.NET;
45

56
namespace Aurora.Modules;
@@ -11,7 +12,19 @@ public sealed partial class MediaInfoModule : IAuroraModule
1112
[Async]
1213
public void Initialize()
1314
{
14-
_mediaMonitor = new MediaMonitor();
15+
if (!Global.Configuration.EnableMediaInfo)
16+
{
17+
return;
18+
}
19+
try
20+
{
21+
_mediaMonitor = new MediaMonitor();
22+
}
23+
catch (Exception e)
24+
{
25+
MessageBox.Show("Media Info module could not be loaded.\nMedia playback data will not be detected.", "Aurora - Error");
26+
Global.logger.Error("MediaInfo error", e);
27+
}
1528
}
1629

1730

Project-Aurora/Project-Aurora/Settings/Configuration.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -517,6 +517,7 @@ public class Configuration : INotifyPropertyChanged
517517
public bool HighPriority { get; set; } = false;
518518
public BitmapAccuracy BitmapAccuracy { get; set; } = BitmapAccuracy.Okay;
519519
public bool EnableAudioCapture { get; set; } = false;
520+
public bool EnableMediaInfo { get; set; } = true;
520521

521522

522523
public int UpdateDelay { get; set; } = 30;

0 commit comments

Comments
 (0)