[videos] Big guns, SQL delete
All checks were successful
build & deploy / test (push) Successful in 1m53s
build & deploy / deploy (push) Successful in 22s

This commit is contained in:
2026-03-21 19:08:37 -04:00
parent bf17a0eeab
commit 02d13b5a99
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,5 @@
from django.core.management.base import BaseCommand
from django.db import models
from django.db import connection, models
class Command(BaseCommand):
@ -88,7 +88,10 @@ class Command(BaseCommand):
)
total_moved += video_count
dup_series.delete()
with connection.cursor() as cursor:
cursor.execute(
"DELETE FROM videos_series WHERE id = %s", [dup_series.id]
)
self.stdout.write(f" Deleted series id={dup_series.id}")
self.stdout.write(

View File

@ -1,5 +1,5 @@
from django.core.management.base import BaseCommand
from django.db import models
from django.db import connection, models
class Command(BaseCommand):
@ -80,7 +80,10 @@ class Command(BaseCommand):
f" Moved {scrobble_count} scrobbles from id={dup_video.id} to id={keeper.id}"
)
dup_video.delete()
with connection.cursor() as cursor:
cursor.execute(
"DELETE FROM videos_video WHERE id = %s", [dup_video.id]
)
self.stdout.write(f" Deleted video id={dup_video.id}")
self.stdout.write(self.style.SUCCESS("\nDone!"))