resolves review

Part-of: <https://dev.funkwhale.audio/funkwhale/funkwhale/-/merge_requests/2607>
This commit is contained in:
Petitminion 2023-11-07 15:33:28 +01:00 committed by Marge
commit 363a4b5d35
3 changed files with 7 additions and 8 deletions

View file

@ -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

View file

@ -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",