From 57f5b4c05af8812962d25c91be0c3999ff46fe25 Mon Sep 17 00:00:00 2001 From: Quinten Stokkink Date: Thu, 14 Nov 2024 14:44:01 +0100 Subject: [PATCH] Un-version dlcheckpoints --- .../core/libtorrent/download_manager/download_manager.py | 2 +- src/tribler/upgrade_script.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tribler/core/libtorrent/download_manager/download_manager.py b/src/tribler/core/libtorrent/download_manager/download_manager.py index 52b37df87b..42ecd02286 100644 --- a/src/tribler/core/libtorrent/download_manager/download_manager.py +++ b/src/tribler/core/libtorrent/download_manager/download_manager.py @@ -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 diff --git a/src/tribler/upgrade_script.py b/src/tribler/upgrade_script.py index deab0f7077..67bfcfb74f 100644 --- a/src/tribler/upgrade_script.py +++ b/src/tribler/upgrade_script.py @@ -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)