From d808ac06095063eae779b48ef4240667d47480b4 Mon Sep 17 00:00:00 2001 From: Michel Roux Date: Thu, 1 Feb 2024 22:30:20 +0100 Subject: [PATCH] fix: episode listing crashing if an invalid publication date is present in the RSS --- CHANGELOG.md | 8 ++++ appinfo/info.xml | 2 +- composer.json | 4 +- composer.lock | 14 +++--- .../EpisodeAction/EpisodeActionReader.php | 10 ++++- package-lock.json | 45 +++++++++---------- package.json | 4 +- src/components/Feed/Episodes.vue | 4 +- 8 files changed, 51 insertions(+), 40 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d05eb4b..a14e153 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +## 1.5.3 - 2024-02-01 + +### Changed +- Update @nextcloud/vue to v8.6.1 + +### Fixed +- Fix episode listing crashing if an invalid publication date is present in the RSS + ## 1.5.2 - 2024-02-01 ### Changed diff --git a/appinfo/info.xml b/appinfo/info.xml index 659ca47..8af8d58 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -11,7 +11,7 @@ ## Requirements You need to have [GPodderSync](https://apps.nextcloud.com/apps/gpoddersync) installed to use this app!]]> - 1.5.2 + 1.5.3 agpl Michel Roux RePod diff --git a/composer.json b/composer.json index edecbd5..9e112a1 100644 --- a/composer.json +++ b/composer.json @@ -3,11 +3,11 @@ "description": "🔊 Browse, manage and listen to podcasts", "type": "project", "license": "AGPL-3.0-or-later", - "version": "1.5.2", + "version": "1.5.3", "require-dev": { "nextcloud/ocp": "^28.0.1", "psalm/phar": "^5.21.1", - "nextcloud/coding-standard": "^v1.2.0" + "nextcloud/coding-standard": "v1.2.1" }, "scripts": { "lint": "find . -name \\*.php -not -path './vendor/*' -print0 | xargs -0 -n1 php -l", diff --git a/composer.lock b/composer.lock index e04b5b8..1267b3d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,21 +4,21 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f3354db16358ec4a9e1cd09f8d24b2c2", + "content-hash": "541949d4ff9cb82157134483415930b6", "packages": [], "packages-dev": [ { "name": "nextcloud/coding-standard", - "version": "v1.2.0", + "version": "v1.2.1", "source": { "type": "git", "url": "https://github.com/nextcloud/coding-standard.git", - "reference": "424cdd9e3befacd71fdd923cb52ccb3693de0e1a" + "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/424cdd9e3befacd71fdd923cb52ccb3693de0e1a", - "reference": "424cdd9e3befacd71fdd923cb52ccb3693de0e1a", + "url": "https://api.github.com/repos/nextcloud/coding-standard/zipball/cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", + "reference": "cf5f18d989ec62fb4cdc7fc92a36baf34b3d829e", "shasum": "" }, "require": { @@ -44,9 +44,9 @@ "description": "Nextcloud coding standards for the php cs fixer", "support": { "issues": "https://github.com/nextcloud/coding-standard/issues", - "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.0" + "source": "https://github.com/nextcloud/coding-standard/tree/v1.2.1" }, - "time": "2024-02-01T12:54:46+00:00" + "time": "2024-02-01T14:54:37+00:00" }, { "name": "nextcloud/ocp", diff --git a/lib/Core/EpisodeAction/EpisodeActionReader.php b/lib/Core/EpisodeAction/EpisodeActionReader.php index 9388a70..a7a3099 100644 --- a/lib/Core/EpisodeAction/EpisodeActionReader.php +++ b/lib/Core/EpisodeAction/EpisodeActionReader.php @@ -99,8 +99,14 @@ class EpisodeActionReader extends CoreEpisodeActionReader } // Get episode pubDate - $rawPubDate = $this->stringOrNull($item->pubDate); - $pubDate = isset($rawPubDate) ? new \DateTime($rawPubDate) : null; + $pubDate = $this->stringOrNull($item->pubDate); + if (isset($pubDate)) { + try { + $pubDate = new \DateTime($pubDate); + } catch (\Exception $e) { + $pubDate = null; + } + } $episodes[] = new EpisodeActionExtraData( $title, diff --git a/package-lock.json b/package-lock.json index 26054e9..1904e36 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "repod", - "version": "1.5.2", + "version": "1.5.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "repod", - "version": "1.5.2", + "version": "1.5.3", "license": "agpl", "dependencies": { "@nextcloud/axios": "^2.4.0", @@ -14,7 +14,7 @@ "@nextcloud/initial-state": "^2.1.0", "@nextcloud/l10n": "^2.2.0", "@nextcloud/router": "^3.0.0", - "@nextcloud/vue": "^8.6.0", + "@nextcloud/vue": "^8.6.1", "vue": "^2", "vue-material-design-icons": "^5.3.0", "vue-router": "^3", @@ -3333,9 +3333,9 @@ } }, "node_modules/@nextcloud/vue": { - "version": "8.6.0", - "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.6.0.tgz", - "integrity": "sha512-0nW8qHvPHAmF/NuWWMiYnWSGNNtDAtfev3OK/mjcwru6G6lBRlEcxHleud03d8f4FMEReLpgdtVcAPNLORPEnQ==", + "version": "8.6.1", + "resolved": "https://registry.npmjs.org/@nextcloud/vue/-/vue-8.6.1.tgz", + "integrity": "sha512-CPPo3A1Az0DDRNI0pn7w6Yn8pJtEDktTXnrfym2Pd+lTzqTj4P2ywf+spArXMHu0BPIB95Eero7XlCiRpmhg/g==", "dependencies": { "@floating-ui/dom": "^1.1.0", "@linusborg/vue-simple-portal": "^0.1.5", @@ -3750,9 +3750,9 @@ "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==" }, "node_modules/@types/node": { - "version": "20.11.15", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.15.tgz", - "integrity": "sha512-gscmuADZfvNULx1eyirVbr3kVOVZtpQtzKMCZpeSZcN6MfbkRXAR4s9/gsQ4CzxLHw6EStDtKLNtSDL3vbq05A==", + "version": "20.11.16", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.16.tgz", + "integrity": "sha512-gKb0enTmRCzXSSUJDq6/sPcqrfCv2mkkG6Jt/clpn5eiCbKTY+SgZUxo+p8ZKMof5dCp9vHQUAB7wOUTod22wQ==", "dependencies": { "undici-types": "~5.26.4" } @@ -9387,14 +9387,11 @@ } }, "node_modules/has-tostringtag": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", - "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.1.tgz", + "integrity": "sha512-6J4rC9ROz0UkOpjn0BRtSSqlewDTDYJNQvy8N8RSrPCduUWId1o9BQPEVII/KKBqRk/ZIQff1YbRkUDCH2N5Sg==", "dev": true, "peer": true, - "dependencies": { - "has-symbols": "^1.0.2" - }, "engines": { "node": ">= 0.4" }, @@ -18075,9 +18072,9 @@ } }, "node_modules/webpack": { - "version": "5.90.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.0.tgz", - "integrity": "sha512-bdmyXRCXeeNIePv6R6tGPyy20aUobw4Zy8r0LUS2EWO+U+Ke/gYDgsCh7bl5rB6jPpr4r0SZa6dPxBxLooDT3w==", + "version": "5.90.1", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.1.tgz", + "integrity": "sha512-SstPdlAC5IvgFnhiRok8hqJo/+ArAbNv7rhU4fnWGHNVfN59HSQFaxZDSAL3IFG2YmqxuRs+IU33milSxbPlog==", "dev": true, "peer": true, "dependencies": { @@ -18363,17 +18360,17 @@ } }, "node_modules/which-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.13.tgz", - "integrity": "sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==", + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.14.tgz", + "integrity": "sha512-VnXFiIW8yNn9kIHN88xvZ4yOWchftKDsRJ8fEPacX/wl1lOvBrhsJ/OeJCXq7B0AaijRuqgzSKalJoPk+D8MPg==", "dev": true, "peer": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.4", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.5", "for-each": "^0.3.3", "gopd": "^1.0.1", - "has-tostringtag": "^1.0.0" + "has-tostringtag": "^1.0.1" }, "engines": { "node": ">= 0.4" diff --git a/package.json b/package.json index 4a88d34..f0b04c5 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "repod", "description": "🔊 Browse, manage and listen to podcasts", - "version": "1.5.2", + "version": "1.5.3", "bugs": { "url": "https://git.crystalyx.net/Xefir/repod/issues" }, @@ -23,7 +23,7 @@ "@nextcloud/initial-state": "^2.1.0", "@nextcloud/l10n": "^2.2.0", "@nextcloud/router": "^3.0.0", - "@nextcloud/vue": "^8.6.0", + "@nextcloud/vue": "^8.6.1", "vue": "^2", "vue-material-design-icons": "^5.3.0", "vue-router": "^3", diff --git a/src/components/Feed/Episodes.vue b/src/components/Feed/Episodes.vue index 4677377..21b4ab0 100644 --- a/src/components/Feed/Episodes.vue +++ b/src/components/Feed/Episodes.vue @@ -6,7 +6,7 @@ :key="episode.guid" :active="isCurrentEpisode(episode)" :class="hasEnded(episode) ? 'ended': ''" - :details="formatLocaleDate(new Date(episode.pubDate.date))" + :details="formatLocaleDate(new Date(episode.pubDate?.date))" :force-display-actions="true" :name="episode.name" :title="episode.description" @@ -116,7 +116,7 @@ export default { try { this.loading = true const episodes = await axios.get(generateUrl('/apps/repod/episodes/list?url={url}', { url: this.url })) - this.episodes = [...episodes.data].sort((a, b) => new Date(b.pubDate.date) - new Date(a.pubDate.date)) + this.episodes = [...episodes.data].sort((a, b) => new Date(b.pubDate?.date) - new Date(a.pubDate?.date)) } catch (e) { console.error(e) showError(t('repod', 'Could not fetch episodes'))