diff --git a/api/funkwhale_api/music/models.py b/api/funkwhale_api/music/models.py index 8b638ce7d..16ac58dc9 100644 --- a/api/funkwhale_api/music/models.py +++ b/api/funkwhale_api/music/models.py @@ -567,6 +567,7 @@ class ImportBatch(models.Model): class ImportJob(models.Model): uuid = models.UUIDField(unique=True, db_index=True, default=uuid.uuid4) + update_if_duplicate = models.BooleanField(default=False) batch = models.ForeignKey( ImportBatch, related_name="jobs", on_delete=models.CASCADE ) diff --git a/api/funkwhale_api/providers/audiofile/management/commands/import_files.py b/api/funkwhale_api/providers/audiofile/management/commands/import_files.py index 8de779230..2d1ddba1f 100644 --- a/api/funkwhale_api/providers/audiofile/management/commands/import_files.py +++ b/api/funkwhale_api/providers/audiofile/management/commands/import_files.py @@ -55,6 +55,16 @@ class Command(BaseCommand): "import and not much disk space available." ), ) + parser.add_argument( + "--update", + action="store_true", + dest="update", + default=False, + help=( + "Use this flag to replace duplicates (tracks with same " + "musicbrainz mbid) on import with their newest version." + ), + ) parser.add_argument( "--noinput", "--no-input",