This commit is contained in:
EstrellaXD
2023-03-04 23:07:06 +08:00
parent 131682756e
commit 2536d296d7
3 changed files with 8 additions and 6 deletions

View File

@@ -80,11 +80,11 @@ class DownloadClient:
status_filter="completed", category="Bangumi"
)
def rename_torrent_file(self, hash, path_name, new_name):
def rename_torrent_file(self, hash, new_file_name, old_path, new_path):
self.client.torrents_rename_file(
torrent_hash=hash, old_path=path_name, new_path=new_name
torrent_hash=hash, new_file_name=new_file_name, old_path=old_path, new_path=new_path
)
logger.info(f"{path_name} >> {new_name}")
logger.info(f"{old_path} >> {new_path}, new name {new_file_name}")
def delete_torrent(self, hashes):
self.client.torrents_delete(

View File

@@ -65,7 +65,8 @@ class Renamer:
try:
new_name = self._renamer.download_parser(name, folder_name, season, suffix, settings.bangumi_manage.rename_method)
if path_name != new_name:
self.client.rename_torrent_file(torrent_hash, path_name, new_name)
old_name = info.content_path.replace(info.save_path, "")
self.client.rename_torrent_file(torrent_hash, new_name, old_name, new_name)
rename_count += 1
else:
continue

View File

@@ -56,8 +56,9 @@ class QbDownloader:
torrent_hashes=hash
)
def torrents_rename_file(self, torrent_hash, old_path, new_path):
self._client.torrents_rename_file(torrent_hash=torrent_hash, old_path=old_path, new_path=new_path)
def torrents_rename_file(self, torrent_hash, new_file_name, old_path, new_path):
self._client.torrents_rename_file(torrent_hash=torrent_hash, new_file_name=new_file_name,
old_path=old_path, new_path=new_path)
def get_rss_info(self):
item = self._client.rss_items().get("Mikan_RSS")