jslay88 / qbt_migrate

Migrate qBittorrent downloads
MIT License
162 stars 10 forks source link

Change QBt-Save path correctly, not just copying the Save path #11

Closed wambiditu closed 2 years ago

wambiditu commented 3 years ago

I did this on my copy by sending both paths to the set_save_paths function (showing mostly the added and changed lines here)

    def set_save_paths(self, path: str, qpath:str, target_os: Optional[str] = None,
                       save_file: bool = True, create_backup: bool = True):

        self.set_save_path(qpath, key='qBt-savePath', target_os=target_os, save_file=False, create_backup=False)

    def replace_paths(self, existing_path: str, new_path: str, target_os: Optional[str] = None,
                      save_file: bool = True, create_backup: bool = True):

        new_qbt_save_path = self.qbt_save_path.replace(existing_path, new_path)

        self.set_save_paths(path=str(new_save_path), 
                            qpath=str(new_qbt_save_path), target_os=target_os,
                            save_file=save_file, create_backup=create_backup)
jslay88 commented 3 years ago

Please fork and open a PR. Thanks.

jslay88 commented 2 years ago

18 resolves