diff --git a/materialious/android/app/build.gradle b/materialious/android/app/build.gradle index f5cd73c0..0369d805 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 215 - versionName "1.15.7" + versionCode 216 + versionName "1.15.8" 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/materialious.metainfo.xml b/materialious/electron/materialious.metainfo.xml index 14101167..34c43a34 100644 --- a/materialious/electron/materialious.metainfo.xml +++ b/materialious/electron/materialious.metainfo.xml @@ -80,7 +80,11 @@ - + + + https://github.com/Materialious/Materialious/releases/tag/1.15.8 + + https://github.com/Materialious/Materialious/releases/tag/1.15.7 diff --git a/materialious/electron/package.json b/materialious/electron/package.json index a43122cb..49734948 100644 --- a/materialious/electron/package.json +++ b/materialious/electron/package.json @@ -1,6 +1,6 @@ { "name": "Materialious", - "version": "1.15.7", + "version": "1.15.8", "description": "Modern material design for YouTube and Invidious.", "author": { "name": "Ward Pearce", diff --git a/materialious/package.json b/materialious/package.json index b49c401e..8d3ec302 100644 --- a/materialious/package.json +++ b/materialious/package.json @@ -1,6 +1,6 @@ { "name": "materialious", - "version": "1.15.7", + "version": "1.15.8", "private": true, "scripts": { "dev": "npm run patch:github && vite dev", diff --git a/materialious/src/lib/api/index.ts b/materialious/src/lib/api/index.ts index 47190f53..5feba859 100644 --- a/materialious/src/lib/api/index.ts +++ b/materialious/src/lib/api/index.ts @@ -71,13 +71,18 @@ export function setRegion(url: URL): URL { export async function fetchErrorHandle(response: Response): Promise { if (!response.ok) { let message = 'Internal error'; + + // Attempt to parse error. try { const json = await response.json(); - message = 'errorBacktrace' in json ? json.errorBacktrace : json.error; + message = json.errorBacktrace || json.error || json.message; } catch { // Continue regardless of error } - throw Error(message); + + throw Error( + `${response.status} - ${response.statusText}\n${decodeURIComponent(response.url)}\n${message}` + ); } return response; diff --git a/materialious/src/lib/api/youtubejs/subscriptions.ts b/materialious/src/lib/api/youtubejs/subscriptions.ts index 85885867..81499cce 100644 --- a/materialious/src/lib/api/youtubejs/subscriptions.ts +++ b/materialious/src/lib/api/youtubejs/subscriptions.ts @@ -10,7 +10,7 @@ import { engineMaxConcurrentChannelsStore, rawMasterKeyStore } from '$lib/store'; -import { getSubscriptionsBackend, updateRSSLastUpdated } from '../backend'; +import { getSubscriptionsBackend } from '../backend'; export async function getSubscriptionsYTjs(): Promise { const subscriptions: Subscription[] = []; @@ -69,6 +69,8 @@ export async function parseChannelRSS(channelId: string): Promise { const xmlDoc = parser.parseFromString(text, 'text/xml'); const entries = xmlDoc.getElementsByTagName('entry'); + let channelName: string | undefined; + for (const entry of entries) { const videoId = entry.getElementsByTagName('yt:videoId')[0]?.textContent || ''; const title = entry.getElementsByTagName('title')[0]?.textContent || 'Untitled'; @@ -80,7 +82,7 @@ export async function parseChannelRSS(channelId: string): Promise { ); const published = publishedAt.getTime(); const publishedText = relativeTimestamp(published, false); - const author = + channelName = entry.getElementsByTagName('author')[0]?.getElementsByTagName('name')[0]?.textContent || 'Unknown Author'; const authorId = @@ -115,7 +117,7 @@ export async function parseChannelRSS(channelId: string): Promise { videoId, title, videoThumbnails, - author, + author: channelName, authorId, description, descriptionHtml, @@ -133,15 +135,29 @@ export async function parseChannelRSS(channelId: string): Promise { } catch { // Continue regardless of error } - - if (!get(rawMasterKeyStore)) { - localDb.channelSubscriptions.where('channelId').equals(channelId).modify({ - lastRSSFetch: new Date() - }); - } else { - updateRSSLastUpdated(authorId); - } } + + updateLastRssFetch(channelId, channelName ?? 'Unknown'); +} + +async function updateLastRssFetch(channelId: string, channelName: string) { + localDb.channelSubscriptions + .where('channelId') + .equals(channelId) + .first() + .then((subscription) => { + if (subscription) { + localDb.channelSubscriptions.where('channelId').equals(channelId).modify({ + lastRSSFetch: new Date() + }); + } else { + localDb.channelSubscriptions.add({ + channelId: channelId, + channelName: channelName, + lastRSSFetch: new Date() + }); + } + }); } export async function clearFeedYTjs() { @@ -163,7 +179,23 @@ export async function getFeedYTjs(maxResults: number, page: number): Promise {#if page.error} -
- {page.error.message} +
+

{page.error.message}

{/if} diff --git a/materialious/src/lib/components/Thumbnail.svelte b/materialious/src/lib/components/Thumbnail.svelte index 63583d0a..ccf9ac4e 100644 --- a/materialious/src/lib/components/Thumbnail.svelte +++ b/materialious/src/lib/components/Thumbnail.svelte @@ -230,6 +230,7 @@ tabindex="-1" class:author={!sideways} href={resolve(`/channel/[authorId]`, { authorId: video.authorId })} + data-sveltekit-preload-data="off" >{video.author} {:else} diff --git a/materialious/src/lib/components/settings/Interface.svelte b/materialious/src/lib/components/settings/Interface.svelte index 393870d3..d06b6e1b 100644 --- a/materialious/src/lib/components/settings/Interface.svelte +++ b/materialious/src/lib/components/settings/Interface.svelte @@ -1,6 +1,4 @@