extract jellyfin utils

This commit is contained in:
2025-12-10 11:46:04 +01:00
parent 906b07e20c
commit a5659d90e8
3 changed files with 28 additions and 7 deletions

23
jellyfin/utils.py Normal file
View File

@@ -0,0 +1,23 @@
from getmac import get_mac_address
import os
class JellyfinUtils:
@staticmethod
def get_machine_name() -> str:
"""
Retrieves the machine name of the current host.
Returns:
str: The machine name.
"""
return os.uname().nodename
@staticmethod
def get_unique_id() -> str:
"""
Retrieves the MAC address of the localhost as a unique identifier.
Returns:
str: The MAC address.
"""
return get_mac_address(hostname="localhost")