From fab5495bebdefae3d0920a94abaf4ec323cb0630 Mon Sep 17 00:00:00 2001 From: Nils Maier Date: Sun, 9 Jun 2013 15:56:44 +0200 Subject: [PATCH] Server: IndexHandler should put out an ordered mount list --- server/Handlers/IndexHandler.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/Handlers/IndexHandler.cs b/server/Handlers/IndexHandler.cs index 26c99bdb..4ce5a3ed 100644 --- a/server/Handlers/IndexHandler.cs +++ b/server/Handlers/IndexHandler.cs @@ -1,4 +1,5 @@ using NMaier.SimpleDlna.Utilities; +using System.Linq; namespace NMaier.SimpleDlna.Server { @@ -28,7 +29,8 @@ public IResponse HandleRequest(IRequest req) var document = article.OwnerDocument; var list = document.EL("ul"); - foreach (var m in owner.MediaMounts) { + var mounts = owner.MediaMounts.OrderBy(m => { return m.Value; }, NaturalStringComparer.CurrentCultureIgnoreCase); + foreach (var m in mounts) { var li = document.EL("li"); li.AppendChild(document.EL("a", new AttributeCollection() { { "href", m.Key } }, m.Value)); list.AppendChild(li);