fix: Cannot Open Any Podcasts in Repod if cache missing or missconfigured (close #58)
All checks were successful
repod / xml (push) Successful in 58s
repod / php (push) Successful in 5m41s
repod / nodejs (push) Successful in 4m50s
repod / release (push) Successful in 10m29s

This commit is contained in:
Michel Roux 2024-02-04 09:40:21 +01:00
parent 2c4a6e3e56
commit 302e8c781b
7 changed files with 53 additions and 22 deletions

View File

@ -1,3 +1,9 @@
## 1.5.5 - 2024-02-04
### Fixed
- Can't open podcast details if cache missing or misconfigured
[#58](https://git.crystalyx.net/Xefir/repod/issues/58) reported by @raxventus
## 1.5.4 - 2024-02-03 ## 1.5.4 - 2024-02-03
### Fixed ### Fixed

View File

@ -11,7 +11,7 @@
## Requirements ## Requirements
You need to have [GPodderSync](https://apps.nextcloud.com/apps/gpoddersync) installed to use this app!]]></description> You need to have [GPodderSync](https://apps.nextcloud.com/apps/gpoddersync) installed to use this app!]]></description>
<version>1.5.4</version> <version>1.5.5</version>
<licence>agpl</licence> <licence>agpl</licence>
<author mail="xefir@crystalyx.net" homepage="https://crystalyx.net">Michel Roux</author> <author mail="xefir@crystalyx.net" homepage="https://crystalyx.net">Michel Roux</author>
<namespace>RePod</namespace> <namespace>RePod</namespace>

View File

@ -3,7 +3,7 @@
"description": "🔊 Browse, manage and listen to podcasts", "description": "🔊 Browse, manage and listen to podcasts",
"type": "project", "type": "project",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"version": "1.5.4", "version": "1.5.5",
"require-dev": { "require-dev": {
"nextcloud/ocp": "^28.0.2", "nextcloud/ocp": "^28.0.2",
"psalm/phar": "^5.21.1", "psalm/phar": "^5.21.1",

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "24b25bff61f30cdac13ab8ab1f354e2e", "content-hash": "aece96039421382f21a6a2eca3610280",
"packages": [], "packages": [],
"packages-dev": [ "packages-dev": [
{ {

View File

@ -23,7 +23,11 @@ class PodcastController extends Controller
} }
public function index(string $url): JSONResponse { public function index(string $url): JSONResponse {
try {
$podcast = $this->podcastDataReader->tryGetCachedPodcastData($url); $podcast = $this->podcastDataReader->tryGetCachedPodcastData($url);
} catch (\Exception $e) {
$podcast = null;
}
if ($podcast) { if ($podcast) {
return new JSONResponse($podcast); return new JSONResponse($podcast);
@ -32,7 +36,11 @@ class PodcastController extends Controller
$client = $this->clientService->newClient(); $client = $this->clientService->newClient();
$feed = $client->get($url); $feed = $client->get($url);
$podcast = PodcastData::parseRssXml((string) $feed->getBody()); $podcast = PodcastData::parseRssXml((string) $feed->getBody());
try {
$this->podcastDataReader->trySetCachedPodcastData($url, $podcast); $this->podcastDataReader->trySetCachedPodcastData($url, $podcast);
} catch (\Exception $e) {
}
return new JSONResponse($podcast, $feed->getStatusCode()); return new JSONResponse($podcast, $feed->getStatusCode());
} }

49
package-lock.json generated
View File

@ -1,12 +1,12 @@
{ {
"name": "repod", "name": "repod",
"version": "1.5.4", "version": "1.5.5",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "repod", "name": "repod",
"version": "1.5.4", "version": "1.5.5",
"license": "agpl", "license": "agpl",
"dependencies": { "dependencies": {
"@nextcloud/axios": "^2.4.0", "@nextcloud/axios": "^2.4.0",
@ -3634,9 +3634,9 @@
} }
}, },
"node_modules/@types/express-serve-static-core": { "node_modules/@types/express-serve-static-core": {
"version": "4.17.42", "version": "4.17.43",
"resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.42.tgz", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.43.tgz",
"integrity": "sha512-ckM3jm2bf/MfB3+spLPWYPUH573plBFwpOhqQ2WottxYV85j1HQFlxmnTq57X1yHY9awZPig06hL/cLMgNWHIQ==", "integrity": "sha512-oaYtiBirUOPQGSWNGPWnzyAFJ0BP3cwvN4oWZQY+zUBwpVIGsKUkpBpSztp74drYcjavs7SKFZ4DX1V2QeN8rg==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
@ -4892,14 +4892,17 @@
} }
}, },
"node_modules/array-buffer-byte-length": { "node_modules/array-buffer-byte-length": {
"version": "1.0.0", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.1.tgz",
"integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", "integrity": "sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"call-bind": "^1.0.2", "call-bind": "^1.0.5",
"is-array-buffer": "^3.0.1" "is-array-buffer": "^3.0.4"
},
"engines": {
"node": ">= 0.4"
}, },
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@ -7419,6 +7422,16 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/es-errors": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.0.0.tgz",
"integrity": "sha512-yHV74THqMJUyFKkHyN7hyENcEZM3Dj2a2IrdClY+IT4BFQHkIVwlh8s6uZfjsFydMdNHv0F5mWgAA3ajFbsvVQ==",
"dev": true,
"peer": true,
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-module-lexer": { "node_modules/es-module-lexer": {
"version": "1.4.1", "version": "1.4.1",
"resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz", "resolved": "https://registry.npmjs.org/es-module-lexer/-/es-module-lexer-1.4.1.tgz",
@ -9043,17 +9056,21 @@
} }
}, },
"node_modules/get-intrinsic": { "node_modules/get-intrinsic": {
"version": "1.2.2", "version": "1.2.3",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.2.tgz", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.3.tgz",
"integrity": "sha512-0gSo4ml/0j98Y3lngkFEot/zhiCeWsbYIlZ+uZOVgzLyLaUw7wxUL+nCTP0XJvJg1AXulJRI3UJi8GsbDuxdGA==", "integrity": "sha512-JIcZczvcMVE7AUOP+X72bh8HqHBRxFdz5PDHYtNG/lE3yk9b3KZBJlwFcTyPYjg3L4RLLmZJzvjxhaZVapxFrQ==",
"dev": true, "dev": true,
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"es-errors": "^1.0.0",
"function-bind": "^1.1.2", "function-bind": "^1.1.2",
"has-proto": "^1.0.1", "has-proto": "^1.0.1",
"has-symbols": "^1.0.3", "has-symbols": "^1.0.3",
"hasown": "^2.0.0" "hasown": "^2.0.0"
}, },
"engines": {
"node": ">= 0.4"
},
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
@ -14329,9 +14346,9 @@
} }
}, },
"node_modules/postcss-html/node_modules/js-tokens": { "node_modules/postcss-html/node_modules/js-tokens": {
"version": "8.0.2", "version": "8.0.3",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.2.tgz", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-8.0.3.tgz",
"integrity": "sha512-Olnt+V7xYdvGze9YTbGFZIfQXuGV4R3nQwwl8BrtgaPE/wq8UFpUHWuTNc05saowhSr1ZO6tx+V6RjE9D5YQog==", "integrity": "sha512-UfJMcSJc+SEXEl9lH/VLHSZbThQyLpw1vLO1Lb+j4RWDvG3N2f7yj3PVQA3cmkTBNldJ9eFnM+xEXxHIXrYiJw==",
"dev": true, "dev": true,
"peer": true "peer": true
}, },

View File

@ -1,7 +1,7 @@
{ {
"name": "repod", "name": "repod",
"description": "🔊 Browse, manage and listen to podcasts", "description": "🔊 Browse, manage and listen to podcasts",
"version": "1.5.4", "version": "1.5.5",
"bugs": { "bugs": {
"url": "https://git.crystalyx.net/Xefir/repod/issues" "url": "https://git.crystalyx.net/Xefir/repod/issues"
}, },