IR/GSD codes syncronization
To decrease the installation time, the infrared or Ruby codes (who are in fact records from the table pluto_main.InfraredGroup_Command) are fetched from our server through a syncronization script.
/usr/pluto/bin/WebDB_GetIR.sh [deviceID] [deviceTemplateID] [restriction flag]
Called with deviceID parameter (PK_Device from Device table) will extract the device template from Device (FK_DeviceTemplate) and use it as second parameter. If Device template parameter is provided, device ID is ignored.
The script will wget a mysqldump generated on our server with the codes with the same manufacturer and device category as the device template, and also the codes with the same FK_InfraredGroup as the device template. The output from server will also contain a list with the psc_id (unique key) of the codes, and those with psc_mod = 0 will be deleted and updated with server codes from sqldump.
Restriction flag is used to retrieve the codes only for a specific set of commands (On, Off, 1, vol up, vol down and so on), those used in last step of "add A/V device" wizard.
The synchronization script is called every time a device is created, and its device template had FK_InfraredGroup not null. If the internet connection is not available, the script can be called from LinuxMCE admin, by choosing "Resync codes" from "A/V equipment" or "generic serial devices" pages.
The web interface had an checkbox, to allow the user to override the codes he changed manually. This also act as a backup, if user messed the codes, he can update them with correct versions.
Note regarding sqlCVS and IR codes
If someone is extending an existing template, and users of the old template do not receive the updates of the IR/GS codes upon doing a sqlCVS IR repo update, they need to "Resync Codes" as well.