From e1d7d158ac79be66178dbd1d4de1a995af4651d6 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 9 Oct 2024 08:28:01 +1300 Subject: [PATCH 1/6] Bump version --- materialious/android/app/build.gradle | 4 ++-- materialious/electron/package.json | 2 +- materialious/package.json | 2 +- update_versions.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 56d32633..8fc6fc1c 100644 --- a/materialious/android/app/build.gradle +++ b/materialious/android/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "us.materialio.app" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 53 - versionName "1.6.2" + versionCode 54 + versionName "1.6.3" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/materialious/electron/package.json b/materialious/electron/package.json index c8ca0c93..dc816648 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.6.2", + "version": "1.6.3", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/package.json b/materialious/package.json index 2c8ed6d5..31eb170a 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.6.2", + "version": "1.6.3", "private": true, "scripts": { "dev": "vite dev", diff --git a/update_versions.py b/update_versions.py index 07cb5de3..966dbd0f 100644 --- a/update_versions.py +++ b/update_versions.py @@ -5,7 +5,7 @@ import json import os import re -LATEST_VERSION = "1.6.2" +LATEST_VERSION = "1.6.3" WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious") ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json") From 88adf0578f35ce9a3ab40c6028bbeb3bab0c214f Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 9 Oct 2024 08:29:27 +1300 Subject: [PATCH 2/6] Include package lock in android nodejs --- materialious/.gitignore | 3 +- .../static/nodejs-android/package-lock.json | 54 +++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 materialious/static/nodejs-android/package-lock.json diff --git a/materialious/.gitignore b/materialious/.gitignore index d119472f..a261d8de 100644 --- a/materialious/.gitignore +++ b/materialious/.gitignore @@ -14,4 +14,5 @@ yarn.lock vite.config.js.timestamp-* vite.config.ts.timestamp-* resources/android/**/* -android/release.jks* \ No newline at end of file +android/release.jks* +!static/nodejs-android/package-lock.json \ No newline at end of file diff --git a/materialious/static/nodejs-android/package-lock.json b/materialious/static/nodejs-android/package-lock.json new file mode 100644 index 00000000..2ce1406a --- /dev/null +++ b/materialious/static/nodejs-android/package-lock.json @@ -0,0 +1,54 @@ +{ + "name": "cors-patch", + "version": "0.0.1", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "cors-patch", + "version": "0.0.1", + "dependencies": { + "cors-anywhere": "^0.4.4" + } + }, + "node_modules/cors-anywhere": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cors-anywhere/-/cors-anywhere-0.4.4.tgz", + "integrity": "sha512-8OBFwnzMgR4mNrAeAyOLB2EruS2z7u02of2bOu7i9kKYlZG+niS7CTHLPgEXKWW2NAOJWRry9RRCaL9lJRjNqg==", + "dependencies": { + "http-proxy": "1.11.1", + "proxy-from-env": "0.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eventemitter3": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-1.2.0.tgz", + "integrity": "sha512-DOFqA1MF46fmZl2xtzXR3MPCRsXqgoFqdXcrCVYM3JNnfUeHTm/fh/v/iU7gBFpwkuBmoJPAm5GuhdDfSEJMJA==" + }, + "node_modules/http-proxy": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.11.1.tgz", + "integrity": "sha512-qz7jZarkVG3G6GMq+4VRJPSN4NkIjL4VMTNhKGd8jc25BumeJjWWvnY3A7OkCGa8W1TTxbaK3dcE0ijFalITVA==", + "dependencies": { + "eventemitter3": "1.x.x", + "requires-port": "0.x.x" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/proxy-from-env": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-0.0.1.tgz", + "integrity": "sha512-B9Hnta3CATuMS0q6kt5hEezOPM+V3dgaRewkFtFoaRQYTVNsHqUvFXmndH06z3QO1ZdDnRELv5vfY6zAj/gG7A==" + }, + "node_modules/requires-port": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-0.0.1.tgz", + "integrity": "sha512-AzPDCliPoWDSvEVYRQmpzuPhGGEnPrQz9YiOEvn+UdB9ixBpw+4IOZWtwctmpzySLZTy7ynpn47V14H4yaowtA==" + } + } +} From af592a63fbf79329c7d375fff152bd997a070f39 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 9 Oct 2024 08:47:06 +1300 Subject: [PATCH 3/6] Added URL support --- .../android/app/src/main/AndroidManifest.xml | 24 +++++++++++++++ materialious/src/routes/(app)/+layout.svelte | 30 ++++++++++++++----- 2 files changed, 46 insertions(+), 8 deletions(-) diff --git a/materialious/android/app/src/main/AndroidManifest.xml b/materialious/android/app/src/main/AndroidManifest.xml index 46e1aea0..bfc605c7 100644 --- a/materialious/android/app/src/main/AndroidManifest.xml +++ b/materialious/android/app/src/main/AndroidManifest.xml @@ -25,6 +25,30 @@ + + + + + + + + + + + + { - const authUrl = new URL(data.url); - const username = authUrl.searchParams.get('username'); - const token = authUrl.searchParams.get('token'); + const url = new URL(data.url); - if (username && token) { - authStore.set({ - username: username, - token: token - }); + if (data.url.includes('youtu')) { + let videoId = url.searchParams.get('v'); + if (!videoId) { + videoId = url.pathname.split('/')[1]; + } + + if (!videoId) { + return; + } + + goto(`/watch/${videoId}`); + } else { + const username = url.searchParams.get('username'); + const token = url.searchParams.get('token'); + + if (username && token) { + authStore.set({ + username: username, + token: token + }); + } } }); From 99b0a31da64b4a4e9dd94058506c45be8d9fd4b8 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 9 Oct 2024 09:44:49 +1300 Subject: [PATCH 4/6] Overhauled settings --- materialious/src/lib/Settings.svelte | 1075 +++++++++++---------- materialious/src/lib/i18n/locales/en.json | 1 + materialious/static/style.css | 2 +- 3 files changed, 559 insertions(+), 519 deletions(-) diff --git a/materialious/src/lib/Settings.svelte b/materialious/src/lib/Settings.svelte index b378830e..90ae9c37 100644 --- a/materialious/src/lib/Settings.svelte +++ b/materialious/src/lib/Settings.svelte @@ -7,7 +7,7 @@ import { iso31661 } from 'iso-3166'; import { _ } from 'svelte-i18n'; import { get } from 'svelte/store'; - import { ensureNoTrailingSlash, titleCase, titleCases, truncate } from './misc'; + import { ensureNoTrailingSlash, titleCase, titleCases } from './misc'; import { authStore, darkModeStore, @@ -95,598 +95,637 @@ darkModeStore.set(true); } } + + let activeTab: + | 'interface' + | 'player' + | 'data' + | 'ryd' + | 'api extended' + | 'sponsorblock' + | 'dearrow' = 'interface'; - - + +
+ + {#if Capacitor.isNativePlatform()} +
{ + instanceStore.set(ensureNoTrailingSlash(invidiousInstance)); + authStore.set(null); + goto('/', { replaceState: true }); + ui('#dialog-settings'); + }} + > + +
{/if} - - - - {#if Capacitor.isNativePlatform()} -
-
Invidious
+
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + + arrow_drop_down +
+ +
+ + + arrow_drop_down +
+ + {#if !Capacitor.isNativePlatform()} +
+
{$_('layout.bookmarklet')}
+ +
+ {/if} +
+
+
+ +
+ +
+ +
+ +
+ +
+ + {#if Capacitor.getPlatform() === 'android'} +
+ +
+ {/if} + + {#if Capacitor.isNativePlatform()} +
+ +
+ {/if} + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ + {#if Capacitor.isNativePlatform()} +
+ +
+ +
+ +
+ {/if} +
+ +
{ - instanceStore.set(ensureNoTrailingSlash(invidiousInstance)); - authStore.set(null); - goto('/', { replaceState: true }); - ui('#dialog-settings'); - }} + on:submit|preventDefault={() => + returnYTDislikesInstanceStore.set(ensureNoTrailingSlash(returnYTInstance))} >
-
- {/if} -
-
{$_('layout.interface')}
- -
- -
- -
- -
- -
- -
- -
- -
- - - arrow_drop_down -
- -
- - - arrow_drop_down -
-
+ + - + - -
-
{$_('layout.player.title')}
- -
- -
- -
- -
- -
- -
- - {#if Capacitor.getPlatform() === 'android'} -
-
- -
-
Return YT Dislikes
- -
- returnYTDislikesInstanceStore.set(ensureNoTrailingSlash(returnYTInstance))} - > - -
- - -
- -
-
API Extended
- -
- synciousInstanceStore.set(ensureNoTrailingSlash(synciousInstance))} - > - -
- - -
- -
-
Sponsorblock
- -
- sponsorBlockUrlStore.set(ensureNoTrailingSlash(sponsorBlockInstance))} - > - -
- - - - - - - -
- -

{$_('layout.sponsors.Catagories')}

- - {#each sponsorCategories as sponsor} -
- -
- {/each} -
- -
-
{$_('layout.deArrow.title')}
- -
deArrowInstanceStore.set(ensureNoTrailingSlash(deArrowUrl))} - > - -
- -
deArrowThumbnailInstanceStore.set(deArrowThumbnailUrl)}> - -
- - - - -
- - {#if !Capacitor.isNativePlatform()} -
-
{$_('layout.bookmarklet')}
- +
deArrowInstanceStore.set(ensureNoTrailingSlash(deArrowUrl))} > + +
+ +
deArrowThumbnailInstanceStore.set(deArrowThumbnailUrl)}> + +
+ + + +
- {/if} +
diff --git a/materialious/src/lib/i18n/locales/en.json b/materialious/src/lib/i18n/locales/en.json index 79285e02..a2ad1f6a 100644 --- a/materialious/src/lib/i18n/locales/en.json +++ b/materialious/src/lib/i18n/locales/en.json @@ -9,6 +9,7 @@ "title": "Title", "searchPlaceholder": "Search (ctrl + k)", "delete": "Delete", + "donate": "Donate", "deleteAllHistory": "Delete all history", "skipping": "Skipping", "replies": "replies", diff --git a/materialious/static/style.css b/materialious/static/style.css index 5bffc19d..b20b1599 100644 --- a/materialious/static/style.css +++ b/materialious/static/style.css @@ -77,4 +77,4 @@ main.root { main.root::-webkit-scrollbar { display: none !important; } -} \ No newline at end of file +} From 78d03566af7c3fc96bb21bde170f336a9fe7a6c7 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 9 Oct 2024 09:47:36 +1300 Subject: [PATCH 5/6] Fix booklet copy --- materialious/src/lib/externalSettings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/materialious/src/lib/externalSettings.ts b/materialious/src/lib/externalSettings.ts index a64f944f..85322829 100644 --- a/materialious/src/lib/externalSettings.ts +++ b/materialious/src/lib/externalSettings.ts @@ -231,7 +231,7 @@ export function bookmarkletSaveToUrl(): string { persistedStores.forEach((store) => { let value = get(store.store); - if (value !== null) { + if (value) { url.searchParams.set(store.name, value.toString()); } }); From 68a9589867a9ce6b2002a7d1072d94e81ab3b9b4 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 9 Oct 2024 09:48:11 +1300 Subject: [PATCH 6/6] Only if null or undefined --- materialious/src/lib/externalSettings.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/materialious/src/lib/externalSettings.ts b/materialious/src/lib/externalSettings.ts index 85322829..6625f607 100644 --- a/materialious/src/lib/externalSettings.ts +++ b/materialious/src/lib/externalSettings.ts @@ -231,7 +231,7 @@ export function bookmarkletSaveToUrl(): string { persistedStores.forEach((store) => { let value = get(store.store); - if (value) { + if (value !== null && value !== undefined) { url.searchParams.set(store.name, value.toString()); } });