home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Plugin Development
Registering a new Aspect from a Plugin failing
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="MJGraf" data-source="post: 935414" data-attributes="member: 17886"><p>oh well, that's not going to be easy...</p><p> </p><p>I should have known that anything in MP2 is a plugin - such as the database. So if you startup the PluginManager after you try to startup the BackendServices this gives you a "There is no database present in the system" exception. Not a good idea...</p><p> </p><p>My first thought was to implement something like a "SystemRunning"-method in IPluginStateTracker so that you don't have to listen to system messages just for registering MIAs. But then again I'm not sure if there's a problem with the ApplicationLauncher.</p><p> </p><p><span style="color: #000000">After</span></p><p><span style="font-family: 'arial'"><span style="color: #000000">ApplicationCore.RegisterDefaultMediaItemAspectTypes(); // To be done after backend services are running</span></span></p><p> </p><p><span style="font-family: 'arial'"><span style="color: #000000">it continues with:</span></span></p><p><span style="font-family: 'arial'"><span style="color: #000000">mediaAccessor.Initialize();</span></span></p><p>systemStateService.SwitchSystemState(SystemState.Running, true);</p><p>BackendExtension.ActivateImporterWorker(); // To be done after default media item aspect types are present and when the system is running (other plugins might also install media item aspect types)</p><p> </p><p>So I suppose that plugins should have a possibility to register MIAs before the ImportWorker is started. Since my understanding of messages in MP2 is that they are decoupled from the main thread, I'm also not sure if your implementation now, Leonard, is guaranteed to work. If your plugin takes more time to register the MIAs, they may get registered after the main thread activated the ImportWorker.</p><p> </p><p>Conclusion for me is that we would indeed need something like IPluginStateTracker.SystemRunning(), but we would have to make sure that it is called before ApplicationLauncher activates the ImportWorker. Since this is deep down in the core of MP2, I'll leave that to the Pros now <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p><p> </p><p>cheers,</p><p>Michael</p></blockquote><p></p>
[QUOTE="MJGraf, post: 935414, member: 17886"] oh well, that's not going to be easy... I should have known that anything in MP2 is a plugin - such as the database. So if you startup the PluginManager after you try to startup the BackendServices this gives you a "There is no database present in the system" exception. Not a good idea... My first thought was to implement something like a "SystemRunning"-method in IPluginStateTracker so that you don't have to listen to system messages just for registering MIAs. But then again I'm not sure if there's a problem with the ApplicationLauncher. [COLOR=#000000]After[/COLOR] [FONT=arial][COLOR=#000000]ApplicationCore.RegisterDefaultMediaItemAspectTypes(); // To be done after backend services are running[/COLOR][/FONT] [FONT=arial][COLOR=#000000]it continues with:[/COLOR][/FONT] [FONT=arial][COLOR=#000000]mediaAccessor.Initialize();[/COLOR][/FONT] systemStateService.SwitchSystemState(SystemState.Running, true); BackendExtension.ActivateImporterWorker(); // To be done after default media item aspect types are present and when the system is running (other plugins might also install media item aspect types) So I suppose that plugins should have a possibility to register MIAs before the ImportWorker is started. Since my understanding of messages in MP2 is that they are decoupled from the main thread, I'm also not sure if your implementation now, Leonard, is guaranteed to work. If your plugin takes more time to register the MIAs, they may get registered after the main thread activated the ImportWorker. Conclusion for me is that we would indeed need something like IPluginStateTracker.SystemRunning(), but we would have to make sure that it is called before ApplicationLauncher activates the ImportWorker. Since this is deep down in the core of MP2, I'll leave that to the Pros now ;) cheers, Michael [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Plugin Development
Registering a new Aspect from a Plugin failing
Contact us
RSS
Top
Bottom