Merge pull request #459 from Materialious/update/1.1.6

Update/1.1.6
This commit is contained in:
Ward
2024-08-25 22:13:49 +12:00
committed by GitHub
9 changed files with 20 additions and 15 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 17
versionName "1.1.5"
versionCode 18
versionName "1.1.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.1.5",
"version": "1.1.6",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "materialious",
"version": "1.1.5",
"version": "1.1.6",
"private": true,
"scripts": {
"dev": "vite dev",
+2 -2
View File
@@ -2,7 +2,7 @@
import { onMount } from 'svelte';
import { _ } from 'svelte-i18n';
import type { Channel } from './Api/model';
import { cleanNumber, getBestThumbnail, truncate } from './misc';
import { cleanNumber, getBestThumbnail, proxyGoogleImage, truncate } from './misc';
export let channel: Channel;
@@ -12,7 +12,7 @@
onMount(() => {
img = new Image();
img.src = getBestThumbnail(channel.authorThumbnails) || '';
img.src = proxyGoogleImage(getBestThumbnail(channel.authorThumbnails)) || '';
img.onload = () => {
loading = false;
+2 -2
View File
@@ -2,7 +2,7 @@
import { _ } from 'svelte-i18n';
import { getComments } from './Api';
import { type Comment, type Comments } from './Api/model';
import { getBestThumbnail, numberWithCommas } from './misc';
import { getBestThumbnail, numberWithCommas, proxyGoogleImage } from './misc';
export let comment: Comment;
export let videoId: string;
@@ -33,7 +33,7 @@
<div class="comment">
<img
class="circle small"
src={getBestThumbnail(comment.authorThumbnails)}
src={proxyGoogleImage(getBestThumbnail(comment.authorThumbnails))}
alt="comment profile"
/>
<div>
+7 -3
View File
@@ -170,6 +170,10 @@ export function proxyVideoUrl(source: string): string {
return rawSrc.toString();
}
export function proxyGoogleImage(source: string): string {
return `${get(instanceStore)}/ggpht${new URL(source).pathname}`;
}
export function unsafeRandomItem(array: any[]): any {
return array[Math.floor(Math.random() * array.length)];
}
@@ -206,14 +210,14 @@ export function getBestThumbnail(
images: Image[] | null,
maxWidthDimension: number = 480,
maxHeightDimension = 360
): string | null {
): string {
if (images && images.length > 0) {
images = images.filter(
(image) => image.width < maxWidthDimension && image.height < maxHeightDimension
);
if (images.length === 0) {
return null;
return '';
}
images.sort((a, b) => {
@@ -222,7 +226,7 @@ export function getBestThumbnail(
return images[0].url;
} else {
return null;
return '';
}
}
@@ -4,7 +4,7 @@
import PageLoading from '$lib/PageLoading.svelte';
import PlaylistThumbnail from '$lib/PlaylistThumbnail.svelte';
import Thumbnail from '$lib/Thumbnail.svelte';
import { cleanNumber, getBestThumbnail } from '$lib/misc';
import { cleanNumber, getBestThumbnail, proxyGoogleImage } from '$lib/misc';
import { activePageStore, authStore } from '$lib/store';
import { Capacitor } from '@capacitor/core';
import { onMount } from 'svelte';
@@ -85,7 +85,7 @@
<img
style="margin-right: 1em;"
class="circle extra m l"
src={getBestThumbnail(data.channel.authorThumbnails)}
src={proxyGoogleImage(getBestThumbnail(data.channel.authorThumbnails))}
alt="Channel profile"
/>
@@ -20,6 +20,7 @@
getBestThumbnail,
letterCase,
numberWithCommas,
proxyGoogleImage,
unsafeRandomItem
} from '$lib/misc';
import type { PlayerEvents } from '$lib/player';
@@ -422,7 +423,7 @@
<nav>
<img
class="circle large"
src={getBestThumbnail(data.video.authorThumbnails)}
src={proxyGoogleImage(getBestThumbnail(data.video.authorThumbnails))}
alt="Channel profile"
/>
<div>
+1 -1
View File
@@ -5,7 +5,7 @@ import json
import os
import re
LATEST_VERSION = "1.1.5"
LATEST_VERSION = "1.1.6"
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")