From 4e761526b2323442127c10db9f2bf2042455d8dc Mon Sep 17 00:00:00 2001 From: xjbeta Date: Fri, 23 Aug 2024 00:24:49 +0800 Subject: [PATCH 1/3] fix: revert dash --- main.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/main.js b/main.js index c73b3a3..2d8eb2c 100644 --- a/main.js +++ b/main.js @@ -63,16 +63,17 @@ function removeOpts() { }; function parseOpts() { - if (optsParsed) { - removeOpts(); + if (optsParsed || mpv.getString('path') != "-") { return; }; let scriptOpts = mpv.getString('script-opts').split(','); - let iinaPlusValue = scriptOpts.find(s => s.startsWith(iinaPlusArgsKey)); - if (iinaPlusValue && !stopped) { + optsParsed = true; + removeOpts(); + + if (iinaPlusValue && !stopped) { let opts = JSON.parse(hexToString(iinaPlusValue.substring(iinaPlusArgsKey.length))); print('iina plus opts: ' + JSON.stringify(opts)); @@ -262,7 +263,11 @@ iina.event.on("iina.window-did-close", () => { }); function deinit() { + if (stopped) { + return; + }; stopped = true; + setObserver(false); iinaPlusOpts = undefined; optsParsed = false; removeOpts(); @@ -281,8 +286,13 @@ iina.event.on("iina.file-started", () => { print('iina.file-started'); stopped = false; let e = iina.preferences.get('enableIINAPLUSOptsParse'); - - parseOpts(); + let p = mpv.getString('path'); + if (p == "-") { + parseOpts(); + return; + } + print('Ignore IINA+ Opts Parse, ' + p); + initMenuItems(); }); iina.event.on("mpv.pause.changed", (isPaused) => { From ecfa4b977c0853a034da994c435c1ee2106e3b87 Mon Sep 17 00:00:00 2001 From: xjbeta Date: Fri, 23 Aug 2024 00:25:11 +0800 Subject: [PATCH 2/3] fix: mpv v0.38.0 loadfile --- main.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 2d8eb2c..2199f0f 100644 --- a/main.js +++ b/main.js @@ -70,7 +70,7 @@ function parseOpts() { let scriptOpts = mpv.getString('script-opts').split(','); let iinaPlusValue = scriptOpts.find(s => s.startsWith(iinaPlusArgsKey)); - optsParsed = true; + optsParsed = true; removeOpts(); if (iinaPlusValue && !stopped) { @@ -78,6 +78,13 @@ function parseOpts() { let opts = JSON.parse(hexToString(iinaPlusValue.substring(iinaPlusArgsKey.length))); print('iina plus opts: ' + JSON.stringify(opts)); + if (parseFloat(iina.core.getVersion().mpv.replace(/^.*v0\./, '')) >= 38) { + // v0.38.0 + mpv.command('loadfile', [opts.urls[opts.currentLine], 'replace', '0', opts.mpvScript]); + } else { + mpv.command('loadfile', [opts.urls[opts.currentLine], 'replace', opts.mpvScript]); + }; + iinaPlusOpts = opts; iinaPlusOpts.mpvScript = undefined; switch(opts.type) { From 9d748f2ee2a226611ee76f46b68712e850c6088b Mon Sep 17 00:00:00 2001 From: xjbeta Date: Fri, 23 Aug 2024 00:25:34 +0800 Subject: [PATCH 3/3] Bump Version to 0.1.12 --- Info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Info.json b/Info.json index 1db46f6..75f30bb 100644 --- a/Info.json +++ b/Info.json @@ -1,8 +1,8 @@ { "name": "Danmaku", "identifier": "com.xjbeta.danmaku", - "version": "0.1.11", - "ghVersion": 8, + "version": "0.1.12", + "ghVersion": 9, "ghRepo": "xjbeta/iina-plugin-danmaku", "description": "IINA Danmaku", "author": {