Open cdorsat opened 1 year ago
Is this issue available, I want to contribute on this?
Sure, feel free to open a PR if you want. A hint here, files.models.Subtitle is not having a default ordering, (eg as Media or others). So Subtitles are returned based on their id (what was created first). files.models.subtitles_info can be changed, to include the ordering, eg something like
change:
for subtitle in self.subtitles.all():
to:
for subtitle in self.subtitles.filter().order_by('language__title'):
or we can sort language title by first letter also like as stated/ asked by [cdorsat] Like implementing the sorted function
like change:
for subtitle in self.subtitles.all():
to :
sorted_subtitles = sorted(self.subtitles.all(), key=lambda s: s.language.title[0])
for subtitle in sorted_subtitles:
Moreever i have created pull request please review and let me know if i have to make some more changes also.
Thanks for giving me this opportunity and hint.
Regards,
Sonu Kumar
Describe the issue Subtitles should be arranged in the order of the first letter of the language, which is more in line with human habits