Skip to content

Commit

Permalink
Un-version dlcheckpoints (#8266)
Browse files Browse the repository at this point in the history
  • Loading branch information
qstokkink authored Nov 14, 2024
2 parents 6fb9bb1 + 57f5b4c commit 47bd1e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def __init__(self, config: TriblerConfigManager, notifier: Notifier,
super().__init__()
self.config = config

self.state_dir = Path(config.get_version_state_dir())
self.state_dir = Path(config.get("state_dir"))
self.ltsettings: dict[lt.session, dict] = {} # Stores a copy of the settings dict for each libtorrent session
self.ltsessions: dict[int, Future[lt.session]] = {}
self.dht_health_manager: DHTHealthManager | None = None
Expand Down
5 changes: 3 additions & 2 deletions src/tribler/upgrade_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ def upgrade(config: TriblerConfigManager, source: str, destination: str) -> None
config.write()

# Step 2: copy downloads
os.makedirs(os.path.join(destination, "dlcheckpoints"), exist_ok=True)
parent_directory = os.path.dirname(destination) # Starting from 8.0.4 this is no longer versioned information
os.makedirs(os.path.join(parent_directory, "dlcheckpoints"), exist_ok=True)
for checkpoint in os.listdir(os.path.join(source, "dlcheckpoints")):
_copy_if_not_exist(os.path.join(source, "dlcheckpoints", checkpoint),
os.path.join(destination, "dlcheckpoints", checkpoint))
os.path.join(parent_directory, "dlcheckpoints", checkpoint))

# Step 3: Copy tribler db.
os.makedirs(os.path.join(destination, "sqlite"), exist_ok=True)
Expand Down

0 comments on commit 47bd1e0

Please sign in to comment.