From a2c2e32bfe68b558204512c035d5948e659deaa4 Mon Sep 17 00:00:00 2001 From: j Date: Thu, 6 Jul 2023 09:43:02 +0530 Subject: [PATCH] speed up get api call for items with many files --- pandora/item/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index 2a927120f..238e175bd 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1401,7 +1401,7 @@ class Item(models.Model): source=None, available=True, file__item=self, file__selected=True ).filter( Q(file__is_audio=True) | Q(file__is_video=True) - ) + ).select_related() if not track: tracks = self.audio_tracks() if len(tracks) > 1: