jonniek / mpv-filenavigator

Navigate and open your local files in mpv
The Unlicense
69 stars 9 forks source link

Partition is inaccessible since mpv 0.33 #19

Closed escapezn closed 2 years ago

escapezn commented 3 years ago

It was able to switch between partitions on mpv 0.32 with RIGHT key, however 0.33 broke it. Now RIGHT key can only append a partition to playlist, rather than enter it.

console output

[file] Cannot open file ' Select drive/D:': Invalid argument

[stream] Failed to open Select drive/D:.

[cplayer]

[cplayer] Playing: Select drive/E:

[file] Cannot open file ' Select drive/E:': Invalid argument

[stream] Failed to open Select drive/E:.
escapezn commented 2 years ago

Finally I could explain what's wrong there. Some checkpoints were putted in this script and then read mpv's log.

mp.osd_message("path"..path)
mp.osd_message("item"..item)
local newdir0 = utils.join_path(path, item)

local newdir = utils.join_path(path, item):gsub(SEPARATOR, SEPARATOR_WINDOWS)..SEPARATOR_WINDOWS
local info, error = utils.file_info(newdir)

mp.osd_message("newdir0"..newdir0)
mp.osd_message("newdir"..newdir)

Log for 0.32

[   3.087][t][cplayer] Run command: show-text, flags=64, args=["pathSelect drive", "-1", "0"]
[   3.087][t][cplayer] Run command: show-text, flags=64, args=["itemC:", "-1", "0"]
[   3.087][t][cplayer] Run command: show-text, flags=64, args=["newdir0C:", "-1", "0"]
......
[   3.088][t][cplayer] Run command: show-text, flags=64, args=["newdirC:\\", "-1", "0"]

Log for 0.34

[   4.057][t][cplayer] Run command: show-text, flags=64, args=[text="pathSelect drive", duration="-1", level="0"]
[   4.057][t][cplayer] Run command: show-text, flags=64, args=[text="itemC:", duration="-1", level="0"]
......
[   4.058][t][cplayer] Run command: show-text, flags=64, args=[text="newdir0Select drive/C:", duration="-1", level="0"]
[   4.064][t][cplayer] Run command: show-text, flags=64, args=[text="newdirSelect drive\\C:\\", duration="-1", level="0"]

Appearently _mp.utils.joinpath made mistakes when joining path and item. This new behavior of mpv was introduced in https://github.com/mpv-player/mpv/commit/31acec543819cf56d63dddae59507858b1229b75 to resolve problems on Windows.

escapezn commented 2 years ago

This workaround was a bit clumsy but indeed worked out. Looking forward to a more decent fix.