Skip to content

Commit

Permalink
Fix for directories
Browse files Browse the repository at this point in the history
  • Loading branch information
NooNameR committed Mar 26, 2024
1 parent f055a50 commit 7e72386
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions scripts/mover.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,24 @@ def stop_start_torrents(torrent_list, pause=True):

if os.path.isdir(content_path):
# If file_path is a directory, include all files within it
for root, _, files in os.walk(content_path):
for root, dirs, files in os.walk(content_path):
for file in files:
file_path = os.path.join(root, file)
file_paths.add(os.path.join(root, file))
file_paths.update(find_hardlinks(file_path, args.cache_mount))
for dir in dirs:
directory_path = os.path.join(root, dir)
file_paths.add(directory_path)
file_paths.add(content_path)
else:
file_paths.add(content_path)
file_paths.update(find_hardlinks(content_path, args.cache_mount))

time.sleep(5)
print(f"Moving files for {torrent.name}.")

os.system(f"echo {'\n'.join(file_paths)} | /usr/local/sbin/move -d {int(args.debug)}")

files_string = "\n".join(file_paths)
os.system(f"echo '{files_string}' | /usr/local/sbin/move")

print(f"Resuming: {torrent.name} [{torrent.added_on}]")
torrent.resume()

0 comments on commit 7e72386

Please sign in to comment.