Difference between revisions of "IR/GSD codes syncronization"
m |
|||
(4 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | [[Category: Programmer's Guide]] | |
+ | 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] | /usr/pluto/bin/WebDB_GetIR.sh [deviceID] [deviceTemplateID] [restriction flag] | ||
Line 7: | Line 8: | ||
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. | 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 | + | 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 | + | 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 | + | 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. |
Latest revision as of 23:52, 10 November 2014
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.