diff --git a/dashboard-ui/thirdparty/apiclient/device.js b/dashboard-ui/thirdparty/apiclient/device.js new file mode 100644 index 0000000000..d1fd2500b7 --- /dev/null +++ b/dashboard-ui/thirdparty/apiclient/device.js @@ -0,0 +1,26 @@ +(function (store) { + + MediaBrowser.ApiClient.generateDeviceId = function () { + + var keys = []; + + keys.push(navigator.userAgent); + keys.push((navigator.cpuClass || "")); + + var randomId = ''; + + // Since the above is not guaranteed to be unique per device, add a little more + randomId = store.getItem('randomId'); + + if (!randomId) { + + randomId = new Date().getTime(); + + store.setItem('randomId', randomId.toString()); + } + + keys.push(randomId); + return sha1(keys.join('|')); + }; + +})(store); \ No newline at end of file diff --git a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js index 8282e6d916..7e5a01e4af 100644 --- a/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js +++ b/dashboard-ui/thirdparty/apiclient/mediabrowser.apiclient.js @@ -3194,31 +3194,4 @@ MediaBrowser.ApiClient = function ($, JSON, WebSocket, setTimeout, devicePixelRa }; -}(jQuery, window.JSON, window.WebSocket, setTimeout, window.devicePixelRatio, window.FileReader); - -(function (store) { - - MediaBrowser.ApiClient.generateDeviceId = function () { - - var keys = []; - - keys.push(navigator.userAgent); - keys.push((navigator.cpuClass || "")); - - var randomId = ''; - - // Since the above is not guaranteed to be unique per device, add a little more - randomId = store.getItem('randomId'); - - if (!randomId) { - - randomId = new Date().getTime(); - - store.setItem('randomId', randomId.toString()); - } - - keys.push(randomId); - return sha1(keys.join('|')); - }; - -})(window.store); \ No newline at end of file +}(jQuery, window.JSON, window.WebSocket, setTimeout, window.devicePixelRatio, window.FileReader); \ No newline at end of file