From fcb4af670c5a3e3ddd391117211529f8ae3c1300 Mon Sep 17 00:00:00 2001
From: ThaUnknown <6506529+ThaUnknown@users.noreply.github.com>
Date: Mon, 16 Oct 2023 11:44:11 +0200
Subject: [PATCH] fix: type errors
---
src/common/util.js | 4 ++-
src/renderer/modules/rss.js | 7 ++++-
src/renderer/views/Home/Gallery.svelte | 41 -------------------------
src/renderer/views/Home/Home.svelte | 2 +-
src/renderer/views/Home/Section.svelte | 4 ++-
src/renderer/views/Player/Player.svelte | 4 +--
6 files changed, 15 insertions(+), 47 deletions(-)
delete mode 100644 src/renderer/views/Home/Gallery.svelte
diff --git a/src/common/util.js b/src/common/util.js
index fa6ca8e6..e8d2f292 100644
--- a/src/common/util.js
+++ b/src/common/util.js
@@ -22,7 +22,9 @@ export const defaults = {
showDetailsInRPC: true,
smoothScroll: true,
cards: 'small',
- expandingSidebar: true
+ expandingSidebar: true,
+ torrentPath: undefined,
+ font: undefined
}
export const subtitleExtensions = ['srt', 'vtt', 'ass', 'ssa', 'sub', 'txt']
diff --git a/src/renderer/modules/rss.js b/src/renderer/modules/rss.js
index 3a35be77..84dfd505 100644
--- a/src/renderer/modules/rss.js
+++ b/src/renderer/modules/rss.js
@@ -114,7 +114,12 @@ class RSSMediaManager {
async queueResolve ({ title, link, date }) {
await this.lastResult
- const res = (await resolveFileMedia(title))[0]
+ const res = {
+ ...(await resolveFileMedia(title))[0],
+ episodeData: undefined,
+ date: undefined,
+ onclick: undefined
+ }
if (res.media?.id) {
try {
res.episodeData = (await getEpisodeMetadataForMedia(res.media))?.[res.episode]
diff --git a/src/renderer/views/Home/Gallery.svelte b/src/renderer/views/Home/Gallery.svelte
deleted file mode 100644
index 2fe13cdc..00000000
--- a/src/renderer/views/Home/Gallery.svelte
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
- {#each media as cards, i (i)}
-
- {/each}
-
-
-
diff --git a/src/renderer/views/Home/Home.svelte b/src/renderer/views/Home/Home.svelte
index 8e49081b..31ff65c8 100644
--- a/src/renderer/views/Home/Home.svelte
+++ b/src/renderer/views/Home/Home.svelte
@@ -26,7 +26,7 @@
])
const entry = manager.sections.find(section => section.load === load)
setInterval(async () => {
- if (await RSSManager.getContentChanged(1, 8, url, true)) {
+ if (await RSSManager.getContentChanged(1, 8, url)) {
entry.preview.value = RSSManager.getMediaForRSS(1, 8, url, true)
}
}, 30000)
diff --git a/src/renderer/views/Home/Section.svelte b/src/renderer/views/Home/Section.svelte
index 7180d7e7..42d0d2ef 100644
--- a/src/renderer/views/Home/Section.svelte
+++ b/src/renderer/views/Home/Section.svelte
@@ -10,7 +10,7 @@
export let opts
- async function deferredLoad (element) {
+ function deferredLoad (element) {
const observer = new IntersectionObserver(([entry]) => {
if (entry.isIntersecting) {
if (!opts.preview.value) opts.preview.value = opts.load(1, 15)
@@ -18,6 +18,8 @@
}
}, { threshold: 0 })
observer.observe(element)
+
+ return { destroy () { observer.unobserve(element) } }
}
function _click () {
diff --git a/src/renderer/views/Player/Player.svelte b/src/renderer/views/Player/Player.svelte
index cb3072bc..d6a60313 100644
--- a/src/renderer/views/Player/Player.svelte
+++ b/src/renderer/views/Player/Player.svelte
@@ -64,9 +64,9 @@
const canCast = false
let isFullscreen = false
let ended = false
- let volume = localStorage.getItem('volume') || 1
+ let volume = Number(localStorage.getItem('volume')) || 1
let playbackRate = 1
- $: localStorage.setItem('volume', volume || 0)
+ $: localStorage.setItem('volume', (volume || 0).toString())
$: safeduration = (isFinite(duration) ? duration : currentTime) || 0
function checkAudio () {