resolves review

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2607>
environments/review-docs-2083-yqf2yl/deployments/18772
Petitminion 2023-11-07 15:33:28 +01:00 zatwierdzone przez Marge
rodzic ccb9987a95
commit 363a4b5d35
3 zmienionych plików z 7 dodań i 8 usunięć

Wyświetl plik

@ -41,9 +41,9 @@ class MbidTaggedContent(types.BooleanPreference):
name = "only_allow_musicbrainz_tagged_files"
verbose_name = "Only allow Musicbrainz tagged files"
help_text = (
"Only Musicbrainz tagged files will be allowed to be uploaded on the server. "
"If files where uploaded before this settings will not affect them. "
"To clean the db from files not following mb tags use the funkwhale cli "
"or use quality filters"
"Requires uploaded files to be tagged with a MusicBrainz ID. "
"Enabling this setting has no impact on previously uploaded files. "
"You can use the CLI to clear files that don't contain an MBID or "
"or enable quality filtering to hide untagged content from API calls. "
)
default = False

Wyświetl plik

@ -248,7 +248,7 @@ def process_upload(upload, update_denormalization=True):
upload, "invalid_metadata", detail=detail, file_metadata=metadata_dump
)
check_mbid = preferences.get("music__only_allow_musicbrainz_tagged_files")
if check_mbid is True and not serializer.validated_data.get("mbid"):
if check_mbid and not serializer.validated_data.get("mbid"):
return fail_import(
upload,
"Uploading files without a MusicBrainz ID is not permitted in this pod",

Wyświetl plik

@ -1276,7 +1276,7 @@ def test_can_import_track_with_same_position_in_different_discs(factories, mocke
},
"position": upload.track.position,
"disc_number": 2,
"mbid": str(uuid.uuid4()),
"mbid": None,
}
mocker.patch.object(metadata.TrackMetadataSerializer, "validated_data", data)
@ -1310,7 +1310,7 @@ def test_can_import_track_with_same_position_in_same_discs_skipped(factories, mo
},
"position": upload.track.position,
"disc_number": upload.track.disc_number,
"mbid": str(uuid.uuid4()),
"mbid": None,
}
mocker.patch.object(metadata.TrackMetadataSerializer, "validated_data", data)
@ -1407,7 +1407,6 @@ def test_upload_checks_mbid_tag(temp_signal, factories, mocker, preferences):
mocker.patch("funkwhale_api.federation.routes.outbox.dispatch")
mocker.patch("funkwhale_api.music.tasks.populate_album_cover")
mocker.patch("funkwhale_api.music.metadata.Metadata.get_picture")
# mocker.spy(tasks, "get_track_from_import_metadata")
track = factories["music.Track"](album__attachment_cover=None, mbid=None)
path = os.path.join(DATA_DIR, "with_cover.opus")