From e4cfb52dab65fe9cceac0e1d5933de62f01618c3 Mon Sep 17 00:00:00 2001 From: Alex Kim Date: Mon, 2 Dec 2024 03:41:25 +1100 Subject: [PATCH] Added change to show actual device name rather than platform --- package.json | 1 + providers/JellyfinProvider.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d9cd6163..3bac6b23 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "react-native-bottom-tabs": "^0.4.0", "react-native-circular-progress": "^1.4.1", "react-native-compressor": "^1.9.0", + "react-native-device-info": "^14.0.1", "react-native-edge-to-edge": "^1.1.1", "react-native-gesture-handler": "~2.16.1", "react-native-get-random-values": "^1.11.0", diff --git a/providers/JellyfinProvider.tsx b/providers/JellyfinProvider.tsx index b823ea6f..88e13292 100644 --- a/providers/JellyfinProvider.tsx +++ b/providers/JellyfinProvider.tsx @@ -18,6 +18,7 @@ import React, { } from "react"; import { Platform } from "react-native"; import uuid from "react-native-uuid"; +import { getDeviceName } from "react-native-device-info"; interface Server { address: string; @@ -49,11 +50,15 @@ export const JellyfinProvider: React.FC<{ children: ReactNode }> = ({ useEffect(() => { (async () => { const id = getOrSetDeviceId(); + const deviceName = await getDeviceName(); setJellyfin( () => new Jellyfin({ clientInfo: { name: "Streamyfin", version: "0.21.0" }, - deviceInfo: { name: Platform.OS === "ios" ? "iOS" : "Android", id }, + deviceInfo: { + name: deviceName, + id, + }, }) ); setDeviceId(id);