vpn integration

This commit is contained in:
2026-04-11 22:07:59 +02:00
parent c4d27e9842
commit 00ac38d126
47 changed files with 945 additions and 749 deletions
+8 -10
View File
@@ -1,12 +1,10 @@
from django.db import close_old_connections
from celery import shared_task
from channels.layers import get_channel_layer
from asgiref.sync import async_to_sync
from .models import Torrent, File
from .utils import transmission_handler
from app.utils import send_sync_channel_message
from .models import Torrent
from .utils import transmission_handler
@shared_task
def update_transmission_data():
@@ -19,8 +17,8 @@ def update_transmission_data():
updated_torrents.append(torrent)
if updated_torrents:
Torrent.objects.bulk_update(updated_torrents, ["transmission_data"])
send_sync_channel_message("torrent", "transmission_data_updated", {
torrent.id: torrent.transmission_data
for torrent in updated_torrents
})
send_sync_channel_message(
"torrent",
"transmission_data_updated",
{torrent.id: torrent.transmission_data for torrent in updated_torrents},
)