fix: seekbar breaking with out of order chapters

fix: seekbar breaking with misstimed chapters
fix: playnext/last not available when no media was detected
fix: NCOP/NCED playing from batches
fix: aniskip lookup error on files with no media
This commit is contained in:
ThaUnknown 2023-05-05 20:11:01 +02:00
parent e676036a4e
commit c2ca168aa3
5 changed files with 21 additions and 14 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "Miru", "name": "Miru",
"version": "3.10.2", "version": "3.10.3",
"author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>", "author": "ThaUnknown_ <ThaUnknown@users.noreply.github.com>",
"description": "Stream anime torrents, real-time with no waiting for downloads.", "description": "Stream anime torrents, real-time with no waiting for downloads.",
"main": "src/index.js", "main": "src/index.js",
@ -66,12 +66,10 @@
"singleArchFiles": "node_modules/+(register-scheme|utp-native)/**", "singleArchFiles": "node_modules/+(register-scheme|utp-native)/**",
"category": "public.app-category.video", "category": "public.app-category.video",
"icon": "build/icon.icns", "icon": "build/icon.icns",
"target": [ "target": [{
{ "arch": "universal",
"arch": "universal", "target": "dmg"
"target": "dmg" }]
}
]
}, },
"win": { "win": {
"artifactName": "${os}-${name}-${version}.${ext}", "artifactName": "${os}-${name}-${version}.${ext}",

View file

@ -38,7 +38,7 @@ dependencies:
electron-updater: 4.6.5 electron-updater: 4.6.5
jassub: 1.6.1 jassub: 1.6.1
js-levenshtein: 1.1.6 js-levenshtein: 1.1.6
matroska-subtitles: github.com/ThaUnknown/matroska-subtitles/6241556509536ff09ba2ea3f050ceb7a3f12190a matroska-subtitles: github.com/ThaUnknown/matroska-subtitles/446d0628ff0bcf13eb95184777615f3a0e6d8ae8
mime: 3.0.0 mime: 3.0.0
p2pcf: github.com/ThaUnknown/p2pcf/faefe2854c817315530636a58d07726de7050561 p2pcf: github.com/ThaUnknown/p2pcf/faefe2854c817315530636a58d07726de7050561
perfect-seekbar: 1.1.0 perfect-seekbar: 1.1.0
@ -3254,10 +3254,10 @@ packages:
version: 2.0.6 version: 2.0.6
dev: false dev: false
github.com/ThaUnknown/matroska-subtitles/6241556509536ff09ba2ea3f050ceb7a3f12190a: github.com/ThaUnknown/matroska-subtitles/446d0628ff0bcf13eb95184777615f3a0e6d8ae8:
resolution: {tarball: https://codeload.github.com/ThaUnknown/matroska-subtitles/tar.gz/6241556509536ff09ba2ea3f050ceb7a3f12190a} resolution: {tarball: https://codeload.github.com/ThaUnknown/matroska-subtitles/tar.gz/446d0628ff0bcf13eb95184777615f3a0e6d8ae8}
name: matroska-subtitles name: matroska-subtitles
version: 3.3.2 version: 3.3.3
dependencies: dependencies:
ebml-stream: 1.0.3 ebml-stream: 1.0.3
pako: 2.1.0 pako: 2.1.0

View file

@ -107,7 +107,11 @@
result = videoFiles.filter(file => file.media.parseObject.anime_title === max) result = videoFiles.filter(file => file.media.parseObject.anime_title === max)
} }
result.sort((a, b) => a.media.episode - b.media.episode) result = result.filter(file => {
if (file.media.parseObject.anime_type?.toLowerCase() === 'nced') return false
if (file.media.parseObject.anime_type?.toLowerCase() === 'ncop') return false
return true
}).sort((a, b) => a.media.episode - b.media.episode)
processed.set([...result, ...otherFiles]) processed.set([...result, ...otherFiles])
await tick() await tick()

View file

@ -150,7 +150,7 @@
export let media export let media
$: checkAvail(media) $: checkAvail(current)
let hasNext = false let hasNext = false
let hasLast = false let hasLast = false
function checkAvail () { function checkAvail () {
@ -646,7 +646,7 @@
if (detail.length) chapters = detail if (detail.length) chapters = detail
}) })
async function findChapters () { async function findChapters () {
if (!chapters.length) { if (!chapters.length && current.media.media) {
chapters = await getChaptersAniSkip(current, safeduration) chapters = await getChaptersAniSkip(current, safeduration)
} }
} }
@ -684,7 +684,9 @@
const sanitised = [] const sanitised = []
let sum = 0 let sum = 0
for (let { start, end, text } of chapters) { for (let { start, end, text } of chapters) {
if (start > safeduration * 1000) continue
if (start < 0) start = 0 if (start < 0) start = 0
if (end > safeduration * 1000) end = safeduration * 1000
if (!sanitised.length && start !== 0) { if (!sanitised.length && start !== 0) {
const size = start / 10 / safeduration const size = start / 10 / safeduration
sum += size sum += size

View file

@ -15,6 +15,9 @@ export default defineConfig(({ mode }) => {
}, },
plugins: [mode !== 'development' && commonjs(), svelte()], plugins: [mode !== 'development' && commonjs(), svelte()],
root, root,
server: {
hmr: false
},
base: './', base: './',
build: { build: {
rollupOptions: { rollupOptions: {