So, the whole thing is good, and works fine with English-only file/path.
But inevitably there are contents named in other language.
For example, I have this movie in :
E:/电影/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv
And when js tries to pass it to potplayer, it actually becomes :
E:/%E7%94%B5%E5%BD%B1/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv
console output is :
Launched external handler for 'potplayer://E:/%E7%94%B5%E5%BD%B1/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv'.
so I tried to encode/decode the path, like:
(function() {
'use strict';
let openPotplayer = async (itemid) => {
let userid = (await ApiClient.getCurrentUser()).Id;
ApiClient.getItem(userid, itemid).then(r => {
if (r.Path) {
let path = encodeURI(r.Path.replace(/\/g, '/')); //encode path
console.log(path);
window.open('potplayer://' + decodeURI(path)); //decode path
} else {
ApiClient.getItems(userid, itemid).then(r => openPotplayer(r.Items[0].Id));
}
})
};
Though the converting seems to be correct if I log it to the console, it just won't pass the decoded path when open up window. Same output like before.
Hope I can hear from you soon. Thanks again for bringing us this project. 👍
So, the whole thing is good, and works fine with English-only file/path. But inevitably there are contents named in other language.
For example, I have this movie in : E:/电影/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv
And when js tries to pass it to potplayer, it actually becomes : E:/%E7%94%B5%E5%BD%B1/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv console output is : Launched external handler for 'potplayer://E:/%E7%94%B5%E5%BD%B1/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT/Top.Gun.Maverick.2022.IMAX.2160p.BluRay.REMUX.HEVC.DTS-HD.MA.TrueHD.7.1.Atmos-FGT.mkv'.
so I tried to encode/decode the path, like: (function() { 'use strict'; let openPotplayer = async (itemid) => { let userid = (await ApiClient.getCurrentUser()).Id; ApiClient.getItem(userid, itemid).then(r => { if (r.Path) { let path = encodeURI(r.Path.replace(/\/g, '/')); //encode path console.log(path); window.open('potplayer://' + decodeURI(path)); //decode path } else { ApiClient.getItems(userid, itemid).then(r => openPotplayer(r.Items[0].Id)); } }) };
Though the converting seems to be correct if I log it to the console, it just won't pass the decoded path when open up window. Same output like before. Hope I can hear from you soon. Thanks again for bringing us this project. 👍