[scrobbles] Add management command for imap

This commit is contained in:
2025-07-03 14:59:33 -04:00
parent 1fd325823b
commit 64cb17e91f
2 changed files with 21 additions and 7 deletions

View File

@ -0,0 +1,15 @@
from django.core.management.base import BaseCommand
from vrobbler.apps.scrobbles.imap import process_scrobbles_from_imap
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
"--restart",
action="store_true",
help="Restart failed imports",
)
def handle(self, *args, **options):
count = len(process_scrobbles_from_imap())
print(f"Started {count} IMAP imports")