Update Songs

This example will detail the steps required in the API to update a song to MusicMaster


Message Received always means the message Nexus received and Message Sent is always the message Nexus returns.

Scenario

The user is tired of scheduling a 4:55 version of a song only to find out the song is actually 3:55, throwing off your hour timing. The song needs to be updated to the proper time.

 

Nexus Solution

The command can be used for any number of different purposes. While the example here is for an updated runtime of a song in the automation system, it could also be used to update research score fields from a research company.

 

Our example has the automation system first sending a asking for the songID of the song with Cart Number and Category as search keys.

<mmRequest command="getSongsByQuery" station="TestStation" client="AutomationSystem" userData="">
	<contents>
		<query>
			<filters>
				<filter type="fieldName" target="CartNumber" operator="equals" value="0089"/>
				<filter type="fieldName" target="Category" operator="equals" value="304"/>
			</filters>
			<sortKeys>
				<sortKey type="fieldName" target="Title" order="asc"/>
			</sortKeys>
			<properties/>
		</query>
		<properties>
			<property name="maxRecs">1</property>
		</properties>
	</contents>
</mmRequest>

Nexus replies with the songID of the song.

Message Sent: 2016-09-02 10:00:45  [ID=15]

<mmReply command="getSongsByQuery" station="TestStation" messageId="15" status="ok">
	<contents>
		<songList recordCount="1">
			<song songId="388" cutId="0089"/>
		</songList>
	</contents>
</mmReply>

The automation system then replies with an command with all of the metadata fields to be updated. In this case it is only the Run Time that changed, but all metadata fields are then synchronized.

<mmRequest command="updateSongs" station="TestStation" client="AutomationSystem" userData="">
	<contents>
		<songList>
			<song id="388">
			<field name="Dub Status">true</field>
			<field name="CartNumber">0089</field>
			<field name="Category">304</field>
			<field name="Run Time">4:58</field>
			<field name="Intro">29</field>
			<field name="Artist">Coldplay</field>
			<field name="Title">Clocks</field>
			<field name="Year">2010</field>
			<field name="Audio Type">DA</field>
			<field name="Album"></field>
			</song>
		</songList>
	</contents>
</mmRequest>

Nexus replies with its status="ok" message.

Message Sent: 2016-09-02 10:00:45  [ID=16]

<mmReply command="updateSongs" station="TestStation" messageId="16" status="ok"/>