Skip to content

Commit

Permalink
fix: RSS url including illegal chars, closing modals with ESC and by …
Browse files Browse the repository at this point in the history
…clicking whitespace, disabled offscreenRendering on subtitles for PiP
  • Loading branch information
ThaUnknown committed Apr 11, 2022
1 parent 0fe9221 commit a9b924a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Miru",
"version": "1.4.2",
"version": "1.4.3",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"main": "src/index.js",
"homepage": "https://github.com/ThaUnknown/miru#readme",
Expand Down
20 changes: 17 additions & 3 deletions src/renderer/src/lib/RSSView.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
let titles = []
for (const t of grouped) {
// replace & with encoded
let title = t.replace(/&/g, '%26')
let title = t.replace(/&/g, '%26').replace(/\?/g, '%3F').replace(/#/g, '%23')
titles.push(title)
// replace Season 2 with S2, else replace 2nd Season with S2, but keep the original title
Expand Down Expand Up @@ -172,6 +172,9 @@
function close() {
table = null
}
function checkClose({ keyCode }) {
if (keyCode == 27) close()
}
function play(entry) {
updateMedia(fileMedia)
if (entry.seeders !== '?' && entry.seeders <= 15) {
Expand All @@ -186,9 +189,9 @@
}
</script>
<div class="modal" class:show={table} id="viewAnime" tabindex="-1" role="dialog">
<div class="modal" class:show={table} id="viewAnime" on:keydown={checkClose} tabindex="-1">
{#if table}
<div class="modal-dialog" role="document">
<div class="modal-dialog" role="document" on:click|self={close}>
<div class="modal-content w-auto">
<button class="close pointer" type="button" on:click={close}>
<span>&times;</span>
Expand Down Expand Up @@ -223,3 +226,14 @@
</div>
{/if}
</div>
<style>
.trailer {
padding-bottom: 56.25%;
}
.close {
top: 1rem !important;
left: unset;
right: 2.5rem !important;
}
</style>
7 changes: 5 additions & 2 deletions src/renderer/src/lib/ViewAnime.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
}
</script>
<div class="modal modal-full" class:show={$view} on:keydown={checkClose}>
<div class="modal modal-full" class:show={$view} on:keydown={checkClose} tabindex="-1">
{#if $view}
<div class="h-full modal-content bg-very-dark p-0 overflow-y-auto">
<button class="d-flex justify-content-center align-items-center close pointer z-30 bg-dark shadow-lg border top-20 right-0" type="button" on:click={close}>
Expand Down Expand Up @@ -136,7 +136,10 @@
close()
}}>
<span class="material-icons mr-10 font-size-24 w-30"> play_arrow </span>
<span>{$view.mediaListEntry?.progress ? 'Continue ' + (Math.min($view.episodes || $view.nextAiringEpisode?.episode, $view.mediaListEntry?.progress + 1)) : 'Play'}</span>
<span
>{$view.mediaListEntry?.progress
? 'Continue ' + Math.min($view.episodes || $view.nextAiringEpisode?.episode, $view.mediaListEntry?.progress + 1)
: 'Play'}</span>
</button>
{#if alToken && $view.mediaListEntry?.status !== 'CURRENT' && $view.mediaListEntry?.status !== 'COMPLETED'}
<button class="btn d-flex align-items-center mb-5 font-weight-bold font-size-16 btn-primary" on:click={() => addToList($view)}>
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/src/lib/ViewTrailer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
}
</script>

<div class="modal" class:show={$url} on:keydown={checkClose}>
<div class="modal" class:show={$url} on:keydown={checkClose} tabindex="-1">
{#if $url}
<div class="modal-dialog" role="document">
<div class="modal-dialog" role="document" on:click|self={close}>
<div class="modal-content w-three-quarter h-full bg-transparent d-flex justify-content-center flex-column">
<button class="d-flex justify-content-center align-items-center close pointer z-30 bg-dark shadow-lg border top-20 right-0" type="button" on:click={close}>
<span>×</span>
Expand Down
3 changes: 2 additions & 1 deletion src/renderer/src/modules/subtitles.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ export default class Subtitles {
video: this.video,
subContent: this.headers[this.current].header.slice(0, -1),
fonts: this.fonts,
workerUrl: 'lib/subtitles-octopus-worker.js'
workerUrl: 'lib/subtitles-octopus-worker.js',
offscreenRender: false
}
this.renderer = new SubtitlesOctopus(options)
this.selectCaptions(this.current)
Expand Down

0 comments on commit a9b924a

Please sign in to comment.