mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 06:19:15 +02:00
Fix #273: fix_track_files will now update files with bad mimetype
This commit is contained in:
parent
390dcfd06f
commit
18ad6cfa78
3 changed files with 32 additions and 2 deletions
|
@ -33,9 +33,9 @@ class Command(BaseCommand):
|
|||
def fix_mimetypes(self, dry_run, **kwargs):
|
||||
self.stdout.write('Fixing missing mimetypes...')
|
||||
matching = models.TrackFile.objects.filter(
|
||||
source__startswith='file://', mimetype=None)
|
||||
source__startswith='file://').exclude(mimetype__startswith='audio/')
|
||||
self.stdout.write(
|
||||
'[mimetypes] {} entries found with no mimetype'.format(
|
||||
'[mimetypes] {} entries found with bad or no mimetype'.format(
|
||||
matching.count()))
|
||||
for extension, mimetype in utils.EXTENSION_TO_MIMETYPE.items():
|
||||
qs = matching.filter(source__endswith='.{}'.format(extension))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue