fix: hold to ff, cycle subtitles backwards when holding shift, disable chromatic abberation animation

fix: validate entries when app first loads but cache doesnt sync with online, this fixes issues when syncing across multiple devices
This commit is contained in:
ThaUnknown 2025-10-13 16:54:18 +02:00
parent a79b993fbd
commit e9faddc96f
No known key found for this signature in database
4 changed files with 13 additions and 12 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "ui", "name": "ui",
"version": "6.4.153", "version": "6.4.154",
"license": "BUSL-1.1", "license": "BUSL-1.1",
"private": true, "private": true,
"packageManager": "pnpm@9.15.5", "packageManager": "pnpm@9.15.5",

View file

@ -429,12 +429,13 @@
let openSubs: () => Promise<void> let openSubs: () => Promise<void>
function cycleSubtitles () { function cycleSubtitles (e: KeyboardEvent | MouseEvent) {
if (!subtitles) return if (!subtitles) return
const entries = Object.entries(subtitles._tracks.value) const entries = Object.entries(subtitles._tracks.value)
if (!entries.length) return if (!entries.length) return
const index = entries.findIndex(([index]) => index === subtitles!.current.value) + 1 const offset = e.shiftKey ? -1 : 1
const [id, info] = entries[index] ?? [-1, { meta: { name: 'Off', language: 'Eng' } }] const index = entries.findIndex(([index]) => index === subtitles!.current.value) + offset
const [id, info] = entries.at(index) ?? [-1, { meta: { name: 'Off', language: 'Eng' } }]
playAnimation(info.meta.name ?? info.meta.language ?? 'Eng') playAnimation(info.meta.name ?? info.meta.language ?? 'Eng')
subtitles.selectCaptions(id) subtitles.selectCaptions(id)
} }
@ -476,9 +477,7 @@
}, },
Space: { Space: {
fn: (e) => { fn: (e) => {
e.preventDefault() if ('repeat' in e && e.repeat) return
e.stopImmediatePropagation()
e.stopPropagation()
playPause() playPause()
}, },
id: 'play_arrow', id: 'play_arrow',
@ -550,7 +549,7 @@
// desc: 'Toggle Cast [broken]' // desc: 'Toggle Cast [broken]'
// }, // },
KeyC: { KeyC: {
fn: () => cycleSubtitles(), fn: (e) => cycleSubtitles(e),
id: 'subtitles', id: 'subtitles',
icon: Captions, icon: Captions,
type: 'icon', type: 'icon',
@ -674,6 +673,7 @@
if (isMiniplayer) return if (isMiniplayer) return
if ('code' in event && (event.code !== 'Space')) return if ('code' in event && (event.code !== 'Space')) return
if ('button' in event && event.button !== 0) return if ('button' in event && event.button !== 0) return
if ('repeat' in event && event.repeat) return
if ('pointerId' in event) { if ('pointerId' in event) {
document.setPointerCapture(event.pointerId) document.setPointerCapture(event.pointerId)
} }

View file

@ -116,7 +116,7 @@ export default new class AuthAggregator {
}) })
async watch (outdated: Media, progress: number) { async watch (outdated: Media, progress: number) {
const media = (await client.single(outdated.id)).data?.Media ?? outdated const media = (await client.single(outdated.id, navigator.onLine ? 'network-only' : 'cache-first')).data?.Media ?? outdated
const totalEps = episodes(media) ?? 1 // episodes or movie which is single episode const totalEps = episodes(media) ?? 1 // episodes or movie which is single episode
if (totalEps < progress) return // woah, bad data from resolver?! if (totalEps < progress) return // woah, bad data from resolver?!

View file

@ -34,7 +34,7 @@
<div class='size-full flex justify-center items-center'> <div class='size-full flex justify-center items-center'>
<div class='size-10 relative logo-container' on:animationend|self={navigate}> <div class='size-10 relative logo-container' on:animationend|self={navigate}>
<Logo class='size-10 [filter:url(#chromaticAberration)]' /> <Logo class='size-10' />
{#each spotlightData as s, i (i)} {#each spotlightData as s, i (i)}
<div class='spotlight absolute blurred origin-left' <div class='spotlight absolute blurred origin-left'
style:--to-x={s.tox} style:--to-x={s.tox}
@ -51,6 +51,7 @@
</div> </div>
</div> </div>
<!--
<svg width='0' height='0'> <svg width='0' height='0'>
<filter id='chromaticAberration'> <filter id='chromaticAberration'>
<feColorMatrix type='matrix' <feColorMatrix type='matrix'
@ -82,7 +83,7 @@
</feOffset> </feOffset>
<feBlend mode='screen' in='red' in2='blue' /> <feBlend mode='screen' in='red' in2='blue' />
</filter> </filter>
</svg> </svg> -->
<style> <style>
@property --spotlight-opacity { @property --spotlight-opacity {
@ -131,7 +132,7 @@
} }
.spotlight { .spotlight {
filter: url('#chromaticAberration') blur(3px); filter: blur(3px);
--impect-radius: 192; --impect-radius: 192;
--dist-factor: calc((192 - min(var(--to-dist), 192)) / 192); --dist-factor: calc((192 - min(var(--to-dist), 192)) / 192);
left: calc(var(--to-x) * 1px); left: calc(var(--to-x) * 1px);