JohnDoee / autotorrent2

Cross-seed matching and torrent lifecycle tool
https://johndoee.github.io/autotorrent2/
MIT License
149 stars 12 forks source link

hardlinks not working #1

Closed Jerrk closed 2 years ago

Jerrk commented 2 years ago

Running unraid

If link_type is set to "hard" i get the below error when trying to add a .torrent.

Traceback (most recent call last):
  File "/mnt/user/appdata/autotorrent2/bin/at2", line 8, in <module>
    sys.exit(cli())
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/__main__.py", line 433, in add
    create_link_result = create_link_path(ctx.obj["store_path"], link_file_mapping, client_name, torrent_path, {}, ctx.obj["link_type"], rw_cache=rw_cache, chown_str=chown, dry_run=dry_run) # TODO: feedback that things take time when caching
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/utils.py", line 595, in create_link_path
    create_link(actual_path, link_path, link_type)
  File "/mnt/user/appdata/autotorrent2/lib64/python3.9/site-packages/autotorrent/utils.py", line 609, in create_link
    link_path.link_to(actual_path)
  File "/usr/lib64/python3.9/pathlib.py", line 1405, in link_to
    self._accessor.link_to(self, target)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/user/Media/.Seeding/.Autotorrent/aot/data/aot.mkv' -> '/mnt/user/Media/.Seeding/Anime/aot/aot.mkv'

if i rerun the script it will show the torrent as "exists".

A folder will be created in store_path but the media files will not be hardlinked to the directory and the torrent will not be added to the specified client.

link_type "soft" does not have this issue.

the command ln "/mnt/user/Media/.Seeding/Anime/aot/aot.mkv" "/mnt/user/Media/.Seeding/.Autotorrent/aot/data/aot.mkv" creates a hardlink with no issue.

JohnDoee commented 2 years ago

Fixed in 1.0.1