kopia lustrzana https://github.com/mediacms-io/mediacms
Merge 03a3f5a597
into c5047d8df8
commit
2e00b8f576
|
@ -787,7 +787,11 @@ class Media(models.Model):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
ret = []
|
ret = []
|
||||||
for subtitle in self.subtitles.all():
|
|
||||||
|
# Retrieve all subtitles and sort by the first letter of their associated language's title
|
||||||
|
sorted_subtitles = sorted(self.subtitles.all(), key=lambda s: s.language.title[0])
|
||||||
|
|
||||||
|
for subtitle in sorted_subtitles:
|
||||||
ret.append(
|
ret.append(
|
||||||
{
|
{
|
||||||
"src": helpers.url_from_path(subtitle.subtitle_file.path),
|
"src": helpers.url_from_path(subtitle.subtitle_file.path),
|
||||||
|
|
Ładowanie…
Reference in New Issue