Minor fixes
This commit is contained in:
@@ -7,8 +7,8 @@ android {
|
||||
applicationId "us.materialio.app"
|
||||
minSdkVersion rootProject.ext.minSdkVersion
|
||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||
versionCode 29
|
||||
versionName "1.3.0"
|
||||
versionCode 30
|
||||
versionName "1.3.1"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
aaptOptions {
|
||||
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Materialious",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"description": "Modern material design for Invidious.",
|
||||
"author": {
|
||||
"name": "Ward Pearce",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "materialious",
|
||||
"version": "1.3.0",
|
||||
"version": "1.3.1",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
|
||||
@@ -2,18 +2,13 @@
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { getComments } from './Api';
|
||||
import { type Comment, type Comments } from './Api/model';
|
||||
import { getBestThumbnail, numberWithCommas, proxyGoogleImage } from './misc';
|
||||
import { getBestThumbnail, loadPfp, numberWithCommas, proxyGoogleImage } from './misc';
|
||||
|
||||
export let comment: Comment;
|
||||
export let videoId: string;
|
||||
|
||||
let replies: Comments | undefined = undefined;
|
||||
|
||||
async function loadPfp(url: string): Promise<string> {
|
||||
const resp = await fetch(url);
|
||||
return URL.createObjectURL(await resp.blob());
|
||||
}
|
||||
|
||||
async function loadReplies(continuation: string) {
|
||||
try {
|
||||
replies = await getComments(videoId, {
|
||||
|
||||
@@ -170,6 +170,11 @@ export function proxyVideoUrl(source: string): string {
|
||||
return rawSrc.toString();
|
||||
}
|
||||
|
||||
export async function loadPfp(url: string): Promise<string> {
|
||||
const resp = await fetch(url);
|
||||
return URL.createObjectURL(await resp.blob());
|
||||
}
|
||||
|
||||
export function proxyGoogleImage(source: string): string {
|
||||
if (source.startsWith('//')) source = `https:${source}`;
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import { FFmpeg } from '@ffmpeg/ffmpeg';
|
||||
import { proxyVideoUrl } from './misc';
|
||||
|
||||
interface MediaQuality {
|
||||
bandwidth: string;
|
||||
@@ -69,7 +68,7 @@ async function fetchDASHManifest(manifestUrl: string) {
|
||||
|
||||
|
||||
export async function listCombinedQualities(manifestUrl: string): Promise<MediaQuality[]> {
|
||||
const manifest = await fetchDASHManifest(manifestUrl);
|
||||
const manifest = await fetchDASHManifest(`${manifestUrl}?local=true`);
|
||||
const qualities: MediaQuality[] = [];
|
||||
|
||||
// Fetch all AdaptationSets (both video and audio)
|
||||
@@ -93,7 +92,7 @@ export async function listCombinedQualities(manifestUrl: string): Promise<MediaQ
|
||||
// Combine video and audio representations
|
||||
videoRepresentations.forEach((videoRep) => {
|
||||
const videoBandwidth = videoRep.getAttribute('bandwidth');
|
||||
const videoUrl = proxyVideoUrl(videoRep.getElementsByTagName('BaseURL')[0].textContent as string);
|
||||
const videoUrl = videoRep.getElementsByTagName('BaseURL')[0].textContent as string;
|
||||
const width = videoRep.getAttribute('width');
|
||||
const height = videoRep.getAttribute('height');
|
||||
const resolution = width && height ? `${width}x${height}` : undefined;
|
||||
@@ -101,7 +100,7 @@ export async function listCombinedQualities(manifestUrl: string): Promise<MediaQ
|
||||
|
||||
// Pair this video representation with each audio representation
|
||||
audioRepresentations.forEach((audioRep) => {
|
||||
const audioUrl = proxyVideoUrl(audioRep.getElementsByTagName('BaseURL')[0].textContent as string);
|
||||
const audioUrl = audioRep.getElementsByTagName('BaseURL')[0].textContent as string;
|
||||
const audioChannels = audioRep.getElementsByTagName('AudioChannelConfiguration')[0]?.getAttribute('value') || '';
|
||||
const audioBandwidth = audioRep.getAttribute('bandwidth') || '';
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import type { MediaPlayerElement } from 'vidstack/elements';
|
||||
import { loadPfp } from '../../../../lib/misc.js';
|
||||
|
||||
export let data;
|
||||
|
||||
@@ -447,11 +448,9 @@
|
||||
<nav>
|
||||
<a href={`/channel/${data.video.authorId}`}>
|
||||
<nav>
|
||||
<img
|
||||
class="circle large"
|
||||
src={proxyGoogleImage(getBestThumbnail(data.video.authorThumbnails))}
|
||||
alt="Channel profile"
|
||||
/>
|
||||
{#await loadPfp(proxyGoogleImage(getBestThumbnail(data.video.authorThumbnails))) then pfp}
|
||||
<img class="circle large" src={pfp} alt="Channel profile" />
|
||||
{/await}
|
||||
<div>
|
||||
<p class="bold">{data.video.author}</p>
|
||||
<p>{data.video.subCountText}</p>
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import json
|
||||
import os
|
||||
import re
|
||||
|
||||
LATEST_VERSION = "1.3.0"
|
||||
LATEST_VERSION = "1.3.1"
|
||||
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
|
||||
|
||||
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")
|
||||
|
||||
Reference in New Issue
Block a user