From fc3694adf4da58d5a13b22196943686a9b49c798 Mon Sep 17 00:00:00 2001 From: Prayag Prajapati Date: Fri, 22 Sep 2023 11:38:48 +0530 Subject: [PATCH] Fix multiple device being registered --- package.json | 2 +- src/App.jsx | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 3ef561f..33b924c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "jellyplayer", "private": true, - "version": "1.0.0-alpha0", + "version": "1.0.0", "type": "module", "scripts": { "preinstall": "npx only-allow pnpm", diff --git a/src/App.jsx b/src/App.jsx index 871f067..5ac265d 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -89,6 +89,12 @@ import axios from "axios"; import axiosTauriApiAdapter from "axios-tauri-api-adapter"; const axiosClient = axios.create({ adapter: axiosTauriApiAdapter }); +const deviceId = localStorage.getItem("deviceId"); + +if (!deviceId) { + localStorage.setItem("deviceId", uuidv4()); +} + const jellyfin = new Jellyfin({ clientInfo: { name: "JellyPlayer", @@ -96,7 +102,7 @@ const jellyfin = new Jellyfin({ }, deviceInfo: { name: "JellyPlayer", - id: uuidv4(), + id: deviceId, }, });