Merge pull request #797 from Materialious/update/1.7.6

Minor fixes to state changes
This commit is contained in:
Ward
2025-02-05 19:12:46 +13:00
committed by GitHub
6 changed files with 28 additions and 24 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ android {
applicationId "us.materialio.app"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 87
versionName "1.7.5"
versionCode 88
versionName "1.7.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "Materialious",
"version": "1.7.5",
"version": "1.7.6",
"description": "Modern material design for Invidious.",
"author": {
"name": "Ward Pearce",
@@ -41,4 +41,4 @@
"capacitor",
"electron"
]
}
}
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "materialious",
"version": "1.7.5",
"version": "1.7.6",
"private": true,
"scripts": {
"dev": "vite dev",
@@ -75,4 +75,4 @@
"vidstack": "^1.12.12",
"youtubei.js": "^12.2.0"
}
}
}
@@ -8,7 +8,9 @@
import { ui } from 'beercss';
import { _ } from 'svelte-i18n';
let { data = $bindable() } = $props();
let { data } = $props();
let playlists = $state(data);
activePageStore.set('playlists');
@@ -21,7 +23,7 @@
async function removePlaylistItem(playlistId: string) {
await deletePersonalPlaylist(playlistId);
data.playlists = data.playlists.filter((item) => {
playlists.playlists = playlists.playlists.filter((item) => {
if (item.playlistId !== playlistId) {
return item;
}
@@ -31,14 +33,14 @@
async function createPlaylist() {
await postPersonalPlaylist(playlistTitle, playlistPrivacy);
await ui('#create-playlist');
data.playlists = await getPersonalPlaylists();
playlists.playlists = await getPersonalPlaylists();
}
</script>
<div class="page right active">
<div class="space"></div>
<div class="grid">
{#each data.playlists as playlist}
{#each playlists.playlists as playlist}
<ContentColumn>
<article class="no-padding" style="height: 100%;">
<PlaylistThumbnail disabled={playlist.videoCount === 0} {playlist} />
@@ -10,30 +10,32 @@
import { _ } from 'svelte-i18n';
import InfiniteLoading, { type InfiniteEvent } from 'svelte-infinite-loading';
let { data = $bindable() } = $props();
let { data } = $props();
let searchResults = $state(data);
let currentPage = 1;
activePageStore.set(null);
async function changeType(type: 'playlist' | 'all' | 'video' | 'channel') {
data.searchType = type;
searchResults.searchType = type;
currentPage = 1;
data.search = [];
data.search = await getSearch(data.slug, { type: type });
searchResults.search = [];
searchResults.search = await getSearch(searchResults.slug, { type: type });
}
async function loadMore(event: InfiniteEvent) {
currentPage++;
const newSearch = await getSearch(data.slug, {
const newSearch = await getSearch(searchResults.slug, {
page: currentPage.toString(),
type: data.searchType
type: searchResults.searchType
});
if (newSearch.length === 0) {
event.detail.complete();
} else {
data.search = [...data.search, ...newSearch];
searchResults.search = [...searchResults.search, ...newSearch];
event.detail.loaded();
}
}
@@ -42,7 +44,7 @@
<div style="margin-top: 1em;">
<div class="tabs left-align min scroll">
<a
class:active={data.searchType === 'all'}
class:active={searchResults.searchType === 'all'}
href="#all"
onclick={async () => changeType('all')}
>
@@ -50,7 +52,7 @@
<span>{$_('videoTabs.all')}</span>
</a>
<a
class:active={data.searchType === 'video'}
class:active={searchResults.searchType === 'video'}
href="#videos"
onclick={async () => changeType('video')}
>
@@ -58,7 +60,7 @@
<span>{$_('videoTabs.videos')}</span>
</a>
<a
class:active={data.searchType === 'playlist'}
class:active={searchResults.searchType === 'playlist'}
href="#playlists"
onclick={async () => changeType('playlist')}
>
@@ -66,7 +68,7 @@
<span>{$_('videoTabs.playlists')}</span>
</a>
<a
class:active={data.searchType === 'channel'}
class:active={searchResults.searchType === 'channel'}
href="#channels"
onclick={async () => changeType('channel')}
>
@@ -76,11 +78,11 @@
</div>
</div>
{#if data.search.length > 0}
{#if searchResults.search.length > 0}
<div class="page right active">
<div class="space"></div>
<div class="grid">
{#each data.search as item}
{#each searchResults.search as item}
<ContentColumn>
{#key item}
<article class="no-padding" style="height: 100%;">
+1 -1
View File
@@ -5,7 +5,7 @@ import json
import os
import re
LATEST_VERSION = "1.7.5"
LATEST_VERSION = "1.7.6"
WORKING_DIR = os.path.join(os.path.dirname(os.path.realpath(__file__)), "materialious")
ROOT_PACKAGE = os.path.join(WORKING_DIR, "package.json")