Skip to content

Commit

Permalink
fix: electron build
Browse files Browse the repository at this point in the history
fix: load anime watch progress
  • Loading branch information
ThaUnknown committed Mar 19, 2024
1 parent e412bda commit 4ea8899
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
20 changes: 13 additions & 7 deletions common/views/Player/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@
}
async function loadAnimeProgress () {
if (!current?.media?.media?.id || !current.media.media.episode || current.media.failed || !media?.media?.id || !media.episode) return
if (!current?.media?.media?.id || !current?.media?.episode || current?.media?.failed || !media?.media?.id || !media?.episode) return
const animeProgress = await getAnimeProgress(current.media.media.id, current.media.episode)
if (!animeProgress) return
Expand All @@ -211,7 +211,7 @@
}
function saveAnimeProgress () {
if (!current?.media?.media?.id || !current.media.media.episode || current.media.failed || !media?.media?.id || !media.episode) return
if (!current?.media?.media?.id || !current?.media?.episode || current?.media?.failed || !media?.media?.id || !media?.episode) return
if (buffering || paused || video.readyState < 4) return
Expand Down Expand Up @@ -1036,11 +1036,11 @@
<!-- eslint-disable-next-line svelte/valid-compile -->
<div class='w-full h-full position-absolute toggle-immerse d-none' on:dblclick={toggleFullscreen} on:click|self={toggleImmerse} />
<div class='w-full h-full position-absolute mobile-focus-target d-none' use:click={() => { page = 'player' }} />
<span class='d-md-block material-symbols-outlined ctrl' class:d-none={miniplayer} class:text-muted={!hasLast} class:disabled={!hasLast} use:click={playLast}> skip_previous </span>
<span class='d-md-block material-symbols-outlined ctrl' class:d-none={miniplayer} use:click={rewind}> fast_rewind </span>
<span class='d-md-block material-symbols-outlined ctrl' class:d-none={miniplayer} data-name='playPause' use:click={playPause}> {ended ? 'replay' : paused ? 'play_arrow' : 'pause'} </span>
<span class='d-md-block material-symbols-outlined ctrl' class:d-none={miniplayer} use:click={forward}> fast_forward </span>
<span class='d-md-block material-symbols-outlined ctrl' class:d-none={miniplayer} class:text-muted={!hasNext} class:disabled={!hasNext} use:click={playNext}> skip_next </span>
<span class='material-symbols-outlined ctrl' class:text-muted={!hasLast} class:disabled={!hasLast} use:click={playLast}> skip_previous </span>
<span class='material-symbols-outlined ctrl' use:click={rewind}> fast_rewind </span>
<span class='material-symbols-outlined ctrl' data-name='playPause' use:click={playPause}> {ended ? 'replay' : paused ? 'play_arrow' : 'pause'} </span>
<span class='material-symbols-outlined ctrl' use:click={forward}> fast_forward </span>
<span class='material-symbols-outlined ctrl' class:text-muted={!hasNext} class:disabled={!hasNext} use:click={playNext}> skip_next </span>
<div class='position-absolute bufferingDisplay' />
{#if currentSkippable}
<button class='skip btn text-dark position-absolute bottom-0 right-0 mr-20 mb-5 font-weight-bold' use:click={skip}>
Expand Down Expand Up @@ -1465,6 +1465,12 @@
padding-top: max(var(--safe-area-top), env(safe-area-inset-top, 0)) !important;
}
}
.middle .ctrl {
display: flex !important;
}
.miniplayer .middle .ctrl {
display: none !important;
}
.toggle-immerse {
display: block !important;
}
Expand Down
1 change: 1 addition & 0 deletions electron/webpack.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ module.exports = [
aliasFields: [],
mainFields: ['module', 'main', 'node'],
alias: {
'@': resolve(__dirname, '..', 'common'),
'node-fetch': false,
ws: false,
wrtc: false,
Expand Down

0 comments on commit 4ea8899

Please sign in to comment.