[scrobbles] Add management command for imap
This commit is contained in:
@ -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")
|
||||
Reference in New Issue
Block a user