mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
separate device script
This commit is contained in:
parent
42d8ccb0aa
commit
b12f43a584
2 changed files with 27 additions and 28 deletions
26
dashboard-ui/thirdparty/apiclient/device.js
vendored
Normal file
26
dashboard-ui/thirdparty/apiclient/device.js
vendored
Normal file
|
@ -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);
|
Loading…
Add table
Add a link
Reference in a new issue