1
0
Fork 0
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:
Luke Pulverenti 2014-10-26 20:19:52 -04:00
parent 42d8ccb0aa
commit b12f43a584
2 changed files with 27 additions and 28 deletions

View 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);