Skip to content

Commit

Permalink
fix: subtitle negative offset
Browse files Browse the repository at this point in the history
fix: go back episode on media with no episodes
  • Loading branch information
ThaUnknown committed Apr 17, 2024
1 parent 4dbf381 commit 2f9db0f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion common/views/Player/MediaHandler.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@
const fileList = files.value
const targetFile = fileList.find(file => file.media?.media?.id === obj.media.id && (obj.media.episodes === 1 || !obj.media.episodes || file.media?.episode === obj.episode))
const targetFile = fileList.find(file => file.media?.media?.id === obj.media.id &&
(file.media?.episode === obj.episode || obj.media.episodes === 1 || (!obj.media.episodes && (obj.episode === 1 || !obj.episode) && (oldNowPlaying.episode === 1 || !oldNowPlaying.episode))) // movie check
)
if (!targetFile) return false
if (oldNowPlaying.media?.id !== obj.media.id) {
// mediachange, filelist change
Expand Down
4 changes: 2 additions & 2 deletions common/views/Player/Player.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
let subDelay = 0
$: updateDelay(subDelay)
function updateDelay (delay) {
if (subs?.renderer) subs.renderer.timeOffset = delay
if (subs?.renderer) subs.renderer.timeOffset = Number(delay)
}
let currentTime = 0
Expand Down Expand Up @@ -1177,7 +1177,7 @@
</label>
{/if}
{/each}
<input type='text' inputmode='numeric' pattern='[0-9]*' step='0.1' bind:value={subDelay} on:click|stopPropagation class='form-control text-right form-control-sm' />
<input type='text' inputmode='numeric' pattern='-?[0-9]*.?[0-9]*' step='0.1' bind:value={subDelay} on:click|stopPropagation class='form-control text-right form-control-sm' />
</div>
</div>
{/if}
Expand Down
2 changes: 1 addition & 1 deletion common/views/Settings/TorrentSettings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
{/if}
<SettingCard title='Transfer Speed Limit' description='Download/Upload speed limit for torrents, higher values increase CPU usage, and values higher than your storage write speeds will quickly fill up RAM.'>
<div class='input-group w-100 mw-full'>
<input type='number' inputmode='numeric' pattern={'[0-9]*.[0-9]{1, 2}'} bind:value={settings.torrentSpeed} min='0' max='50' step='0.1' class='form-control text-right bg-dark' />
<input type='number' inputmode='numeric' pattern={'[0-9]*.?[0-9]*'} bind:value={settings.torrentSpeed} min='0' max='50' step='0.1' class='form-control text-right bg-dark' />
<div class='input-group-append'>
<span class='input-group-text bg-dark'>MB/s</span>
</div>
Expand Down

0 comments on commit 2f9db0f

Please sign in to comment.