Denormalized audio permission logic in a separate table to enhance performance

This commit is contained in:
Eliot Berriot 2019-10-19 18:10:42 +02:00
parent afbf7151c8
commit 4e7f1e63d2
No known key found for this signature in database
GPG key ID: 6B501DFD73514E14
17 changed files with 648 additions and 21 deletions

View file

@ -170,7 +170,7 @@ def fail_import(upload, error_code, detail=None, **fields):
),
"upload",
)
def process_upload(upload):
def process_upload(upload, update_denormalization=True):
import_metadata = upload.import_metadata or {}
old_status = upload.import_status
audio_file = upload.get_audio_file()
@ -249,6 +249,13 @@ def process_upload(upload):
]
)
if update_denormalization:
models.TrackActor.create_entries(
library=upload.library,
upload_and_track_ids=[(upload.pk, upload.track_id)],
delete_existing=False,
)
# update album cover, if needed
if not track.album.cover:
update_album_cover(