Skip to content

Commit

Permalink
Merge pull request #285 from dasgarner/develop
Browse files Browse the repository at this point in the history
Release R308
  • Loading branch information
dasgarner authored Mar 17, 2023
2 parents ea9887e + 57399bc commit e9f74a5
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Logic/ApplicationSettings.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2022 Xibo Signage Ltd
* Copyright (C) 2023 Xibo Signage Ltd
*
* Xibo - Digital Signage - http://www.xibo.org.uk
*
Expand Down Expand Up @@ -52,9 +52,9 @@ private static readonly Lazy<ApplicationSettings>
/// </summary>
private List<string> 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()
{
Expand Down
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
7 changes: 7 additions & 0 deletions Rendering/Media.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ public partial class Media : UserControl
/// </summary>
protected DateTime _startTick;

/// <summary>
/// A unique ID for this instance of media
/// </summary>
public Guid UniqueId { get; private set; }

/// <summary>
/// The ScheduleId
/// </summary>
Expand Down Expand Up @@ -131,6 +136,8 @@ public Media(MediaOptions options)
{
InitializeComponent();

UniqueId = Guid.NewGuid();

// Store the options.
this.options = options;
this.Id = options.mediaid;
Expand Down
6 changes: 3 additions & 3 deletions Rendering/Region.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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
Expand Down
23 changes: 17 additions & 6 deletions Stats/StatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public void Stop()
/// <summary>
/// Layout Start Event
/// </summary>
/// <param name="uniqueId"></param>
/// <param name="scheduleId"></param>
/// <param name="layoutId"></param>
public void LayoutStart(Guid uniqueId, int scheduleId, int layoutId)
Expand Down Expand Up @@ -224,6 +225,7 @@ public void LayoutStart(Guid uniqueId, int scheduleId, int layoutId)
/// <summary>
/// Layout Stop Event
/// </summary>
/// <param name="uniqueId"></param>
/// <param name="scheduleId"></param>
/// <param name="layoutId"></param>
/// <param name="statEnabled"></param>
Expand Down Expand Up @@ -273,17 +275,18 @@ public double LayoutStop(Guid uniqueId, int scheduleId, int layoutId, bool statE
/// <summary>
/// Widget Start Event
/// </summary>
/// <param name="uniqueId"></param>
/// <param name="scheduleId"></param>
/// <param name="layoutId"></param>
/// <param name="widgetId"></param>
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,
Expand All @@ -303,12 +306,19 @@ public void WidgetStart(int scheduleId, int layoutId, string widgetId)
}
}

public void WidgetClearFailed(int scheduleId, int layoutId, string widgetId)
/// <summary>
/// If a widget fails to play we should not record a stat for it.
/// </summary>
/// <param name="uniqueId"></param>
/// <param name="scheduleId"></param>
/// <param name="layoutId"></param>
/// <param name="widgetId"></param>
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);

Expand All @@ -319,13 +329,14 @@ public void WidgetClearFailed(int scheduleId, int layoutId, string widgetId)
/// <summary>
/// Widget Stop Event
/// </summary>
/// <param name="uniqueId"></param>
/// <param name="scheduleId"></param>
/// <param name="layoutId"></param>
/// <param name="widgetId"></param>
/// <param name="statEnabled"></param>
/// <param name="urls"></param>
/// <returns>Duration</returns>
public double WidgetStop(int scheduleId, int layoutId, string widgetId, bool statEnabled, List<string> urls)
public double WidgetStop(Guid uniqueId, int scheduleId, int layoutId, string widgetId, bool statEnabled, List<string> urls)
{
Debug.WriteLine(string.Format("WidgetStop: scheduleId: {0}, layoutId: {1}, widgetId: {2}", scheduleId, layoutId, widgetId), "StatManager");

Expand All @@ -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))
{
Expand Down
12 changes: 6 additions & 6 deletions XiboClient.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@
<Version>1.8.9</Version>
</PackageReference>
<PackageReference Include="CefSharp.Wpf">
<Version>107.1.120</Version>
<Version>111.2.20</Version>
</PackageReference>
<PackageReference Include="Crc32.NET">
<Version>1.2.0</Version>
Expand All @@ -310,7 +310,7 @@
<Version>3.5.2</Version>
</PackageReference>
<PackageReference Include="Flurl">
<Version>3.0.6</Version>
<Version>3.0.7</Version>
</PackageReference>
<PackageReference Include="Flurl.Http">
<Version>3.2.4</Version>
Expand All @@ -322,19 +322,19 @@
<Version>0.3.6</Version>
</PackageReference>
<PackageReference Include="Microsoft.Data.Sqlite">
<Version>7.0.1</Version>
<Version>7.0.4</Version>
</PackageReference>
<PackageReference Include="Microsoft.SqlServer.Types">
<Version>14.0.1016.290</Version>
</PackageReference>
<PackageReference Include="Microsoft.Web.WebView2">
<Version>1.0.1462.37</Version>
<Version>1.0.1587.40</Version>
</PackageReference>
<PackageReference Include="NetMQ">
<Version>4.0.1.10</Version>
<Version>4.0.1.11</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.2</Version>
<Version>13.0.3</Version>
</PackageReference>
<PackageReference Include="NodaTime">
<Version>3.1.6</Version>
Expand Down

0 comments on commit e9f74a5

Please sign in to comment.