Skip to content

Commit

Permalink
Improvement to Plex extracting TVDB ID
Browse files Browse the repository at this point in the history
  • Loading branch information
giuseppe99barchetta committed Oct 25, 2024
1 parent b1635e4 commit 3c3d79b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions handler/plex_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ async def process_item(self, user_id, item, title):
elif item_type == 'episode':
await self.process_episode(user_id, key)
else:
raise ValueError(f"Missing key for {item_type} '{title}'. Cannot process this item. Skipping")
raise ValueError(f"Missing key for {item_type} '{title}'. Cannot process this item. Skipping.")
except Exception as e:
self.logger.warning(f"Error while processing item: {str(e)}")

def extract_rating_key(self, item, item_type):
"""Extract the appropriate key depending on the item type."""
key = item.get('key') if item_type == 'movie' else item.get('grandparentKey') if item_type == 'episode' else None
return key.replace('/library/metadata/', '') if key else None
return key if key else None

async def process_movie(self, user_id, movie_key):
"""Find similar movies via TMDb and request them via Jellyseer."""
Expand Down
2 changes: 1 addition & 1 deletion plex/plex_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def get_metadata_provider_id(self, item_id, provider='tmdb'):
:param provider: The provider ID to retrieve (default is 'themoviedb').
:return: The TMDB ID if found, otherwise None.
"""
url = f"{self.api_url}/library/metadata/{item_id}"
url = f"{self.api_url}{item_id}"
try:
async with aiohttp.ClientSession() as session:
async with session.get(url, headers=self.headers, timeout=REQUEST_TIMEOUT) as response:
Expand Down
18 changes: 9 additions & 9 deletions suggestarr-frontend/src/components/configWizard/SeerConfig.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<template>
<div>
<h3 class="text-sm sm:text-lg font-semibold text-gray-300">Step 3: Overseer/Jellyfin API Details</h3>
<p class="text-xs sm:text-sm text-gray-400 mb-4">To obtain your Overseer/Jellyfin API Key, open the Overseer/Jellyfin interface,
<h3 class="text-sm sm:text-lg font-semibold text-gray-300">Step 3: Overseer/Jellyseer API Details</h3>
<p class="text-xs sm:text-sm text-gray-400 mb-4">To obtain your Overseer/Jellyseer API Key, open the Overseer/Jellyseer interface,
navigate to Settings, locate the "API Key" section, and copy your key for use in this configuration.</p>

<!-- Overseer/Jellyfin API URL -->
<label :for="`SEER_API_URL`" class="block text-xs sm:text-sm font-semibold text-gray-300">Overseer/Jellyfin
<!-- Overseer/Jellyseer API URL -->
<label :for="`SEER_API_URL`" class="block text-xs sm:text-sm font-semibold text-gray-300">Overseer/Jellyseer
URL:</label>
<input type="text" :value="config[`SEER_API_URL`]"
@input="updateSeerUrl($event.target.value)"
class="w-full bg-gray-700 border border-gray-600 rounded-lg shadow-md px-4 py-2"
:placeholder="`http://your-Overseer-or-Jellyfin-url`">

<!-- Overseer/Jellyfin API Key -->
<label :for="`SEER_TOKEN`" class="block text-xs sm:text-sm font-semibold text-gray-300 mt-4">Overseer/Jellyfin API
<!-- Overseer/Jellyseer API Key -->
<label :for="`SEER_TOKEN`" class="block text-xs sm:text-sm font-semibold text-gray-300 mt-4">Overseer/Jellyseer API
Key:</label>
<div class="flex flex-col sm:flex-row items-start sm:items-center">
<input type="text" :value="config[`SEER_TOKEN`]"
Expand All @@ -37,16 +37,16 @@
<!-- Error message for failed validation -->
<div v-if="testState.status === 'fail'"
class="bg-gray-800 border border-red-500 text-red-500 px-4 py-3 rounded-lg mt-4" role="alert">
<span class="block sm:inline">Failed to validate Overseer/Jellyfin Key.</span>
<span class="block sm:inline">Failed to validate Overseer/Jellyseer Key.</span>
</div>

<!-- Overseer/Jellyfin user selection -->
<!-- Overseer/Jellyseer user selection -->
<div v-if="testState.status === 'success'" class="mt-4">
<label :for="`SEER_USER_NAME`" class="block text-xs sm:text-sm font-semibold text-gray-300">Select a local
User:</label>

<p class="text-xs sm:text-sm text-gray-400 mb-2">
Only local users of Overseer/Jellyfin can be selected. Selecting a specific user is useful if you want to
Only local users of Overseer/Jellyseer can be selected. Selecting a specific user is useful if you want to
disable automatic approval of requests and manually approve them before automatic downloading.
This step is optional. If no user is selected, the administrator account will be used to make requests.
</p>
Expand Down

0 comments on commit 3c3d79b

Please sign in to comment.