From 9325056a5b29122477416509d4a2c7f616a4f940 Mon Sep 17 00:00:00 2001 From: Jonas Heinrich <onny@project-insanity.org> Date: Thu, 10 Dec 2020 10:45:38 +0100 Subject: [PATCH] fix play, download episode & code cleanup --- appinfo/routes.php | 4 +- package-lock.json | 742 +-------------------------------------- package.json | 2 +- src/components/Table.vue | 65 ++-- src/router.js | 15 +- src/views/Podcast.vue | 454 ------------------------ 6 files changed, 56 insertions(+), 1226 deletions(-) delete mode 100644 src/views/Podcast.vue diff --git a/appinfo/routes.php b/appinfo/routes.php index c61cb57..709b327 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -72,9 +72,9 @@ return [ ], [ 'name' => 'page#index', - 'url' => '/podcast', + 'url' => '/show', 'verb' => 'GET', - 'postfix' => 'podcast', + 'postfix' => 'show', ], // Settings diff --git a/package-lock.json b/package-lock.json index 30c0f26..5e1d672 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "podcast", - "version": "0.1", + "version": "0.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -2980,7 +2980,8 @@ "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "dev": true }, "ansi-styles": { "version": "3.2.1", @@ -3244,45 +3245,6 @@ "follow-redirects": "^1.10.0" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - } - } - }, "babel-eslint": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz", @@ -3297,122 +3259,6 @@ "resolve": "^1.12.0" } }, - "babel-helper-builder-binary-assignment-operator-visitor": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz", - "integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=", - "requires": { - "babel-helper-explode-assignable-expression": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-call-delegate": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz", - "integrity": "sha1-7Oaqzdx25Bw0YfiL/Fdb0Nqi340=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-define-map": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz", - "integrity": "sha1-pfVtq0GiX5fstJjH66ypgZ+Vvl8=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-explode-assignable-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz", - "integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz", - "integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=", - "requires": { - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-get-function-arity": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz", - "integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-hoist-variables": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz", - "integrity": "sha1-HssnaJydJVE+rbyZFKc/VAi+enY=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-optimise-call-expression": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz", - "integrity": "sha1-96E0J7qfc/j0+pk8VKl4gtEkQlc=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-helper-regex": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz", - "integrity": "sha1-MlxZ+QL4LyS3T6zu0DY5VPZJXnI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-helper-remap-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz", - "integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-helper-replace-supers": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz", - "integrity": "sha1-v22/5Dk40XNpohPKiov3S2qQqxo=", - "requires": { - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, "babel-loader": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.2.1.tgz", @@ -3426,22 +3272,6 @@ "schema-utils": "^2.6.5" } }, - "babel-messages": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-messages/-/babel-messages-6.23.0.tgz", - "integrity": "sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-check-es2015-constants": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz", - "integrity": "sha1-NRV7EBQm/S/9PaP3XH0ekYNbv4o=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", @@ -3450,447 +3280,6 @@ "object.assign": "^4.1.0" } }, - "babel-plugin-syntax-async-functions": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz", - "integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=" - }, - "babel-plugin-syntax-exponentiation-operator": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", - "integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=" - }, - "babel-plugin-syntax-trailing-function-commas": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz", - "integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=" - }, - "babel-plugin-transform-async-to-generator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz", - "integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=", - "requires": { - "babel-helper-remap-async-to-generator": "^6.24.1", - "babel-plugin-syntax-async-functions": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-arrow-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", - "integrity": "sha1-RSaSy3EdX3ncf4XkQM5BufJE0iE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoped-functions": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz", - "integrity": "sha1-u8UbSflk1wy42OC5ToICRs46YUE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-block-scoping": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz", - "integrity": "sha1-1w9SmcEwjQXBL0Y4E7CgnnOxiV8=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "lodash": "^4.17.4" - } - }, - "babel-plugin-transform-es2015-classes": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz", - "integrity": "sha1-WkxYpQyclGHlZLSyo7+ryXolhNs=", - "requires": { - "babel-helper-define-map": "^6.24.1", - "babel-helper-function-name": "^6.24.1", - "babel-helper-optimise-call-expression": "^6.24.1", - "babel-helper-replace-supers": "^6.24.1", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-computed-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz", - "integrity": "sha1-b+Ko0WiV1WNPTNmZttNICjCBWbM=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-destructuring": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz", - "integrity": "sha1-mXux8auWf2gtKwh2/jWNYOdlxW0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-duplicate-keys": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz", - "integrity": "sha1-c+s9MQypaePvnskcU3QabxV2Qj4=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-for-of": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz", - "integrity": "sha1-9HyVsrYT3x0+zC/bdXNiPHUkhpE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-function-name": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz", - "integrity": "sha1-g0yJhTvDaxrw86TF26qU/Y6sqos=", - "requires": { - "babel-helper-function-name": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz", - "integrity": "sha1-T1SgLWzWbPkVKAAZox0xklN3yi4=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-modules-amd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz", - "integrity": "sha1-Oz5UAXI5hC1tGcMBHEvS8AoA0VQ=", - "requires": { - "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-commonjs": { - "version": "6.26.2", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.2.tgz", - "integrity": "sha512-CV9ROOHEdrjcwhIaJNBGMBCodN+1cfkwtM1SbUHmvyy35KGT7fohbpOxkE2uLz1o6odKK2Ck/tz47z+VqQfi9Q==", - "requires": { - "babel-plugin-transform-strict-mode": "^6.24.1", - "babel-runtime": "^6.26.0", - "babel-template": "^6.26.0", - "babel-types": "^6.26.0" - } - }, - "babel-plugin-transform-es2015-modules-systemjs": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz", - "integrity": "sha1-/4mhQrkRmpBhlfXxBuzzBdlAfSM=", - "requires": { - "babel-helper-hoist-variables": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-modules-umd": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz", - "integrity": "sha1-rJl+YoXNGO1hdq22B9YCNErThGg=", - "requires": { - "babel-plugin-transform-es2015-modules-amd": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-object-super": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz", - "integrity": "sha1-JM72muIcuDp/hgPa0CH1cusnj40=", - "requires": { - "babel-helper-replace-supers": "^6.24.1", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-parameters": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz", - "integrity": "sha1-V6w1GrScrxSpfNE7CfZv3wpiXys=", - "requires": { - "babel-helper-call-delegate": "^6.24.1", - "babel-helper-get-function-arity": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-template": "^6.24.1", - "babel-traverse": "^6.24.1", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-shorthand-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz", - "integrity": "sha1-JPh11nIch2YbvZmkYi5R8U3jiqA=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-spread": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz", - "integrity": "sha1-1taKmfia7cRTbIGlQujdnxdG+NE=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-sticky-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz", - "integrity": "sha1-AMHNsaynERLN8M9hJsLta0V8zbw=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-plugin-transform-es2015-template-literals": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz", - "integrity": "sha1-qEs0UPfp+PH2g51taH2oS7EjbY0=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-typeof-symbol": { - "version": "6.23.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz", - "integrity": "sha1-3sCfHN3/lLUqxz1QXITfWdzOs3I=", - "requires": { - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-es2015-unicode-regex": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz", - "integrity": "sha1-04sS9C6nMj9yk4fxinxa4frrNek=", - "requires": { - "babel-helper-regex": "^6.24.1", - "babel-runtime": "^6.22.0", - "regexpu-core": "^2.0.0" - }, - "dependencies": { - "jsesc": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", - "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" - }, - "regexpu-core": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", - "integrity": "sha1-SdA4g3uNz4v6W5pCE5k45uoq4kA=", - "requires": { - "regenerate": "^1.2.1", - "regjsgen": "^0.2.0", - "regjsparser": "^0.1.4" - } - }, - "regjsgen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.2.0.tgz", - "integrity": "sha1-bAFq3qxVT3WCP+N6wFuS1aTtsfc=" - }, - "regjsparser": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.1.5.tgz", - "integrity": "sha1-fuj4Tcb6eS0/0K4ijSS9lJ6tIFw=", - "requires": { - "jsesc": "~0.5.0" - } - } - } - }, - "babel-plugin-transform-exponentiation-operator": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz", - "integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=", - "requires": { - "babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1", - "babel-plugin-syntax-exponentiation-operator": "^6.8.0", - "babel-runtime": "^6.22.0" - } - }, - "babel-plugin-transform-regenerator": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz", - "integrity": "sha1-4HA2lvveJ/Cj78rPi03KL3s6jy8=", - "requires": { - "regenerator-transform": "^0.10.0" - }, - "dependencies": { - "regenerator-transform": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.10.1.tgz", - "integrity": "sha512-PJepbvDbuK1xgIgnau7Y90cwaAmO/LCLMI2mPvaXq2heGMR3aWW5/BQvYrhJ8jgmQjXewXvBjzfqKcVOmhjZ6Q==", - "requires": { - "babel-runtime": "^6.18.0", - "babel-types": "^6.19.0", - "private": "^0.1.6" - } - } - } - }, - "babel-plugin-transform-strict-mode": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz", - "integrity": "sha1-1fr3qleKZbvlkc9e2uBKDGcCB1g=", - "requires": { - "babel-runtime": "^6.22.0", - "babel-types": "^6.24.1" - } - }, - "babel-preset-env": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/babel-preset-env/-/babel-preset-env-1.7.0.tgz", - "integrity": "sha512-9OR2afuKDneX2/q2EurSftUYM0xGu4O2D9adAhVfADDhrYDaxXV0rBbevVYoY9n6nyX1PmQW/0jtpJvUNr9CHg==", - "requires": { - "babel-plugin-check-es2015-constants": "^6.22.0", - "babel-plugin-syntax-trailing-function-commas": "^6.22.0", - "babel-plugin-transform-async-to-generator": "^6.22.0", - "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", - "babel-plugin-transform-es2015-block-scoping": "^6.23.0", - "babel-plugin-transform-es2015-classes": "^6.23.0", - "babel-plugin-transform-es2015-computed-properties": "^6.22.0", - "babel-plugin-transform-es2015-destructuring": "^6.23.0", - "babel-plugin-transform-es2015-duplicate-keys": "^6.22.0", - "babel-plugin-transform-es2015-for-of": "^6.23.0", - "babel-plugin-transform-es2015-function-name": "^6.22.0", - "babel-plugin-transform-es2015-literals": "^6.22.0", - "babel-plugin-transform-es2015-modules-amd": "^6.22.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-systemjs": "^6.23.0", - "babel-plugin-transform-es2015-modules-umd": "^6.23.0", - "babel-plugin-transform-es2015-object-super": "^6.22.0", - "babel-plugin-transform-es2015-parameters": "^6.23.0", - "babel-plugin-transform-es2015-shorthand-properties": "^6.22.0", - "babel-plugin-transform-es2015-spread": "^6.22.0", - "babel-plugin-transform-es2015-sticky-regex": "^6.22.0", - "babel-plugin-transform-es2015-template-literals": "^6.22.0", - "babel-plugin-transform-es2015-typeof-symbol": "^6.23.0", - "babel-plugin-transform-es2015-unicode-regex": "^6.22.0", - "babel-plugin-transform-exponentiation-operator": "^6.22.0", - "babel-plugin-transform-regenerator": "^6.22.0", - "browserslist": "^3.2.6", - "invariant": "^2.2.2", - "semver": "^5.3.0" - }, - "dependencies": { - "browserslist": { - "version": "3.2.8", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", - "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", - "requires": { - "caniuse-lite": "^1.0.30000844", - "electron-to-chromium": "^1.3.47" - } - } - } - }, - "babel-runtime": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", - "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", - "requires": { - "core-js": "^2.4.0", - "regenerator-runtime": "^0.11.0" - }, - "dependencies": { - "core-js": { - "version": "2.6.12", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", - "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" - } - } - }, - "babel-template": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-template/-/babel-template-6.26.0.tgz", - "integrity": "sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=", - "requires": { - "babel-runtime": "^6.26.0", - "babel-traverse": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "lodash": "^4.17.4" - } - }, - "babel-traverse": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-traverse/-/babel-traverse-6.26.0.tgz", - "integrity": "sha1-RqnL1+3MYsjlwGTi0tjQ9ANXZu4=", - "requires": { - "babel-code-frame": "^6.26.0", - "babel-messages": "^6.23.0", - "babel-runtime": "^6.26.0", - "babel-types": "^6.26.0", - "babylon": "^6.18.0", - "debug": "^2.6.8", - "globals": "^9.18.0", - "invariant": "^2.2.2", - "lodash": "^4.17.4" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "globals": { - "version": "9.18.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-9.18.0.tgz", - "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==" - } - } - }, - "babel-types": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-types/-/babel-types-6.26.0.tgz", - "integrity": "sha1-o7Bz+Uq0nrb6Vc1lInozQ4BjJJc=", - "requires": { - "babel-runtime": "^6.26.0", - "esutils": "^2.0.2", - "lodash": "^4.17.4", - "to-fast-properties": "^1.0.3" - }, - "dependencies": { - "to-fast-properties": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-1.0.3.tgz", - "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=" - } - } - }, - "babylon": { - "version": "6.18.0", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-6.18.0.tgz", - "integrity": "sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==" - }, "bail": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz", @@ -6829,6 +6218,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -7203,14 +6593,6 @@ "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, - "invariant": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", - "requires": { - "loose-envify": "^1.0.0" - } - }, "is-accessor-descriptor": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", @@ -7477,6 +6859,14 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "javascript-time-ago": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/javascript-time-ago/-/javascript-time-ago-2.3.3.tgz", + "integrity": "sha512-T4aOCWRQPWv5wsOBiiktKxu1Zd0deIHK2ymKg8XO+MEFZKnZklBOHCXrKbEWPD2Qk2V+ekfmX976r+W1+3dWsw==", + "requires": { + "relative-time-format": "^1.0.5" + } + }, "jed": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/jed/-/jed-1.1.1.tgz", @@ -7621,19 +7011,6 @@ "integrity": "sha512-URvsjaA9ypfreqJ2/ylDr5MUERhJZ+DhguoWRr2xgS5C7aGCalXo+ewL+GixgKBfhT2vuL02nbIgNGqVWgTOYw==", "dev": true }, - "leven": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==" - }, - "levenary": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", - "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", - "requires": { - "leven": "^3.1.0" - } - }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -7802,14 +7179,6 @@ "integrity": "sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg==", "dev": true }, - "loose-envify": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", - "requires": { - "js-tokens": "^3.0.0 || ^4.0.0" - } - }, "loud-rejection": { "version": "1.6.0", "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", @@ -9246,11 +8615,6 @@ } } }, - "private": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", - "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" - }, "process": { "version": "0.11.10", "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", @@ -9595,6 +8959,11 @@ } } }, + "relative-time-format": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/relative-time-format/-/relative-time-format-1.0.5.tgz", + "integrity": "sha512-MAgx/YKcUQYJpIaWcfetPstElnWf26JxVis4PirdwVrrymFdbxyCSm6yENpfB1YuwFbtHSHksN3aBajVNxk10Q==" + }, "remark": { "version": "13.0.0", "resolved": "https://registry.npmjs.org/remark/-/remark-13.0.0.tgz", @@ -10410,6 +9779,7 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "dev": true, "requires": { "ansi-regex": "^2.0.0" } @@ -12082,82 +11452,6 @@ "date-format-parse": "^0.2.6" } }, - "vue2-timeago": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/vue2-timeago/-/vue2-timeago-1.2.9.tgz", - "integrity": "sha512-9XQV49ce+26UBqNKdgHMlDUcr7i2EamDCGskQve4mFW/3MMVbrb05sW7CabBtVnNVAkeldxUxsHPNaZOqU6soA==", - "requires": { - "@babel/core": "^7.8.4", - "@babel/preset-env": "7.8.4", - "babel-preset-env": "^1.7.0" - }, - "dependencies": { - "@babel/preset-env": { - "version": "7.8.4", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.8.4.tgz", - "integrity": "sha512-HihCgpr45AnSOHRbS5cWNTINs0TwaR8BS8xIIH+QwiW8cKL0llV91njQMpeMReEPVs+1Ao0x3RLEBLtt1hOq4w==", - "requires": { - "@babel/compat-data": "^7.8.4", - "@babel/helper-compilation-targets": "^7.8.4", - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-plugin-utils": "^7.8.3", - "@babel/plugin-proposal-async-generator-functions": "^7.8.3", - "@babel/plugin-proposal-dynamic-import": "^7.8.3", - "@babel/plugin-proposal-json-strings": "^7.8.3", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3", - "@babel/plugin-proposal-object-rest-spread": "^7.8.3", - "@babel/plugin-proposal-optional-catch-binding": "^7.8.3", - "@babel/plugin-proposal-optional-chaining": "^7.8.3", - "@babel/plugin-proposal-unicode-property-regex": "^7.8.3", - "@babel/plugin-syntax-async-generators": "^7.8.0", - "@babel/plugin-syntax-dynamic-import": "^7.8.0", - "@babel/plugin-syntax-json-strings": "^7.8.0", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.0", - "@babel/plugin-syntax-object-rest-spread": "^7.8.0", - "@babel/plugin-syntax-optional-catch-binding": "^7.8.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.0", - "@babel/plugin-syntax-top-level-await": "^7.8.3", - "@babel/plugin-transform-arrow-functions": "^7.8.3", - "@babel/plugin-transform-async-to-generator": "^7.8.3", - "@babel/plugin-transform-block-scoped-functions": "^7.8.3", - "@babel/plugin-transform-block-scoping": "^7.8.3", - "@babel/plugin-transform-classes": "^7.8.3", - "@babel/plugin-transform-computed-properties": "^7.8.3", - "@babel/plugin-transform-destructuring": "^7.8.3", - "@babel/plugin-transform-dotall-regex": "^7.8.3", - "@babel/plugin-transform-duplicate-keys": "^7.8.3", - "@babel/plugin-transform-exponentiation-operator": "^7.8.3", - "@babel/plugin-transform-for-of": "^7.8.4", - "@babel/plugin-transform-function-name": "^7.8.3", - "@babel/plugin-transform-literals": "^7.8.3", - "@babel/plugin-transform-member-expression-literals": "^7.8.3", - "@babel/plugin-transform-modules-amd": "^7.8.3", - "@babel/plugin-transform-modules-commonjs": "^7.8.3", - "@babel/plugin-transform-modules-systemjs": "^7.8.3", - "@babel/plugin-transform-modules-umd": "^7.8.3", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.8.3", - "@babel/plugin-transform-new-target": "^7.8.3", - "@babel/plugin-transform-object-super": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.8.4", - "@babel/plugin-transform-property-literals": "^7.8.3", - "@babel/plugin-transform-regenerator": "^7.8.3", - "@babel/plugin-transform-reserved-words": "^7.8.3", - "@babel/plugin-transform-shorthand-properties": "^7.8.3", - "@babel/plugin-transform-spread": "^7.8.3", - "@babel/plugin-transform-sticky-regex": "^7.8.3", - "@babel/plugin-transform-template-literals": "^7.8.3", - "@babel/plugin-transform-typeof-symbol": "^7.8.4", - "@babel/plugin-transform-unicode-regex": "^7.8.3", - "@babel/types": "^7.8.3", - "browserslist": "^4.8.5", - "core-js-compat": "^3.6.2", - "invariant": "^2.2.2", - "levenary": "^1.1.1", - "semver": "^5.5.0" - } - } - } - }, "vuex": { "version": "3.5.1", "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.5.1.tgz", diff --git a/package.json b/package.json index 8794ee8..e7c6b83 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "@nextcloud/vue-dashboard": "^1.0.1", "autoprefixer": "^9.8.6", "howler": "^2.2.1", + "javascript-time-ago": "^2.3.3", "music-metadata": "^7.5.0", "postcss-loader": "^4.1.0", "style-loader": "^2.0.0", @@ -47,7 +48,6 @@ "vue-clipboard2": "^0.3.1", "vue-resize-observer": "^1.0.32", "vue-router": "^3.4.9", - "vue2-timeago": "^1.2.9", "vuex": "^3.5.1" }, "browserslist": [ diff --git a/src/components/Table.vue b/src/components/Table.vue index 48113af..152dda4 100644 --- a/src/components/Table.vue +++ b/src/components/Table.vue @@ -39,41 +39,44 @@ </thead> <tbody> <tr - v-for="(episode, idx) in stationData" + v-for="(episode, idx) in episodes" :key="idx" :class="{ selected: idx === activeItem}"> - <td class="iconColumn" @click="doPlay(idx, episode)"> + <td class="iconColumn"> <blur-hash-image width="64" height="64" hash="L1TSUA?bj[?b~qfQfQj[ayfQfQfQ" :src="episode.imgURL" /> </td> - <td class="nameColumn" @click="doPlay(idx, episode)"> + <td class="nameColumn"> <b>{{ episode.title }}</b> <span>{{ episode.description }}</span> </td> <td class="actionColumn"> <Actions> <ActionButton - v-if="!favorites.flat().includes(episode.stationuuid)" - icon="icon-star" + icon="icon-play" :close-after-click="true" - @click="doFavor(idx, episode)"> - {{ t('podcast', 'Add to favorites') }} + @click="doPlay(idx, episode)"> + {{ t('podcast', 'Play') }} </ActionButton> <ActionButton - v-if="favorites.flat().includes(episode.stationuuid)" - icon="icon-star" + icon="icon-info" :close-after-click="true" - @click="doFavor(idx, episode)"> - {{ t('podcast', 'Remove from favorites') }} + @click="changeRoute('/#/show/1084/5280308')"> + {{ t('podcast', 'Show') }} </ActionButton> <ActionButton - icon="icon-info" + icon="icon-download" :close-after-click="true" - @click="toggleSidebar(episoe)"> - {{ t('podcast', 'Details') }} + @click="downloadFile(episode.enclosure)"> + {{ t('podcast', 'Download') }} + </ActionButton> + <ActionButton + icon="icon-shared" + :close-after-click="true"> + {{ t('podcast', 'Share') }} </ActionButton> </Actions> </td> @@ -81,7 +84,7 @@ {{ episode.duration_string }} </td> <td> - <TimeAgo :datetime="episode.inserted" /> + {{ episode.inserted }} </td> </tr> </tbody> @@ -91,21 +94,15 @@ <script> import Actions from '@nextcloud/vue/dist/Components/Actions' import ActionButton from '@nextcloud/vue/dist/Components/ActionButton' -import TimeAgo from 'vue2-timeago' export default { name: 'Table', components: { Actions, ActionButton, - TimeAgo, }, props: { - favorites: { - type: Array, - default() { return [] }, - }, - stationData: { + episodes: { type: Array, default() { return [] }, }, @@ -113,26 +110,13 @@ export default { data: () => ({ activeItem: null, }), - computed: { - isFolder() { - if (this.stationData[0]) { - if (this.stationData[0].type === 'folder') { - return true - } - } - return false - }, - }, methods: { - doPlay(idx, station) { - this.activeItem = idx - this.$emit('doPlay', station) - }, - doFavor(idx, station) { - this.$emit('doFavor', station) + downloadFile(episodeURL) { + window.open(episodeURL, 'download') }, - toggleSidebar(station) { - this.$emit('toggleSidebar', station) + doPlay(idx, episode) { + this.activeItem = idx + this.$emit('doPlay', episode) }, changeRoute(path) { this.$router.push({ path }) @@ -239,7 +223,6 @@ table { td.nameColumn span { display: block; max-height: 45px; - background: red; white-space: normal; text-overflow: ellipsis; overflow: hidden; diff --git a/src/router.js b/src/router.js index 29615d3..5eaaa69 100644 --- a/src/router.js +++ b/src/router.js @@ -26,7 +26,8 @@ import { generateUrl } from '@nextcloud/router' import axios from '@nextcloud/axios' import Main from './components/Main' -import Podcast from './views/Podcast' +import Show from './views/Show' +import Episode from './views/Episode' import store from './store.js' Vue.use(Router) @@ -58,9 +59,15 @@ const router = new Router({ props: {}, }, { - path: '/podcast/:id', - component: Podcast, - name: 'PODCAST', + path: '/show/:id', + component: Show, + name: 'SHOW', + props: {}, + }, + { + path: '/show/:id/:episodeId', + component: Episode, + name: 'EPISODE', props: {}, }, ], diff --git a/src/views/Podcast.vue b/src/views/Podcast.vue deleted file mode 100644 index 380502e..0000000 --- a/src/views/Podcast.vue +++ /dev/null @@ -1,454 +0,0 @@ -<!-- - - @copyright Copyright (c) 2020 Jonas Heinrich - - - - @author Jonas Heinrich <onny@project-insanity.org> - - - - @license GNU AGPL version 3 or any later version - - - - This program is free software: you can redistribute it and/or modify - - it under the terms of the GNU Affero General Public License as - - published by the Free Software Foundation, either version 3 of the - - License, or (at your option) any later version. - - - - This program is distributed in the hope that it will be useful, - - but WITHOUT ANY WARRANTY; without even the implied warranty of - - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - - GNU Affero General Public License for more details. - - - - You should have received a copy of the GNU Affero General Public License - - along with this program. If not, see <http://www.gnu.org/licenses/>. - - - --> - -<template> - <Content app-name="podcast"> - <Navigation - :station-data="tableData" /> - <AppContent> - <div class="podcastHeader"> - <div - class="podcastImage" - :style="{ backgroundImage: `url(${podcast.imgURL})` }" /> - <div class="podcastDescription"> - <h1>{{ podcast.title }}</h1> - <div class="podcastAuthor"> - by <a href="#">{{ podcast.author }}</a> - </div> - <div>{{ podcast.description }}</div> - <ul - v-for="(category, idx) in podcast.categories" - :key="idx" - :class="podcastCategory"> - <li>{{ podcast.categories[idx] }}</li> - </ul> - </div> - </div> - <Table - v-show="!pageLoading && podcast.episodes.length > 0" - v-resize="onResize" - :station-data="podcast.episodes" - :favorites="favorites" - @doPlay="doPlay" - @doFavor="doFavor" - @toggleSidebar="toggleSidebar" /> - <EmptyContent - v-if="pageLoading" - icon="icon-loading" /> - <EmptyContent - v-if="tableData.length === 0 && !pageLoading" - :icon="emptyContentIcon"> - {{ emptyContentMessage }} - <template #desc> - {{ emptyContentDesc }} - </template> - </EmptyContent> - </AppContent> - <Sidebar - :show-sidebar="showSidebar" - :sidebar-station="sidebarStation" - @toggleSidebar="toggleSidebar" /> - </Content> -</template> - -<script> -import Content from '@nextcloud/vue/dist/Components/Content' -import AppContent from '@nextcloud/vue/dist/Components/AppContent' -import EmptyContent from '@nextcloud/vue/dist/Components/EmptyContent' -import Navigation from '../components/Navigation' -import Table from '../components/Table' -import Sidebar from '../components/Sidebar' -import { Howl, Howler } from 'howler' - -import { generateUrl } from '@nextcloud/router' -import { showError } from '@nextcloud/dialogs' -import axios from '@nextcloud/axios' - -let audioPlayer = null -const requesttoken = axios.defaults.headers.requesttoken - -export default { - name: 'Podcast', - components: { - Navigation, - Content, - AppContent, - Table, - EmptyContent, - Sidebar, - }, - data: () => ({ - podcast: {}, - tableData: [], - pageLoading: false, - favorites: [], - showSidebar: false, - sidebarStation: {}, - queryParams: {}, - }), - computed: { - player() { - return this.$store.state.player - }, - emptyContentMessage() { - if (this.$route.name === 'FAVORITES') { - return t('podcast', 'No favorites yet') - } else if (this.$route.name === 'RECENT') { - return t('podcast', 'No recent stations yet') - } else if (this.$route.name === 'SEARCH') { - return t('podcast', 'No search results') - } - return 'No stations here' - }, - emptyContentIcon() { - if (this.$route.name === 'FAVORITES') { - return 'icon-star' - } else if (this.$route.name === 'RECENT') { - return 'icon-recent' - } else if (this.$route.name === 'SEARCH') { - return 'icon-search' - } - return 'icon-podcast' - }, - emptyContentDesc() { - if (this.$route.name === 'FAVORITES') { - return t('podcast', 'Stations you mark as favorite will show up here') - } else if (this.$route.name === 'RECENT') { - return t('podcast', 'Stations you recently played will show up here') - } else if (this.$route.name === 'SEARCH') { - return t('podcast', 'No stations were found matching your search term') - } - return t('podcast', 'No stations here') - }, - }, - watch: { - $route: 'onRoute', - 'player.volume'(newVolume, oldVolume) { - if (audioPlayer !== null) { - audioPlayer.volume(newVolume) - } - }, - 'player.isPaused'(newState, oldState) { - if (newState === true && audioPlayer !== null) { - audioPlayer.pause() - } else if (newState === false && audioPlayer !== null) { - audioPlayer.play() - } - }, - }, - created() { - this.loadSettings() - this.loadFavorites() - }, - mounted() { - this.onRoute() - this.scroll() - }, - methods: { - - onResize({ width, height }) { - const contentHeight = document.getElementById('app-content-vue').scrollHeight - const tableHeight = height - if (tableHeight < contentHeight) { - this.preFill() - } - }, - - preFill() { - const route = this.$route - console.log(route) - // this.queryPodcast(route.name) - }, - - async onRoute() { - this.tableData = [] - this.pageLoading = true - const podcastId = this.$route.params.id - this.queryPodcast(podcastId) - }, - - /** - * Favor a new station by sending the information to the server - * @param {Object} station Station object - */ - async doFavor(station) { - if (this.favorites.flat().includes(station.stationuuid)) { - let stationid = null - try { - for (let i = 0, len = this.favorites.length; i < len; i++) { - if (station.stationuuid === this.favorites[i][1]) { - stationid = this.favorites[i][0] - } - } - axios.defaults.headers.requesttoken = requesttoken - await axios - .delete(generateUrl(`/apps/podcast/api/favorites/${stationid}`)) - .then(response => { - this.favorites = this.favorites.filter(item => item[1] !== station.stationuuid) - }) - } catch (error) { - showError(t('podcast', 'Could not remove station from favorites')) - } - } else { - try { - let stationSrc = '' - if (!station.url_resolved) { - stationSrc = station.urlresolved - } else { - stationSrc = station.url_resolved - } - const stationMap = { - id: -1, - name: station.name.toString(), - urlresolved: stationSrc.toString(), - favicon: station.favicon.toString(), - stationuuid: station.stationuuid.toString(), - bitrate: station.bitrate.toString(), - country: station.country.toString(), - language: station.language.toString(), - homepage: station.homepage.toString(), - codec: station.codec.toString(), - tags: station.tags.toString(), - } - axios.defaults.headers.requesttoken = requesttoken - await axios - .post(generateUrl('/apps/podcast/api/favorites'), stationMap) - .then(response => { - this.favorites.push([response.data.id, station.stationuuid]) - }) - } catch (error) { - showError(t('podcast', 'Could not favor station')) - } - } - }, - - /** - * Start playing a podcast station and counting the playback - * @param {Object} station Station object - */ - async doPlay(station) { - const vm = this - - vm.$store.dispatch('isBuffering', true) - - if (audioPlayer !== null) { - audioPlayer.fade(vm.player.volume, 0, 500) - } - vm.$store.dispatch('setTitle', station.name) - - let stationSrc = '' - if (!station.url_resolved) { - stationSrc = station.urlresolved - } else { - stationSrc = station.url_resolved - } - Howler.unload() - audioPlayer = new Howl({ - src: stationSrc, - html5: true, - volume: vm.player.volume, - onplay() { - vm.$store.dispatch('isPlaying', true) - vm.$store.dispatch('isBuffering', false) - }, - onpause() { - vm.$store.dispatch('isPlaying', false) - vm.$store.dispatch('isBuffering', false) - }, - onend() { - showError(t('podcast', 'Lost connection to podcast station, retrying ...')) - vm.$store.dispatch('isPlaying', false) - vm.$store.dispatch('isBuffering', true) - }, - }) - audioPlayer.unload() - audioPlayer.play() - audioPlayer.fade(0, vm.player.volume, 500) - - /* Count click */ - try { - delete axios.defaults.headers.requesttoken - axios.get(this.$apiUrl + '/json/url/' + station.stationuuid) - } catch (error) { - showError(t('podcast', 'Unable to count play on remote API')) - } - - /* Put into recent stations */ - try { - let stationSrc = '' - if (!station.url_resolved) { - stationSrc = station.urlresolved - } else { - stationSrc = station.url_resolved - } - const stationMap = { - id: -1, - name: station.name.toString(), - urlresolved: stationSrc.toString(), - favicon: station.favicon.toString(), - stationuuid: station.stationuuid.toString(), - bitrate: station.bitrate.toString(), - country: station.country.toString(), - language: station.language.toString(), - homepage: station.homepage.toString(), - codec: station.codec.toString(), - tags: station.tags.toString(), - } - axios.defaults.headers.requesttoken = requesttoken - await axios - .post(generateUrl('/apps/podcast/api/recent'), stationMap) - } catch (error) { - showError(t('podcast', 'Could not add station to recent list')) - } - - }, - - async queryPodcast(podcastId) { - - const vm = this - podcastId = 1084 - - const queryURI = 'https://api.fyyd.de/0.2/podcast/episodes?podcast_id=' + podcastId - try { - delete axios.defaults.headers.requesttoken - await axios.get(queryURI) - .then(function(response) { - vm.processPodcast(response.data) - }) - } catch (error) { - showError(t('podcast', 'Could not fetch stations from remote API')) - } - }, - - processPodcast(podcast) { - this.podcast = podcast.data - this.pageLoading = false - }, - - /** - * On scroll event, load more stations if bottom reached - */ - scroll() { - window.onscroll = () => { - if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) { - const route = this.$route - console.log(route) - // this.queryPodcast(route.name) - } - } - }, - loadSettings() { - - // axios.defaults.headers.common = { - // 'User-Agent': 'Nextcloud Podcast App/' + this.$version, - // } - this.$store.dispatch('getVolumeState') - - }, - - async loadFavorites() { - const vm = this - try { - axios.defaults.headers.requesttoken = requesttoken - await axios.get(generateUrl('/apps/podcast/api/favorites')) - .then(function(response) { - const favorites = [] - for (let i = 0, len = response.data.length; i < len; i++) { - favorites.push([response.data[i].id, response.data[i].stationuuid]) - } - vm.favorites = favorites - }) - } catch (error) { - showError(t('podcast', 'Unable to load favorites')) - } - }, - - toggleSidebar(station = null) { - if (station) { - this.showSidebar = true - this.sidebarStation = station - } else { - this.showSidebar = false - } - }, - }, -} -</script> - -<style lang="scss"> - -@media only screen and (min-width: 1024px) { - .app-navigation-toggle { - display: none; - } -} - -.podcastHeader { - width: 100%; - background: black; - min-height: 300px; - display: flex; - color: white; - justify-content: center; - padding: 40px 20px; - gap: 30px; - - .podcastImage { - width: 230px; - height: 230px; - background: red; - background-size: cover; - background-position: center center; - } - - .podcastDescription { - max-width: 500px; - max-height: 200px; - overflow: hidden; - text-overflow: ellipsis; - color: #ddd; - - h1 { - font-size: 30px; - font-weight: bold; - line-height: 1.2em; - color: white; - } - - .podcastAuthor { - padding-bottom: 10px; - - a { - color: white; - } - } - - ul.podcastCategory li { - padding: 5px; - background: red; - } - - } - -} - -</style> -- GitLab