From 52162857b8e8d13927c15bbc97afeb076607e740 Mon Sep 17 00:00:00 2001
From: Sebastiii <sebastiii@team-mediaportal.com>
Date: Sat, 4 Jun 2016 09:05:43 +0200
Subject: [PATCH 2/4] Fork : Adding new event to set GUI OSD (TVS)

---
 External/Common.GUIPlugins.dll | Bin 154624 -> 162816 bytes
 MP-TVSeries/VideoHandler.cs    |  12 +++++++++++-
 2 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/External/Common.GUIPlugins.dll b/External/Common.GUIPlugins.dll
index ce0224005a4496e405f09f3df118fe9df44f8b8e..cf863225ad8f3f843ad8cd9c1a2c97d97afd79ff 100644
GIT binary patch
diff --git a/MP-TVSeries/VideoHandler.cs b/MP-TVSeries/VideoHandler.cs
index 763938f..5a144d7 100644
--- a/MP-TVSeries/VideoHandler.cs
+++ b/MP-TVSeries/VideoHandler.cs
@@ -99,6 +99,7 @@ namespace WindowPlugins.GUITVSeries
             g_Player.PlayBackEnded += new MediaPortal.Player.g_Player.EndedHandler(OnPlayBackEnded);
             g_Player.PlayBackStarted += new MediaPortal.Player.g_Player.StartedHandler(OnPlayBackStarted);
             g_Player.PlayBackChanged += new g_Player.ChangedHandler(OnPlaybackChanged);
+            MediaPortal.GUI.Video.GUIVideoOverlay.SetGuiPropertiesUpdate += new MediaPortal.GUI.Video.GUIVideoOverlay.SetGuiProperties(SetGuiPropertiesUpdate);
             PlayPropertyUpdater.WorkerSupportsCancellation = true;
             PlayPropertyUpdater.DoWork += new DoWorkEventHandler(SetPlayProperties_DoWork);
         }
@@ -304,6 +305,14 @@ namespace WindowPlugins.GUITVSeries
             SetGUIProperties((bool)e.Argument);
         }
 
+        private void SetGuiPropertiesUpdate(g_Player.MediaType type, string filename)
+        {
+          if (PlayBackOpIsOfConcern(type, filename))
+          {
+            SetGUIProperties(false);
+          }
+        }
+
         /// <summary>
         /// Sets the following Properties:
         /// "#Play.Current.Title"
@@ -377,7 +386,7 @@ namespace WindowPlugins.GUITVSeries
                     GUIPropertyManager.SetProperty(kvp.Key, " ");
                 }
             }
-			
+
             GUIPropertyManager.SetProperty("#Play.Current.Title", clear ? " " : m_currentEpisode.onlineEpisode.CompleteTitle);
             GUIPropertyManager.SetProperty("#Play.Current.Year", clear ? " " : FieldGetter.resolveDynString("<" + DBEpisode.cOutName + "." + DBOnlineEpisode.cFirstAired + ">", m_currentEpisode, false));
             GUIPropertyManager.SetProperty("#Play.Current.Genre", clear ? " " : FieldGetter.resolveDynString(TVSeriesPlugin.m_sFormatEpisodeSubtitle, m_currentEpisode));
@@ -587,6 +596,7 @@ namespace WindowPlugins.GUITVSeries
             if (PlayBackOpIsOfConcern(type, filename))
             {
                 LogPlayBackOp("started", filename);
+                // TODO surely can be removed now.
                 // really stupid, you have to wait until the player itself sets the properties (a few seconds) and after that set them
                 PlayPropertyUpdater.RunWorkerAsync(false);
             }
-- 
2.9.2.windows.1

