ThePornDatabase / namer

Renames adult video files so that the plex/jellyfin plugins and stash script will match without user input. Runs server or command mode.
https://theporndb.net
174 stars 27 forks source link

rstrip error when running on watch mode #106

Closed zenjabba closed 1 year ago

zenjabba commented 1 year ago

2022-10-04T16:48:21.432824+0000 ERROR An error has been caught in function 'on_any_event', process 'MainProcess' (3266684), thread 'Thread-1' (140080837351168):


  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/opt/namer.vrnzb/namer/__main__.py", line 62, in <module>
    main(sys.argv[1:])
  File "/opt/namer.vrnzb/namer/__main__.py", line 52, in main
    namer.watchdog.create_watcher(default_config()).run()
  File "/opt/namer.vrnzb/namer/watchdog.py", line 161, in run
    self.start()
> File "/opt/namer.vrnzb/namer/watchdog.py", line 231, in start
    self.__event_handler.prepare_file_for_processing(file)
  File "/opt/namer.vrnzb/namer/watchdog.py", line 118, in prepare_file_for_processing
    working_command = move_command_files(command, self.__namer_config.work_dir)
  File "/opt/namer.vrnzb/namer/command.py", line 70, in move_command_files
    shutil.move(target.target_directory, working_dir)
  File "/usr/lib/python3.8/shutil.py", line 787, in move
    real_dst = os.path.join(dst, _basename(src))
  File "/usr/lib/python3.8/shutil.py", line 750, in _basename
    return os.path.basename(path.rstrip(sep))
AttributeError: 'PosixPath' object has no attribute 'rstrip'```

Namer stops processing files with this error.
4c0d3r commented 1 year ago

do you have the name of the file it was processing at the time? could be helpful -- this looks like the path is None, or perhaps you are running on python prior to 3.8

zenjabba commented 1 year ago

2022-10-04T16:48:22.520481+0000 INFO watchdog process called for JimmyDraws.22.09.25.Elle.Eastlehigh.Before.You.Go.XXX.VR180.2880p.MP4-GUSH/_unpack/JimmyDraws_Before_You_Go_original_29562_LR_180.mp4


2022-10-04T16:48:21.432602+0000 INFO Moving /mnt/sharedrives/zd_feeder/zennzbget/completed/pornvr/JimmyDraws.22.09.25.Elle.Eastlehigh.Before.You.Go.XXX.VR180.2880p.MP4-GUSH to /mnt/sharedrives/zd_feeder/porn/vr/data/working/JimmyDraws.22.09.25.Elle.Eastlehigh.Before.You.Go.XXX.VR180.2880p.MP4-GUSH for processing```

Python 3.8.10 (default, Jun 22 2022, 20:18:18)
zenjabba commented 1 year ago

ignored_dir_regex = .*_unpack.*

DirtyRacer1337 commented 1 year ago

Updating python to 3.10 should help, shutil.move takes str on older versions

zenjabba commented 1 year ago

Updating python to 3.10 should help, shutil.move takes str on older versions

Will do that and report back within a few hours.

zenjabba commented 1 year ago

Fixed.