From 08a7408d8b850ff5b16122df89578ff420b4fe7d Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Tue, 7 Apr 2026 13:12:51 -0700 Subject: [PATCH] Fix playlist sync failing on Emby due to integer ID validation The _is_valid_guid method only accepted 32-char hex GUIDs (Jellyfin format) but Emby uses plain integer IDs like "12345". All matched tracks were rejected as "invalid/empty IDs" causing playlist creation to fail with zero tracks. Now accepts both numeric strings (Emby) and hex GUIDs (Jellyfin). --- core/jellyfin_client.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/core/jellyfin_client.py b/core/jellyfin_client.py index bf1ead88..e51d3d56 100644 --- a/core/jellyfin_client.py +++ b/core/jellyfin_client.py @@ -1311,24 +1311,24 @@ class JellyfinClient: return False def _is_valid_guid(self, guid: str) -> bool: - """Validate that a string is a properly formatted GUID for Emby/Jellyfin""" + """Validate that a string is a properly formatted item ID for Emby/Jellyfin. + Jellyfin uses 32-char hex GUIDs, Emby uses integer IDs — both are valid.""" if not guid or not isinstance(guid, str): return False guid = guid.strip() - - # Check length (GUIDs are typically 32 hex chars + 4 hyphens = 36 chars, or 32 without hyphens) - if len(guid) not in [32, 36]: + if not guid: return False - # Remove hyphens for validation - guid_no_hyphens = guid.replace('-', '') + # Emby uses integer IDs (e.g. "12345") — accept any numeric string + if guid.isdigit(): + return True - # Must be exactly 32 hex characters + # Jellyfin uses GUIDs (32 hex chars, optionally with hyphens for 36 total) + guid_no_hyphens = guid.replace('-', '') if len(guid_no_hyphens) != 32: return False - # All characters must be hexadecimal try: int(guid_no_hyphens, 16) return True