Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix channels playlist sorting for high channel numbers
  • Loading branch information
TheTroll authored and perexg committed Sep 14, 2015
1 parent 857a7fb commit fb0f13c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/webui/webui.c
Expand Up @@ -81,8 +81,14 @@ static int webui_xspf;
static int
http_channel_playlist_cmp(const void *a, const void *b)
{
int r;
channel_t *c1 = *(channel_t **)a, *c2 = *(channel_t **)b;
int r = channel_get_number(c1) - channel_get_number(c2);
if (channel_get_number(c1) > channel_get_number(c2))
r = 1;
else if (channel_get_number(c1) < channel_get_number(c2))
r = -1;
else
r = 0;
if (r == 0)
r = strcasecmp(channel_get_name(c1), channel_get_name(c2));
return r;
Expand Down

0 comments on commit fb0f13c

Please sign in to comment.