想前端提供站点tracker关键字,用于下载器识别种子所属站点

This commit is contained in:
ngfchl
2022-10-01 16:49:26 +08:00
parent fd09c7e509
commit df056b103c

View File

@@ -97,7 +97,7 @@ def get_downloading(request):
id = request.GET.get('id')
print(id)
downloader = Downloader.objects.filter(id=id).first()
tracker_filters = Site.objects.all().values('id', 'name', 'tracker')
qb_client = qbittorrentapi.Client(
host=downloader.host,
port=downloader.port,
@@ -162,6 +162,8 @@ def get_downloading(request):
torrents.append(torrent)
print(len(torrents))
main_data['torrents'] = torrents
# print(tracker_filters)
main_data['tracker_filters'] = list(tracker_filters)
# return JsonResponse(CommonResponse.success(data=torrents).to_dict(), safe=False)
return JsonResponse(CommonResponse.success(data=main_data).to_dict(), safe=False)
except Exception as e: