Skip to content

Commit

Permalink
fix: type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ThaUnknown committed Oct 16, 2023
1 parent 2328c2a commit fcb4af6
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 47 deletions.
4 changes: 3 additions & 1 deletion src/common/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
7 changes: 6 additions & 1 deletion src/renderer/modules/rss.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
41 changes: 0 additions & 41 deletions src/renderer/views/Home/Gallery.svelte

This file was deleted.

2 changes: 1 addition & 1 deletion src/renderer/views/Home/Home.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/renderer/views/Home/Section.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
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)
observer.unobserve(element)
}
}, { threshold: 0 })
observer.observe(element)
return { destroy () { observer.unobserve(element) } }
}
function _click () {
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/views/Player/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit fcb4af6

Please sign in to comment.