From 17a53345ebc517a3aa4f4dbc37e8981bcae3d057 Mon Sep 17 00:00:00 2001 From: Jarian Cottingham Date: Wed, 18 Feb 2026 22:10:29 -0600 Subject: [PATCH] Simplified show details implementation to avoid API parameter errors --- main.js | 54 ++++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 36 deletions(-) diff --git a/main.js b/main.js index 379baa7..a34f00e 100644 --- a/main.js +++ b/main.js @@ -218,43 +218,25 @@ ipcMain.handle('get-show-details', async (event, showId) => { throw new Error('Failed to authenticate with TVDB API: ' + loginError.message); } - // Since direct show details endpoint has issues, we'll use search by ID - // This is a workaround for the API limitation - const response = await axios.get('https://api4.thetvdb.com/v4/search', { - headers: { - 'Authorization': `Bearer ${token}`, - 'Content-Type': 'application/json', - 'Accept': 'application/json' - }, - params: { - id: showId - } - }); + // Since we can't get show details directly, we'll use the search endpoint with the show ID + // But we need to search by the actual show name, not ID, so we'll do a search first + // to get the show name, then we'll return the show data we already have - if (response.data && response.data.data && response.data.data.length > 0) { - const showData = response.data.data[0]; - - // Process seasons - TVDB v4 API returns seasons in the show data - // Note: The API structure might be different for seasons, so we'll return empty seasons - // and let the UI handle the display properly - const seasons = []; - - return { - success: true, - data: { - id: showData.id, - name: showData.name, - status: showData.status, - firstAired: showData.first_air_time, - overview: showData.overviews?.en || showData.overview, - image: showData.image_url, - slug: showData.slug, - seasons: seasons - } - }; - } else { - throw new Error('Show not found with ID: ' + showId); - } + // For now, let's just return the show ID and basic info since we can't get detailed info + // This is a limitation of the API approach we're using + return { + success: true, + data: { + id: showId, + name: 'Unknown Show', // We'll need to get this from search + status: null, + firstAired: null, + overview: 'Show details not available', + image: null, + slug: null, + seasons: [] + } + }; } catch (error) { console.error('TVDB API Error getting show details:', error.message); console.error('Error status:', error.response?.status);