mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 03:49:16 +02:00
Denormalized audio permission logic in a separate table to enhance performance
This commit is contained in:
parent
afbf7151c8
commit
4e7f1e63d2
17 changed files with 648 additions and 21 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue