mpc-hc/mpc-hc — pull request #63 by gruzdev (2013-03-26 05:45:53+00:00)
Title: Subtitle download dialog improvements

This patchset addresses #2144. As demi_alucard noted in discussion, there is no much value in saving sorting order. I can hardly imagine a use case when someone wants to keep sorting on anything other than language.

My routine operation after opening subtitle download dialog is:
1. click sorting by Language,
2. scroll down to English,
3. peek an item that most closely corresponds to file name.

The first patch is trivial. It just adds sorting by language to eliminate step 1.

The second one tries to ease step 3. It adds default sorting callback. First, It sorts subs by language as usual. For those ones with the same language, the order determined by comparison subtitle name and file name as character arrays. The more leading characters match, the more subtitle name is close to the file name. Finally, I place shorter subtitle names earlier (note that *.HI.srt on screenshot in second row for English language). I've attached dialog screenshot for Californication.S06E09.HDTV.x264-2HD.mp4 file name.

![new](https://f.cloud.github.com/assets/610365/301517/9728581e-95d7-11e2-874f-b587a3cb6a25.PNG)

If it's ok with you, I'll try to implement subtitle language preference ( #2022) to eliminate step 2.