S4M Asset Scheduling

We have implemented a custom S4M asset scheduling process that reads data from the S4M data source and applies it to an Asset Schedule in Chameleon.

The main pieces are

  1. Read S4M data

  2. Create required assets

  3. Schedule assets repeatedly and evenly through a 24 hour period.

    1. but not during blackouts (scheduled in Flow)

S4M Data Source

The S4M data is stored in a SQL Server Database.

There are a couple tables that provide the data:

  • [COP_Uci].[uci].[available_s4m_spot_media]

  • [S4M_Schedule].[s4m].[dlevent]

We have built an ASP.Net Core minimal web API to access this data. This app is running in IIS. It has it’s own Application Pool and an Application in the Default Web Site. By using this type of access we can either pull the data live as json or use BLADE Runner to pull the data and post it somewhere else for access.

The published code is simply copied into the website folder to update it.

API Endpoints

Example endpoint to get the BC1 station’s data for Jan 6, 2023:

http://localhost/S4M/schedule/event/BC1?startDate=2023-01-06

To get to the details for a material:

http://localhost/S4M/material/00032512

All materials in Ad Zones

http://localhost/s4m/material/

 

Asset Scheduler

Settings required include (with examples)

S4M Source Settings

Setting

Example Value

Notes

Setting

Example Value

Notes

Station Id

BC1

 

Live Url

http://localhost/s4m/

URL where the live S4M data is accessible from

Use Live Url

true/false

True pulls data from the live URL
False pulls data from the alt Url

Alternate Url

https://www.bannisterlake.com/dl/Global/S4M/BC1.json

Alternate location where a data file has been made available to use instead - same json format as the live URL (saved output)

Alternate Material Url

https://www.bannisterlake.com/dl/Global/S4M/adzoneMaterials.json

Alternate location where a data file has been saved with Material data pulled from the live URL.

Chameleon and Schedule Settings

Setting

Example Value

Notes

Setting

Example Value

Notes

First Hour of the Day

5

5:00 am

Repeat Count

40

Repeats each item this many times in the 24 hour period

Content Group Name

BC

 

Channel Name

BC1 Test

 

Media Bin Name

BC1 Zone Ads

Location of S4M media
- named by the dlhnumber

Media Bin Content Group Name

BC

 

Project Content Group

Global

 

Project Name

L-Frame 2022 Ad Zones

Must have scenes named

  • Ad Zone 1

  • Ad Zone 2

  • Ad Zone 3

  • Ad Zone 4

Media Field Name

media.media

 

Database User Id

Updater

 

Database User Password

password is set in an environment variable

FlowSettings__DatabaseUserWd

Run as Admin:

Flow Url

https://localhost/chameleon

URL of the Flow instance to populate the data into

 

Processing Steps

  1. Make a connection to the Chameleon database.

  2. Pull the S4M data for the given date

  3. Find the given content group, channel, and media bin items each by name

  4. Find or create assets based on the S4M Id

    1. Looks for an asset whose name matches the S4M Id in the given content group

    2. If not found

      1. Creates a new asset with a template named Ad Zone 1-4 based on the S4M data in the given project (if it can find it)

      2. Attaches the media with the name of the S4M Id to the media.media field (if it can find it)

  5. Reads the blackout schedule for the channel

  6. Calculates the total blackout time

  7. Determines the amount of time between assets that is left

  8. Loops through all the S4M assets, evenly adding each to the schedule in turn over the 24 hours minus the blackout times