From 966bb0706f554b684a15ca8cda2687aa4c2f8988 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 30 Oct 2024 19:15:08 +1300 Subject: [PATCH 1/5] Add needed files for flatpak --- branding/Meterialious.svg | 61 +------------------ materialious/android/app/build.gradle | 4 +- materialious/electron/package.json | 2 +- .../electron/resources/materialious.desktop | 10 +++ materialious/package.json | 2 +- update_versions.py | 2 +- 6 files changed, 16 insertions(+), 65 deletions(-) create mode 100644 materialious/electron/resources/materialious.desktop diff --git a/branding/Meterialious.svg b/branding/Meterialious.svg index 302a27bf..37c927ce 100644 --- a/branding/Meterialious.svg +++ b/branding/Meterialious.svg @@ -1,60 +1 @@ - - - - + \ No newline at end of file diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index 1902a748..a266297c 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 72 - versionName "1.6.21" + versionCode 73 + versionName "1.6.22" 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 5a807d17..8b030d30 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.6.21", + "version": "1.6.22", "description": "Modern material design for Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/electron/resources/materialious.desktop b/materialious/electron/resources/materialious.desktop new file mode 100644 index 00000000..35d99ac1 --- /dev/null +++ b/materialious/electron/resources/materialious.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Materialious +Comment=Modern material design for Invidious. +GenericName=Materialious +Exec=run.sh %u +Icon=us.materialio.Materialious +Type=Application +StartupNotify=true +StartupWMClass=Materialious +Categories=GNOME;GTK;AudioVideo;Network;Utility; diff --git a/materialious/package.json b/materialious/package.json index 1c11eca1..8e11d5f4 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.6.21", + "version": "1.6.22", "private": true, "scripts": { "dev": "vite dev", diff --git a/update_versions.py b/update_versions.py index 720674a3..23ec301c 100644 --- a/update_versions.py +++ b/update_versions.py @@ -5,7 +5,7 @@ import json import os import re -LATEST_VERSION = "1.6.21" +LATEST_VERSION = "1.6.22" WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious") ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json") From ebe9ad63ee6adb1c294eefbd5d634d579d729c82 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 30 Oct 2024 19:22:39 +1300 Subject: [PATCH 2/5] Update android release --- .github/workflows/prod-android.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/prod-android.yml b/.github/workflows/prod-android.yml index 842d23d0..b88addb5 100644 --- a/.github/workflows/prod-android.yml +++ b/.github/workflows/prod-android.yml @@ -82,5 +82,7 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} file: ./materialious/android/app/release/* tag: ${{ steps.package-version.outputs.current-version}} + release_name: ${{ steps.package-version.outputs.current-version}} overwrite: true file_glob: true + draft: false From c5f4f45401387e20b997274b837fb9952954fa36 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 30 Oct 2024 19:36:41 +1300 Subject: [PATCH 3/5] fixes to tostring patch error --- materialious/src/lib/patches/youtubejs.ts | 33 +++++++++++------------ 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/materialious/src/lib/patches/youtubejs.ts b/materialious/src/lib/patches/youtubejs.ts index 16f20808..4f74d5e0 100644 --- a/materialious/src/lib/patches/youtubejs.ts +++ b/materialious/src/lib/patches/youtubejs.ts @@ -7,7 +7,6 @@ import { get } from 'svelte/store'; import { Innertube, ProtoUtils, UniversalCache, Utils } from 'youtubei.js'; import { capacitorFetch } from '../android/http/capacitorFetch'; - export interface PoTokens { visitor_data: string; po_token: string; @@ -100,7 +99,7 @@ export async function patchYoutubeJs(videoId: string): Promise { dashUri = URL.createObjectURL(new Blob([manifest], { type: 'application/dash+xml;charset=utf8' })); } - const descString = video.secondary_info.description.toString(); + const descString = video.secondary_info.description?.toString() || ''; let authorThumbnails: Image[]; if (video.basic_info.channel_id) { @@ -115,18 +114,18 @@ export async function patchYoutubeJs(videoId: string): Promise { recommendedVideos.push({ videoThumbnails: recommended?.thumbnails as Thumbnail[] || [], videoId: recommended?.id || '', - title: recommended?.title.toString() || '', - viewCountText: recommended.view_count ? numberWithCommas(Number(recommended?.view_count.toString().replace(/\D/g, ''))) as string : '', + title: recommended?.title?.toString() || '', + viewCountText: recommended.view_count ? numberWithCommas(Number(recommended?.view_count.toString().replace(/\D/g, ''))) || '' : '', lengthSeconds: recommended?.duration?.seconds || 0, - author: recommended?.author.name || '', - authorId: recommended?.author.id || '' + author: recommended?.author?.name || '', + authorId: recommended?.author?.id || '' }); }); let captions: Captions[] = []; video.captions?.caption_tracks?.forEach(caption => { captions.push({ - label: caption.name.toString(), + label: caption.name?.toString() || '', language_code: caption.language_code, // Add correct format to url. url: caption.base_url + '&fmt=vtt' @@ -136,11 +135,11 @@ export async function patchYoutubeJs(videoId: string): Promise { let adaptiveFormats: AdaptiveFormats[] = []; video.streaming_data?.adaptive_formats.forEach(format => { adaptiveFormats.push({ - index: format.index_range?.start.toString() || '', - bitrate: format.bitrate.toString(), - init: format.init_range?.start.toString() || '', + index: format.index_range?.start?.toString() || '', + bitrate: format.bitrate?.toString() || '', + init: format.init_range?.start?.toString() || '', url: format.url || '', - itag: format.itag.toString(), + itag: format.itag?.toString() || '', type: format.mime_type, clen: '', lmt: '', @@ -168,9 +167,9 @@ export async function patchYoutubeJs(videoId: string): Promise { return { type: 'video', - title: video.primary_info.title ? video.primary_info.title.toString() : '', - viewCount: video.primary_info.view_count ? Number(video.primary_info.view_count.toString().replace(/\D/g, '')) : 0, - viewCountText: video.primary_info.view_count ? video.primary_info.view_count.toString() : '', + title: video.primary_info.title?.toString() || '', + viewCount: video.primary_info.view_count ? Number(video.primary_info.view_count?.toString()?.replace(/\D/g, '')) : 0, + viewCountText: video.primary_info.view_count?.toString() || '', likeCount: video.basic_info.like_count || 0, dislikeCount: 0, allowRatings: false, @@ -189,9 +188,9 @@ export async function patchYoutubeJs(videoId: string): Promise { authorUrl: `/channel/${video.basic_info.channel_id}`, authorVerified: false, description: descString, - descriptionHtml: video.secondary_info.description.toHTML() || descString, + descriptionHtml: video.secondary_info.description?.toHTML() || descString, published: 0, - publishedText: video.primary_info.published ? video.primary_info.published.toString() : '', + publishedText: video.primary_info.published?.toString() || '', premiereTimestamp: 0, hlsUrl: video.streaming_data?.hls_manifest_url || undefined, liveNow: video.basic_info.is_live || false, @@ -207,4 +206,4 @@ export async function patchYoutubeJs(videoId: string): Promise { allowedRegions: [], fallbackPatch: 'youtubejs' }; -} \ No newline at end of file +} From 2f0b388b11697a27d4d8c747caf8ddbde7882cd3 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 30 Oct 2024 19:41:50 +1300 Subject: [PATCH 4/5] Move .desktop file --- materialious/electron/{resources => }/materialious.desktop | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename materialious/electron/{resources => }/materialious.desktop (100%) diff --git a/materialious/electron/resources/materialious.desktop b/materialious/electron/materialious.desktop similarity index 100% rename from materialious/electron/resources/materialious.desktop rename to materialious/electron/materialious.desktop From aa4f9ee067d28326b52484959883b7268efbef10 Mon Sep 17 00:00:00 2001 From: WardPearce Date: Wed, 30 Oct 2024 19:46:41 +1300 Subject: [PATCH 5/5] Add linux-arm64 building for snap --- .github/workflows/prod-desktop.yml | 9 ++++++--- .github/workflows/pull-desktop.yml | 16 +++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/prod-desktop.yml b/.github/workflows/prod-desktop.yml index 3fd5f81d..739b1bea 100644 --- a/.github/workflows/prod-desktop.yml +++ b/.github/workflows/prod-desktop.yml @@ -18,12 +18,15 @@ jobs: node-version: [20] runtime: - linux-x64 + - linux-arm64 - win-x64 - osx-x64 include: - runtime: linux-x64 os: ubuntu-latest + - runtime: linux-arm64 + os: ubuntu-latest - runtime: osx-x64 os: macOS-latest - runtime: win-x64 @@ -65,13 +68,13 @@ jobs: if: runner.os == 'Windows' - name: Install snapcraft - if: matrix.runtime == 'linux-x64' + if: matrix.runtime == 'linux-x64' || matrix.runtime == 'linux-arm64' run: sudo snap install snapcraft --classic - name: Set up snapcraft environment variables run: echo "SNAPCRAFT_STORE_CREDENTIALS=${{ secrets.SNAPCRAFT_LOGIN }}" >> $GITHUB_ENV shell: bash - if: matrix.runtime == 'linux-x64' + if: matrix.runtime == 'linux-x64' || matrix.runtime == 'linux-arm64' - name: Build desktop packages - run: cd ./materialious/electron && npm run electron:make \ No newline at end of file + run: cd ./materialious/electron && npm run electron:make diff --git a/.github/workflows/pull-desktop.yml b/.github/workflows/pull-desktop.yml index f7542fd2..3e9d1295 100644 --- a/.github/workflows/pull-desktop.yml +++ b/.github/workflows/pull-desktop.yml @@ -16,17 +16,19 @@ jobs: node-version: [20] runtime: - linux-x64 + - linux-arm64 - win-x64 - osx-x64 include: - - runtime: linux-x64 - os: ubuntu-latest - - runtime: osx-x64 - os: macOS-latest - - runtime: win-x64 - os: windows-latest - + - runtime: linux-x64 + os: ubuntu-latest + - runtime: linux-arm64 + os: ubuntu-latest + - runtime: osx-x64 + os: macOS-latest + - runtime: win-x64 + os: windows-latest runs-on: ${{ matrix.os }}