fix: app crash when track result does not have album data (#16)

This commit is contained in:
cl.st authored and GitHub committed 2024-07-23 00:01:57 +02:00
1 parent 244ec7fdf2
commit 5d25ec546c
7 files changed
+30 -58

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
GENERATE_SOURCEMAP=false
REACT_APP_REPO_API_URL="/cstaelen/shazarr"
REACT_APP_CURRENT_VERSION="v0.1.0"
REACT_APP_CURRENT_VERSION="v0.1.1"
+7
View File
@@ -3,6 +3,13 @@ Shazarr notable changes.
[Keep a Changelog](http://keepachangelog.com/en/1.0.0/) format.
## 📦 0.1.1
### 🐛 Fixed
* Fix application crash when track result does not have album information
### 🧹 Renovate
* Add Matomo cookie free and anonimyzed data
## 📦 0.1.0
### 🖍 Changed
* Change notification message to specify prerelease ou release update status
+2 -28
View File
@@ -1,12 +1,12 @@
{
"name": "shazarr-app",
"version": "0.1.0",
"version": "0.1.1",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "shazarr-app",
"version": "0.1.0",
"version": "0.1.1",
"dependencies": {
"@capacitor/android": "^6.1.0",
"@capacitor/app": "^6.0.0",
@@ -3747,20 +3747,6 @@
"node": ">=16.0.0"
}
},
"node_modules/@ionic/utils-subprocess/node_modules/@ionic/utils-fs": {
"version": "3.1.6",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/fs-extra": "^8.0.0",
"debug": "^4.0.0",
"fs-extra": "^9.0.0",
"tslib": "^2.0.1"
},
"engines": {
"node": ">=10.3.0"
}
},
"node_modules/@ionic/utils-subprocess/node_modules/@ionic/utils-process": {
"version": "2.1.11",
"resolved": "https://registry.npmjs.org/@ionic/utils-process/-/utils-process-2.1.11.tgz",
@@ -18726,18 +18712,6 @@
"ms": "^2.1.1"
}
},
"node_modules/react-scripts/node_modules/eslint-plugin-import/node_modules/doctrine": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz",
"integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==",
"license": "Apache-2.0",
"dependencies": {
"esutils": "^2.0.2"
},
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/react-scripts/node_modules/eslint-plugin-import/node_modules/semver": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "shazarr-app",
"version": "0.1.0",
"version": "0.1.1",
"private": true,
"engines": {
"node": ">=18",
+16 -26
View File
@@ -7,38 +7,28 @@
<meta name="theme-color" content="#000000" />
<meta name="description" content="Shazarr - Unoffical Shazam app" />
<!--
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
-->
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Shazarr - Unoffical Shazam app</title>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function () {
var u = "//mtm.cl-st.me/";
_paq.push(['setTrackerUrl', u + 'matomo.php']);
_paq.push(['setSiteId', '3']);
var d = document, g = d.createElement('script'), s = d.getElementsByTagName('script')[0];
g.async = true; g.src = u + 'matomo.js'; s.parentNode.insertBefore(g, s);
})();
</script>
<!-- End Matomo Code -->
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
+1 -1
View File
@@ -22,7 +22,7 @@ export default function ShazarrResults() {
const albumName = shazarrResponse?.sections?.[0]?.metadata?.filter(
(m: { title: string }) => m?.title === "Album",
)?.[0].text;
)?.[0]?.text;
if (!shazarrResponse) return null;
+2 -1
View File
@@ -58,7 +58,8 @@ export default function CardResult({ data }: { data: ShazamTrack }) {
setLyrics(dataLyrics);
}
const sampleURI = data?.hub.actions.filter((action) => !!action.uri)[0].uri;
const sampleURI = data?.hub?.actions?.filter((action) => !!action.uri)?.[0]
?.uri;
if (!sampleURI) return;
const player = new Audio(sampleURI);
setSample(player);