Add ability to restart lastfm imports
This commit is contained in:
@ -1,7 +1,18 @@
|
||||
from django.core.management.base import BaseCommand, no_translations
|
||||
from django.core.management.base import BaseCommand
|
||||
from vrobbler.apps.scrobbles.utils import import_lastfm_for_all_users
|
||||
|
||||
|
||||
class Command(BaseCommand):
|
||||
def add_arguments(self, parser):
|
||||
parser.add_argument(
|
||||
"--restart",
|
||||
action="store_true",
|
||||
help="Restart failed imports",
|
||||
)
|
||||
|
||||
def handle(self, *args, **options):
|
||||
import_lastfm_for_all_users()
|
||||
restart = False
|
||||
if options["restart"]:
|
||||
restart = True
|
||||
count = import_lastfm_for_all_users(restart=restart)
|
||||
print(f"Started {count} LastFM imports")
|
||||
|
||||
Reference in New Issue
Block a user