Fix multiple device being registered
This commit is contained in:
2 files changed
+8
-2
No files matched your search
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jellyplayer",
|
"name": "jellyplayer",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.0.0-alpha0",
|
"version": "1.0.0",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npx only-allow pnpm",
|
"preinstall": "npx only-allow pnpm",
|
||||||
|
|||||||
+7
-1
@@ -89,6 +89,12 @@ import axios from "axios";
|
|||||||
import axiosTauriApiAdapter from "axios-tauri-api-adapter";
|
import axiosTauriApiAdapter from "axios-tauri-api-adapter";
|
||||||
const axiosClient = axios.create({ adapter: axiosTauriApiAdapter });
|
const axiosClient = axios.create({ adapter: axiosTauriApiAdapter });
|
||||||
|
|
||||||
|
const deviceId = localStorage.getItem("deviceId");
|
||||||
|
|
||||||
|
if (!deviceId) {
|
||||||
|
localStorage.setItem("deviceId", uuidv4());
|
||||||
|
}
|
||||||
|
|
||||||
const jellyfin = new Jellyfin({
|
const jellyfin = new Jellyfin({
|
||||||
clientInfo: {
|
clientInfo: {
|
||||||
name: "JellyPlayer",
|
name: "JellyPlayer",
|
||||||
@@ -96,7 +102,7 @@ const jellyfin = new Jellyfin({
|
|||||||
},
|
},
|
||||||
deviceInfo: {
|
deviceInfo: {
|
||||||
name: "JellyPlayer",
|
name: "JellyPlayer",
|
||||||
id: uuidv4(),
|
id: deviceId,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user