Skip to content

Commit 328517c

Browse files
authored
fix(watchlist): handle undefined Guid for Plex watchlist metadata (#1914)
1 parent 9e73757 commit 328517c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

server/api/plextv.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ interface MetadataResponse {
113113
ratingKey: string;
114114
type: 'movie' | 'show';
115115
title: string;
116-
Guid: {
116+
Guid?: {
117117
id: `imdb://tt${number}` | `tmdb://${number}` | `tvdb://${number}`;
118118
}[];
119119
}[];
@@ -334,10 +334,10 @@ class PlexTvAPI extends ExternalAPI {
334334

335335
const metadata = detailedResponse.MediaContainer.Metadata[0];
336336

337-
const tmdbString = metadata.Guid.find((guid) =>
337+
const tmdbString = metadata.Guid?.find((guid) =>
338338
guid.id.startsWith('tmdb')
339339
);
340-
const tvdbString = metadata.Guid.find((guid) =>
340+
const tvdbString = metadata.Guid?.find((guid) =>
341341
guid.id.startsWith('tvdb')
342342
);
343343

0 commit comments

Comments
 (0)