speed up get api call for items with many files

This commit is contained in:
j 2023-07-06 09:43:02 +05:30
parent d3b9d87c43
commit a2c2e32bfe

View file

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