stigzler Posted yesterday at 11:08 AM Posted yesterday at 11:08 AM (edited) Hi folks, Developing a super simple plugin to force BB reload of all Platform xmls. Achieve this via: internal class SystemMenuHook : ISystemMenuItemPlugin { public string Caption => "Update Games"; public System.Drawing.Image IconImage => Properties.Resources.GamesUpdate; public bool ShowInLaunchBox => true; public bool ShowInBigBox => true; public bool AllowInBigBoxWhenLocked => true; public void OnSelected() { PluginHelper.DataManager.ForceReload(); } } Using the BB default Theme. If I run the ForceReload() command via the plugin and then enter into the PlatformCategories view, and navigate to a Category which triggers a video playing, I get the following unhandled exception: Object reference not set to an instance of an object. App: Big Box Version: 13.22 Theme: Default Type: System.NullReferenceException Site: Void ReflectPublisherCreator() Source: Unbroken.LaunchBox.Windows at Unbroken.LaunchBox.Windows.Views.ImageVideoView.<>c__DisplayClass25_0.ReflectPublisherCreator() at System.Windows.Threading.DispatcherOperation.InvokeImpl() --- End of stack trace from previous location --- at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) at Unbroken.LaunchBox.Windows.Threading.Invoke(Action callback, DispatcherPriority priority) at Unbroken.LaunchBox.Windows.Views.ImageVideoView.PlayVlcVideo(String filePath, Int32 tries) at FactoryRecommenderVerifier.GenerateSetChooserTransmitter(Object, String filePath, Int32 tries, FactoryRecommenderVerifier) at Unbroken.LaunchBox.Windows.ViewModels.ImageVideoViewModel.set_VideoPath(Object value) at AutomatedEngineFactory.GenerateSetChooserTransmitter(Object, Object value, AutomatedEngineFactory) at Unbroken.LaunchBox.Windows.ViewModels.ImageVideoViewModel.Init(ImageSource source, String video) at Unbroken.LaunchBox.Windows.BigBox.ViewModels.FiltersViewModelBase.TestOrder(ImageSource v) at Unbroken.LaunchBox.Windows.ImageLoader.HandleCalcDic(Object i) at DetailedElementFactory.GenerateSetChooserTransmitter(ImageLoaderQueueItem i, DetailedElementFactory) at Unbroken.LaunchBox.Windows.ImageLoader.Enqueue(String imagePath, Action`1 onLoadedAction) at Unbroken.LaunchBox.Windows.BigBox.ViewModels.FiltersViewModelBase.LoadDetails(Guid instance) at FactoryPolicyEditor.SortTransformer(Object, Guid instance, FactoryPolicyEditor) at Unbroken.LaunchBox.Windows.BigBox.ViewModels.FiltersViewModelBase.<>c__DisplayClass223_0.PeekSynchronizer() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) Recent Log: 11:09:25 Exception It does not happen in other Views (well as many as I could test in anyway). If I run BB again and go to a PlatformCategories view, I do not get the error until I run the plugin again. Have ensured plugin running in vanilla LB environment (making sure it's not due to any changes I've made to xmls). I'm assuming this is a bug in the View or ViewModel? I would sign it off as trivial, but requiring Users not to use the PlatformCategories view feels very poor. This is part of a wider project to allow users to add games to BigBox remotely from another PC whilst bigbox is running, thus the ability to Update the games lists post-adding from within BB options is kinda crucial (stop users having to restart BigBox each time). Shame it's being stimied by this one bug - is it easily fixable? Happy to do anything I can to help (is the default them on a repo somewhere?). Had a quick look at Themes\Default\BigBoxTheme.sln, but couldn't event find ImageVideoView - so not sure where to start. Hope someone can help! Progress: I noted a reference to `Unbroken.LaunchBox.Windows.Views.ImageVideoView.PlayVlcVideo` in the exception, and changed the default player to VLC. This stopped the bug. However, I also see you're depreciating VLC media player so is this a backlog item (i.e. to refactor the relevant code to use media player rather than VLC??). If so - any scheduling of this for a future release yet, as you also warn us NOT to use VLC media player at risk of freezes and crashes. I know reliance on 3rd party apps can be a pain as can be retiring their implementations! Edited yesterday at 11:18 AM by stigzler Quote
C-Beats Posted yesterday at 12:43 PM Posted yesterday at 12:43 PM 1 hour ago, stigzler said: Hi folks, Developing a super simple plugin to force BB reload of all Platform xmls. Achieve this via: internal class SystemMenuHook : ISystemMenuItemPlugin { public string Caption => "Update Games"; public System.Drawing.Image IconImage => Properties.Resources.GamesUpdate; public bool ShowInLaunchBox => true; public bool ShowInBigBox => true; public bool AllowInBigBoxWhenLocked => true; public void OnSelected() { PluginHelper.DataManager.ForceReload(); } } Using the BB default Theme. If I run the ForceReload() command via the plugin and then enter into the PlatformCategories view, and navigate to a Category which triggers a video playing, I get the following unhandled exception: Object reference not set to an instance of an object. App: Big Box Version: 13.22 Theme: Default Type: System.NullReferenceException Site: Void ReflectPublisherCreator() Source: Unbroken.LaunchBox.Windows at Unbroken.LaunchBox.Windows.Views.ImageVideoView.<>c__DisplayClass25_0.ReflectPublisherCreator() at System.Windows.Threading.DispatcherOperation.InvokeImpl() --- End of stack trace from previous location --- at System.Windows.Threading.DispatcherOperation.Wait(TimeSpan timeout) at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherOperation operation, CancellationToken cancellationToken, TimeSpan timeout) at System.Windows.Threading.Dispatcher.Invoke(Action callback, DispatcherPriority priority, CancellationToken cancellationToken, TimeSpan timeout) at Unbroken.LaunchBox.Windows.Threading.Invoke(Action callback, DispatcherPriority priority) at Unbroken.LaunchBox.Windows.Views.ImageVideoView.PlayVlcVideo(String filePath, Int32 tries) at FactoryRecommenderVerifier.GenerateSetChooserTransmitter(Object, String filePath, Int32 tries, FactoryRecommenderVerifier) at Unbroken.LaunchBox.Windows.ViewModels.ImageVideoViewModel.set_VideoPath(Object value) at AutomatedEngineFactory.GenerateSetChooserTransmitter(Object, Object value, AutomatedEngineFactory) at Unbroken.LaunchBox.Windows.ViewModels.ImageVideoViewModel.Init(ImageSource source, String video) at Unbroken.LaunchBox.Windows.BigBox.ViewModels.FiltersViewModelBase.TestOrder(ImageSource v) at Unbroken.LaunchBox.Windows.ImageLoader.HandleCalcDic(Object i) at DetailedElementFactory.GenerateSetChooserTransmitter(ImageLoaderQueueItem i, DetailedElementFactory) at Unbroken.LaunchBox.Windows.ImageLoader.Enqueue(String imagePath, Action`1 onLoadedAction) at Unbroken.LaunchBox.Windows.BigBox.ViewModels.FiltersViewModelBase.LoadDetails(Guid instance) at FactoryPolicyEditor.SortTransformer(Object, Guid instance, FactoryPolicyEditor) at Unbroken.LaunchBox.Windows.BigBox.ViewModels.FiltersViewModelBase.<>c__DisplayClass223_0.PeekSynchronizer() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) Recent Log: 11:09:25 Exception It does not happen in other Views (well as many as I could test in anyway). If I run BB again and go to a PlatformCategories view, I do not get the error until I run the plugin again. Have ensured plugin running in vanilla LB environment (making sure it's not due to any changes I've made to xmls). I'm assuming this is a bug in the View or ViewModel? I would sign it off as trivial, but requiring Users not to use the PlatformCategories view feels very poor. This is part of a wider project to allow users to add games to BigBox remotely from another PC whilst bigbox is running, thus the ability to Update the games lists post-adding from within BB options is kinda crucial (stop users having to restart BigBox each time). Shame it's being stimied by this one bug - is it easily fixable? Happy to do anything I can to help (is the default them on a repo somewhere?). Had a quick look at Themes\Default\BigBoxTheme.sln, but couldn't event find ImageVideoView - so not sure where to start. Hope someone can help! Progress: I noted a reference to `Unbroken.LaunchBox.Windows.Views.ImageVideoView.PlayVlcVideo` in the exception, and changed the default player to VLC. This stopped the bug. However, I also see you're depreciating VLC media player so is this a backlog item (i.e. to refactor the relevant code to use media player rather than VLC??). If so - any scheduling of this for a future release yet, as you also warn us NOT to use VLC media player at risk of freezes and crashes. I know reliance on 3rd party apps can be a pain as can be retiring their implementations! The call in question won't even exist in next version so we should be good to go. Grab beta 3 once it's out to confirm. Quote
stigzler Posted yesterday at 12:46 PM Author Posted yesterday at 12:46 PM Thanks for the reply, Beats and great to hear. 👍 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.