jkwill87 / mnamer

media file renaming and organizing tool
https://pypi.org/project/mnamer
MIT License
784 stars 67 forks source link

Mnamer crashes with a-Shell on iOS. #296

Open Manukineko opened 6 months ago

Manukineko commented 6 months ago

Hello, This is a strong edge use-case.

I tried to run mNamer on iOS through a-shell. mnamer is installing fine, without any error.

I tried to rename a file with this command. mnamer "Temp" --episode-format "{s eries}_S{season:02}E{episode:02}.{extension}" --test

the tool find the media file in the Temp folder:

testing mode
Starting mnamer
Processing Episode "[Cleo]Barakamon_-_01_(Dual 
Audio_10bit_BD1080p_x265).mkv" (250.80MB)
select match
 ❱ Barakamon - 01x01 - Cheerful Child
   Barakamon - 01x01 - Episode 1
   Barakan Discovers - 01x01 - Barakan Discover
s Tokyo
   skip
   quit

And then it crashes.

============================== CRASH REPORT BEG
IN ==============================
--------------------------------- environment -
---------------------------------
 - date = 2024-04-07
 - platform = macOS-17.4.1-iPhone16,1-arm-64bit
 - arguments = ['Temp', '--episode-format', '{s
eries}_S{season:02}E{episode:02}.{extension}', 
'--test']
 - cache location = /private/var/mobile/Contain
ers/Data/Application/98B18E89-3A65-421C-9720-2B
B4FA5E29D3/Library/Caches/mnamer-py3.11.sqlite
 - python version = 3.11.0
 - mnamer version = 2.5.5
 - appdirs version = 1.4.4
 - guessit version = 3.7.1
 - requests version = 2.31.0
 - requests cache version = 0.9.8
 - teletype version = 1.3.4
--------------------------------- stack trace -
---------------------------------
Traceback (most recent call last):
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/mnamer/__main__.py"
, line 23, in main
    frontend.launch()
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/mnamer/frontends.py
", line 81, in launch
    self._process_targets()
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/mnamer/frontends.py
", line 112, in _process_targets
    match = tty.metadata_prompt(matches)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/mnamer/tty.py", lin
e 92, in metadata_prompt
    choice = selector.prompt()
  File "/var/mobile/Containers/Data/Application/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/lib/python3.11/site-packages/mnamer/__main__.py", line 23, in main
    frontend.launch()
  File "/var/mobile/Containers/Data/Application/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/lib/python3.11/site-packages/mnamer/frontends.py", line 81, in launch
    self._process_targets()
  File "/var/mobile/Containers/Data/Application/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/lib/python3.11/site-packages/mnamer/frontends.py", line 112, in _process_targets
    match = tty.metadata_prompt(matches)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/var/mobile/Containers/Data/Application/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/lib/python3.11/site-packages/mnamer/tty.py", line 92, in metadata_prompt
    choice = selector.prompt()
             ^^^^^^^^^^^^^^^^^
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/teletype/components
.py", line 222, in prompt
    self._process_keypress()
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/teletype/components
.py", line 155, in _process_keypress
    key = io.get_key()
          ^^^^^^^^^^^^
  File "/var/mobile/Containers/Data/Application
/98B18E89-3A65-421C-9720-2BB4FA5E29D3/Library/l
ib/python3.11/site-packages/teletype/io/posix.p
y", line 13, in get_key
    state = tcgetattr(file_descriptor)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^
termios.error: (25, 'Inappropriate ioctl for de
vice')
=============================== CRASH REPORT EN
D ===============================
Dang, it looks like mnamer crashed! Please cons
ider filling an issue at
https://github.com/jkwill87/mnamer/issues along
 with this report.

I'm pretty sure there is no solution to that but I though I should open an issue regarding. Just in case XD

Manukineko commented 6 months ago

Aaaand 2 minutes after, I just tried with the ˋ--batch` parameter, and it worked ...