Add Song
This example will detail the steps required in the API to add a song to MusicMaster
Message Received always means the message Nexus received and Message Sent is always the message Nexus returns.
Scenario
A new song is added to the automation system. Without Nexus, the user has to create a song card in MusicMaster and replicate some of that same information. The situation could also be reversed where the song is added in MusicMaster and then has to be added in the automation system. Either way, it's a duplication of work the user can avoid.
Nexus Solution
Nexus gives you the ability to add a song (or any piece of audio) into the automation system and automatically create a new song card with all of the specified metadata synched between the two.
In this first set of commands, a new song is added to the automation system. The automation system sends a to verify that the specified Category\Cart Number combination do not already exist.
<mmRequest command="getSongsByQuery" station="RadioStation" client="AutomationSystem" userData=""> <contents> <query> <filters> <filter type="fieldName" target="Cart Number" operator="equals" value="000A"/> <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 a recordCount of 0 verifying that the Category\Cart number combination does not already exist.
<mmReply command="getSongsByQuery" station="RadioStation" messageId="17" status="ok"> <contents> <songList recordCount="0"/> </contents> </mmReply>
With this confirmation, the automation system now sends an command listing all of the fields available for import. These metadata fields are already specified in the setup configuration and field matching.
<mmRequest command="importSongs" station="RadioStation" client="AutomationSystem" userData=""> <contents> <songList> <song> <field name="Dub Status">true</field> <field name="Cart Number">000A</field> <field name="Category">304</field> <field name="Run Time">3:40</field> <field name="Intro">00</field> <field name="Artist">Adam Craig</field> <field name="Title">Born Wild</field> <field name="Year">2016</field> <field name="Audio Type">DA</field> <field name="Album">Recon CD</field> </song> </songList> </contents> </mmRequest>
Nexus replies to the command with the new songId of the song created.
<mmReply command="importSongs" station="RadioStation" messageId="18" status="ok"> <contents> <songList recordCount="1"> <song songId="3254" cutId="000A"/> </songList> </contents> </mmReply>
The automation system next sends a command to verify the Category\Cart number combination now exists.
<mmRequest command="getSongsByQuery" station="RadioStation" client="AutomationSystem" userData=""> <contents> <query> <filters> <filter type="fieldName" target="Cart Number" operator="equals" value="000A"/> <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 a recordCount of 1 verifying that the record exists.
<mmReply command="getSongsByQuery" station="RadioStation" messageId="19" status="ok"> <contents> <songList recordCount="1"> <song songId="3254" cutId="000A"/> </songList> </contents> </mmReply>
At this point, the song now exists in MusicMaster.