Dudemanguy / mpv-manga-reader

Manga reading script for mpv
GNU General Public License v3.0
118 stars 4 forks source link

Can't make it work #2

Closed mac1202 closed 4 years ago

mac1202 commented 4 years ago

I trying to use your script I got this error on everything image or archive I tried :


[manga_reader] 
[manga_reader] stack traceback:
[manga_reader]  [C]: in function 'gsub'
[manga_reader]  /home/mac/.config/mpv-manga/scripts/manga-reader.lua:295: in function 'generate_name'
[manga_reader]  /home/mac/.config/mpv-manga/scripts/manga-reader.lua:429: in function 'continuous_page'
[manga_reader]  /home/mac/.config/mpv-manga/scripts/manga-reader.lua:529: in function 'change_page'
[manga_reader]  /home/mac/.config/mpv-manga/scripts/manga-reader.lua:1089: in function 'start_manga_reader'
[manga_reader]  /home/mac/.config/mpv-manga/scripts/manga-reader.lua:1101: in function 'handler'
[manga_reader]  mp.defaults:460: in function 'call_event_handlers'
[manga_reader]  mp.defaults:494: in function 'dispatch_events'
[manga_reader]  mp.defaults:453: in function <mp.defaults:452>
[manga_reader]  [C]: in ?
[manga_reader]  [C]: in ?
[manga_reader] Lua error: /home/mac/.config/mpv-manga/scripts/manga-reader.lua:295: bad argument #1 to 'gsub' (string expected, got nil)

What am I doing wrong ?

Dudemanguy commented 4 years ago

You're not doing anything wrong. It could be me. It looks like to me that filearray is empty which would result in those null strings. The script uses a few shell calls which should return the paths of every image in an archive or directory (opening up a single image doesn't actually work). I guess for some reason, it doesn't return a filelist for you which seems quite bad.

Could you try to verify if it occurs on all possible archive types or just a subset of them? On paper, it should open up a .zip, .7z, .tar, .rar as well as a directory.

mac1202 commented 4 years ago

Plain folder work. Some zip work other don't. I think the one created with 7z utility doesn't work. But nevermind the script doesnt work like I expected. I throught it will automatically expand image to screen width for better readability.

Dudemanguy commented 4 years ago

Well mpv already has a ton of scaling/zoom/etc. options. I actually couldn't tell you how to expand image to width since it isn't something I would personally use, but I imagine it's possible to achieve with the right options.

the one created with 7z utility doesn't work

By "7z utility" do you you mean the command line tool (p7zip) or something else? I would hope zipinfo prints the same way to stdout everywhere but maybe it doesn't. Do you mind uploading a sample file of one of the non-working ones somewhere? This is still a bug I would like to fix.

mac1202 commented 4 years ago

after some more testing I think I find the issue. if I open the archive with this command it fail : mpv --config-dir=$HOME/.config/mpv-manga/ Kobayashi-san\ Chi\ no\ Maid\ Dragon:\ Elma\ OL\ Nikki/c021.zip

but if I cd to the directory and open the archive with this command it work : mpv --config-dir=$HOME/.config/mpv-manga/ c021.zip

So I think the issue is when the filename is too long or too complex.

Dudemanguy commented 4 years ago

Thanks, I understand what the issue is now. It's an oversight on my part with the path handling.