diff --git a/Logic/ApplicationSettings.cs b/Logic/ApplicationSettings.cs index fb7e7455..c282731f 100644 --- a/Logic/ApplicationSettings.cs +++ b/Logic/ApplicationSettings.cs @@ -1,5 +1,5 @@ /** - * Copyright (C) 2022 Xibo Signage Ltd + * Copyright (C) 2023 Xibo Signage Ltd * * Xibo - Digital Signage - http://www.xibo.org.uk * @@ -52,9 +52,9 @@ private static readonly Lazy /// private List ExcludedProperties; - public string ClientVersion { get; } = "3 R307.0"; + public string ClientVersion { get; } = "3 R308.0"; public string Version { get; } = "6"; - public int ClientCodeVersion { get; } = 307; + public int ClientCodeVersion { get; } = 308; private ApplicationSettings() { diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 99021584..743ef70e 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,6 +49,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("3.307.0.0")] -[assembly: AssemblyFileVersion("3.307.0.0")] +[assembly: AssemblyVersion("3.308.0.0")] +[assembly: AssemblyFileVersion("3.308.0.0")] [assembly: Guid("3bd467a4-4ef9-466a-b156-a79c13a863f7")] diff --git a/Rendering/Media.xaml.cs b/Rendering/Media.xaml.cs index 5274b6f5..8e05605f 100644 --- a/Rendering/Media.xaml.cs +++ b/Rendering/Media.xaml.cs @@ -103,6 +103,11 @@ public partial class Media : UserControl /// protected DateTime _startTick; + /// + /// A unique ID for this instance of media + /// + public Guid UniqueId { get; private set; } + /// /// The ScheduleId /// @@ -131,6 +136,8 @@ public Media(MediaOptions options) { InitializeComponent(); + UniqueId = Guid.NewGuid(); + // Store the options. this.options = options; this.Id = options.mediaid; diff --git a/Rendering/Region.xaml.cs b/Rendering/Region.xaml.cs index 49513b60..1459c5f0 100644 --- a/Rendering/Region.xaml.cs +++ b/Rendering/Region.xaml.cs @@ -476,7 +476,7 @@ private void StartNext(double position) // Open a stat record // options accurately reflect the current media, so we can use them. - StatManager.Instance.WidgetStart(this.options.scheduleId, this.options.layoutId, _currentMediaOptions.mediaid); + StatManager.Instance.WidgetStart(newMedia.UniqueId, this.options.scheduleId, this.options.layoutId, _currentMediaOptions.mediaid); } } @@ -706,7 +706,7 @@ private void StopMedia(Media media) // Close the stat record if (media.IsFailedToPlay) { - StatManager.Instance.WidgetClearFailed(media.ScheduleId, media.LayoutId, media.Id); + StatManager.Instance.WidgetClearFailed(media.UniqueId, media.ScheduleId, media.LayoutId, media.Id); if (isAdspaceExchange) { @@ -735,7 +735,7 @@ private void StopMedia(Media media) } else { - StatManager.Instance.WidgetStop(media.ScheduleId, media.LayoutId, media.Id, media.StatsEnabled, adspaceExchangeImpressionUrls); + StatManager.Instance.WidgetStop(media.UniqueId, media.ScheduleId, media.LayoutId, media.Id, media.StatsEnabled, adspaceExchangeImpressionUrls); } // Media Stopped Event removes the media from the scene diff --git a/Stats/StatManager.cs b/Stats/StatManager.cs index 9ab7f5d6..d655f501 100644 --- a/Stats/StatManager.cs +++ b/Stats/StatManager.cs @@ -195,6 +195,7 @@ public void Stop() /// /// Layout Start Event /// + /// /// /// public void LayoutStart(Guid uniqueId, int scheduleId, int layoutId) @@ -224,6 +225,7 @@ public void LayoutStart(Guid uniqueId, int scheduleId, int layoutId) /// /// Layout Stop Event /// + /// /// /// /// @@ -273,17 +275,18 @@ public double LayoutStop(Guid uniqueId, int scheduleId, int layoutId, bool statE /// /// Widget Start Event /// + /// /// /// /// - public void WidgetStart(int scheduleId, int layoutId, string widgetId) + public void WidgetStart(Guid uniqueId, int scheduleId, int layoutId, string widgetId) { Debug.WriteLine(string.Format("WidgetStart: scheduleId: {0}, layoutId: {1}, widgetId: {2}", scheduleId, layoutId, widgetId), "StatManager"); lock (_locker) { // New record, which we put in the dictionary - string key = scheduleId + "-" + layoutId + "-" + widgetId; + string key = uniqueId + "-" + scheduleId + "-" + layoutId + "-" + widgetId; Stat stat = new Stat { Type = StatType.Media, @@ -303,12 +306,19 @@ public void WidgetStart(int scheduleId, int layoutId, string widgetId) } } - public void WidgetClearFailed(int scheduleId, int layoutId, string widgetId) + /// + /// If a widget fails to play we should not record a stat for it. + /// + /// + /// + /// + /// + public void WidgetClearFailed(Guid uniqueId, int scheduleId, int layoutId, string widgetId) { lock (_locker) { // Record we expect to already be open in the Dictionary - string key = scheduleId + "-" + layoutId + "-" + widgetId; + string key = uniqueId + "-" + scheduleId + "-" + layoutId + "-" + widgetId; LogMessage.Info("StatManager", "WidgetClearFailed", "Removing failed widget: " + key); @@ -319,13 +329,14 @@ public void WidgetClearFailed(int scheduleId, int layoutId, string widgetId) /// /// Widget Stop Event /// + /// /// /// /// /// /// /// Duration - public double WidgetStop(int scheduleId, int layoutId, string widgetId, bool statEnabled, List urls) + public double WidgetStop(Guid uniqueId, int scheduleId, int layoutId, string widgetId, bool statEnabled, List urls) { Debug.WriteLine(string.Format("WidgetStop: scheduleId: {0}, layoutId: {1}, widgetId: {2}", scheduleId, layoutId, widgetId), "StatManager"); @@ -334,7 +345,7 @@ public double WidgetStop(int scheduleId, int layoutId, string widgetId, bool sta lock (_locker) { // Record we expect to already be open in the Dictionary - string key = scheduleId + "-" + layoutId + "-" + widgetId; + string key = uniqueId + "-" + scheduleId + "-" + layoutId + "-" + widgetId; if (this.proofOfPlay.TryGetValue(key, out Stat stat)) { diff --git a/XiboClient.csproj b/XiboClient.csproj index d0b30d1f..d7a20a39 100644 --- a/XiboClient.csproj +++ b/XiboClient.csproj @@ -298,7 +298,7 @@ 1.8.9 - 107.1.120 + 111.2.20 1.2.0 @@ -310,7 +310,7 @@ 3.5.2 - 3.0.6 + 3.0.7 3.2.4 @@ -322,19 +322,19 @@ 0.3.6 - 7.0.1 + 7.0.4 14.0.1016.290 - 1.0.1462.37 + 1.0.1587.40 - 4.0.1.10 + 4.0.1.11 - 13.0.2 + 13.0.3 3.1.6