Case Study

Planned vs. actual playback: computing expected time from the scene design

Problem

The playback report compares planned and actual playback time for each screen over the day. The planned side is calculated from the content prepared in the scene designer, and in many cases it was wrong:

  • The “hide/show” icon in the designer was assumed to affect playback as well; a single piece of content appeared to be planned for the whole day.
  • Nested playlists and sub-scenes that display another scene weren’t counted at all.
  • Schedules crossing midnight (e.g. 23:00–11:00) were treated as empty.
  • Menu boards containing only prices and text showed up as zero.

Approach

  • We extracted the playback rules from the designer and the device software: how the duration of images, videos and indefinite display is determined.
  • We built a model that also handles nested structures: each item gets its share in turn, and a playlist or sub-scene distributes the share it receives among its own items.
  • Schedules crossing midnight, menu boards and active-only screens are now calculated correctly.
  • The calculation is kept independent of the database and covered by 122 unit tests.

My contribution

I extracted the rules and built the calculation model and the tests.

Technology

  • .NET 8
  • C#
  • MongoDB
  • xUnit