Fix toString error on youtubejs fallback

This commit is contained in:
WardPearce
2024-09-22 19:33:04 +12:00
parent 8284d73fa9
commit bc43dd9170
6 changed files with 14 additions and 8 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 46
versionName "1.5.5"
versionCode 47
versionName "1.5.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "Materialious",
"version": "1.5.5",
"version": "1.5.6",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "materialious",
"version": "1.5.5",
"version": "1.5.6",
"private": true,
"scripts": {
"dev": "vite dev",
+8 -2
View File
@@ -341,7 +341,11 @@
await loadPlayerPos();
});
if (Capacitor.getPlatform() === 'android' && get(playerAndroidBgPlayer)) {
if (
Capacitor.getPlatform() === 'android' &&
get(playerAndroidBgPlayer) &&
data.video.adaptiveFormats.length > 0
) {
const highestBitrateAudio = data.video.adaptiveFormats
.filter((format) => format.type.startsWith('audio/'))
.reduce((prev, current) => {
@@ -354,7 +358,9 @@
await AudioPlayer.create({
...audioId,
audioSource: proxyVideoUrl(highestBitrateAudio.url),
audioSource: !data.video.fallbackPatch
? proxyVideoUrl(highestBitrateAudio.url)
: highestBitrateAudio.url,
friendlyTitle: data.video.title,
useForNotification: true,
loop: player.loop,
+1 -1
View File
@@ -70,7 +70,7 @@ export async function patchYoutubeJs(videoId: string): Promise<VideoPlay> {
videoThumbnails: recommended?.thumbnails as Thumbnail[] || [],
videoId: recommended?.id || '',
title: recommended?.title.toString() || '',
viewCountText: numberWithCommas(Number(recommended?.view_count.toString().replace(/\D/g, '') || 0)) || '',
viewCountText: recommended.view_count ? numberWithCommas(Number(recommended?.view_count.toString().replace(/\D/g, ''))) as string : '',
lengthSeconds: recommended?.duration?.seconds || 0,
author: recommended?.author.name || '',
authorId: recommended?.author.id || ''
+1 -1
View File
@@ -5,7 +5,7 @@ import json
import os
import re
LATEST_VERSION = "1.5.5"
LATEST_VERSION = "1.5.6"
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")