diff --git a/app/package.json b/app/package.json index 0dd62d6..c3d911c 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "movie-match", "private": true, - "version": "2.1.0", + "version": "2.2.0", "type": "module", "scripts": { "dev": "vite", diff --git a/app/src/api/ApiClient.ts b/app/src/api/ApiClient.ts index 1a47f52..6fab488 100644 --- a/app/src/api/ApiClient.ts +++ b/app/src/api/ApiClient.ts @@ -163,7 +163,7 @@ export default class ApiClient extends EventEmitter<{ return this.axios.get(`/media/${mediaId}`).then(({ data }) => data); } - public async getPosterBlobUrl(mediaId: string): Promise { + public async getPosterBlobUrl(mediaId: string): Promise { await this.checkAccessToken(); return this.axios @@ -171,7 +171,8 @@ export default class ApiClient extends EventEmitter<{ responseType: 'blob', }) .then(({ data }) => data) - .then((blob) => URL.createObjectURL(blob)); + .then((blob) => URL.createObjectURL(blob)) + .catch(() => null); } public async getRecommendedMedia( diff --git a/app/src/api/PosterBlob.ts b/app/src/api/PosterBlob.ts index f4d04cb..da21ccb 100644 --- a/app/src/api/PosterBlob.ts +++ b/app/src/api/PosterBlob.ts @@ -2,7 +2,7 @@ import { useApiClient } from '../composables/useApiClient'; const postersByMediaId: Record< string, - { usages: number; urlPromise: Promise } + { usages: number; urlPromise: Promise } > = {}; const apiClient = useApiClient().apiClient; @@ -24,7 +24,10 @@ const free = (mediaId: string) => { postersByMediaId[mediaId].urlPromise.then((url) => { if (postersByMediaId[mediaId].usages === 0) { delete postersByMediaId[mediaId]; - URL.revokeObjectURL(url); + + if (url !== null) { + URL.revokeObjectURL(url); + } } }); }; diff --git a/app/src/components/MediaCard.vue b/app/src/components/MediaCard.vue index 928c358..916d5b0 100644 --- a/app/src/components/MediaCard.vue +++ b/app/src/components/MediaCard.vue @@ -8,6 +8,9 @@ >
+
+ +

{{ props.media.title }}

@@ -31,7 +34,7 @@