Project

General

Profile

Feature #4461 » 0002-hdhomerun-Generate-serverid-from-server-name.-4461.patch

Em Smith, 2020-06-12 01:18

View differences:

src/webui/webui.c
1615 1615
  access_t *perm = access_get_by_username(hdhr_user);
1616 1616
  char http_ip[128];
1617 1617
  htsbuf_queue_t *hq;
1618
  const char *server_name = config.server_name ?: "TVHeadend";
1619
  /* We generate a unique deviceid based on the server name */
1620
  uint32_t deviceid = tvh_crc32((const uint8_t*)server_name, strlen(server_name), 0);
1618 1621

  
1619 1622
  if (access_verify2(perm, ACCESS_STREAMING))
1620 1623
       return http_noaccess_code(hc);
......
1626 1629
  htsbuf_qprintf(hq, "{ "                                               \
1627 1630
                 "\"BaseURL\" : \"http://%s:%u\", "                     \
1628 1631
                 "\"DeviceAuth\": \"none\", "                           \
1629
                 "\"DeviceID\": \"12345678\", "                         \
1632
                 "\"DeviceID\": \"%08X\", "                             \
1630 1633
                 "\"FirmwareName\": \"hdhomerun_atsc\", "               \
1631 1634
                 "\"FirmwareVersion\": \"20200101\", "                  \
1632 1635
                 "\"FriendlyName\": \"tvheadend\", "                    \
......
1635 1638
                 "\"ModelNumber\": \"HDTC-2US\", "                      \
1636 1639
                 "\"TunerCount\": 6 "                                   \
1637 1640
                 "}",
1638
                 http_ip, tvheadend_webui_port, http_ip, tvheadend_webui_port);
1641
                 http_ip, tvheadend_webui_port,
1642
                 deviceid,
1643
                 http_ip, tvheadend_webui_port);
1639 1644
  http_output_content(hc, "application/json");
1640 1645
  return 0;
1641 1646
}
1642
- 
(5-5/19)