- August 7, 2012
- 336
- 108
- Home Country
- Italy
Hello all.
I've been working on adding LiveTV Program scrobbling on the builtin trakt plugin in the last days since i had some free time.
I'm new to MP2 development and C# development in general, so I decided to start with something that i could actually test every day like scrobbling from Live TV.
I found some problems while trying to get the right informations for the current program (CurrentMediaItem is always set to "Live TV" for Live tv programs) but i finally found a way using these two lines of code.
Now i'm facing another issue and after reading the code of Mediaportal 2 i'm stuck. There seems to be no way to know when the current program changes, either because the program ended or because of channel change, at least not using MP Messages. I'd rather use Subscription Queues instead of a thread that every 10 minutes checks if the program is changed like on Trakt for MP1. Can anyone confirm there's no such message? Are there plans to implement it in future releases?
Using PlayerManagerMessaging.MessageType.PlaybackStateChanged i can detect a channel change (it fires twice though, obviously) but not a program change on the EPG timeline.
Can someone point me to the right direction, if there's any?
Thank you!
I've been working on adding LiveTV Program scrobbling on the builtin trakt plugin in the last days since i had some free time.
I'm new to MP2 development and C# development in general, so I decided to start with something that i could actually test every day like scrobbling from Live TV.
I found some problems while trying to get the right informations for the current program (CurrentMediaItem is always set to "Live TV" for Live tv programs) but i finally found a way using these two lines of code.
C#:
var tvHandler = (SlimTvHandler)ServiceRegistration.Get<ITvHandler>(false);
tvHandler.CurrentProgram.Title
Using PlayerManagerMessaging.MessageType.PlaybackStateChanged i can detect a channel change (it fires twice though, obviously) but not a program change on the EPG timeline.
Can someone point me to the right direction, if there's any?
Thank you!