Skip to content

Commit 0eb18c1

Browse files
committed
Fixed #11: --keep behavior
--keep sets a date in the past so `--keep 1y` means the same date one year before. Torrents added **before** that date and which are not in catalog are removed. We were doing the opposite
1 parent 6971a5e commit 0eb18c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/kiwixseeder/runner.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def remove_outdated_torrents(self):
161161
# keep those that are within --keep duration
162162
keep_until = self.now - datetime.timedelta(seconds=context.keep_for)
163163
for btih in unselected_books:
164-
if self.manager.get(btih).added_on >= keep_until:
164+
if self.manager.get(btih).added_on <= keep_until:
165165
unselected_books.remove(btih)
166166

167167
if not len(unselected_books):

0 commit comments

Comments
 (0)