Skip to content

Commit fd38ead

Browse files
committed
torrents_info.py: Added text 'shuffle(torrents)'; Deleted text 'torrents = shuffle(torrents)'
1 parent 983b61b commit fd38ead

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

library/createdb/torrents_add.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def torrents_add():
167167
else:
168168
if torrent_info["info_hash"] in known_hashes and not args.force:
169169
if args.delete_files:
170+
log.info("[%s]: known info_hash; Deleting.", torrent_info["path"])
170171
trash(args, torrent_info["path"])
171172
else:
172173
log.info(
@@ -193,7 +194,7 @@ def torrents_add():
193194
playlists_id = db_playlists._add(args, objects.dict_filter_bool(torrent_info))
194195
files = [file | {"playlists_id": playlists_id} for file in files]
195196
args.db["media"].insert_all(files, pk=["playlists_id", "path"], alter=True, replace=True)
196-
print()
197+
print("Extracted metadata from", num_paths, "files")
197198

198199
if not args.db["media"].detect_fts():
199200
db_utils.optimize(args)

library/playback/torrents_info.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ def shorten(s, width):
549549
elif args.sort == "remaining":
550550
torrents = sorted(torrents, key=lambda t: t.amount_left, reverse=reverse_sort)
551551
elif args.sort == "random":
552-
torrents = shuffle(torrents)
552+
shuffle(torrents)
553553
elif args.sort == "seeders":
554554
torrents = sorted(torrents, key=lambda t: t.num_complete, reverse=reverse_sort)
555555
elif args.sort == "leechers":
@@ -898,7 +898,7 @@ def gen_row(t):
898898
elif file.progress == 100.0:
899899
print(f"Keeping complete file: {file_path}")
900900
else:
901-
print(f"Keeping {strings.percent(100.0 - file.progress)} incomplete file: {file_path}")
901+
print(f"Keeping {strings.percent(1 - (file.progress / 100))} incomplete file: {file_path}")
902902
break # Stop after deleting first valid path
903903

904904
alt_move_syntax = any(

0 commit comments

Comments
 (0)