Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

show position for radio without title

  • Loading branch information...
commit 456a61a89d8c6c430c2064587b2117e166f8fea0 1 parent 9cb21e0
Sergey Mudrik authored
Showing with 7 additions and 7 deletions.
  1. +2 −2 mojolicious-radio-box.pl
  2. +5 −5 src/radio-box-client.coffee
4 mojolicious-radio-box.pl
View
@@ -544,15 +544,15 @@ sub _cmus_parse_info {
$("#bt_pause").html('<i class="icon-play">&nbsp;&nbsp;play');
}
if (App.info.tag) {
+ position = parseInt(App.info.position) > 0 ? " (" + App.format_track_time(parseInt(App.info.position)) + ")" : "";
if (App.info.radio_title) {
- position = parseInt(App.info.position) > 0 ? " (" + App.format_track_time(parseInt(App.info.position)) + ")" : "";
$("#div_info").html("" + App.info.tag.title + "<br>\n<b>" + App.info.radio_title + position + "</b>");
} else if (App.info.tag.artist && App.info.tag.album) {
duration = parseInt(App.info.duration) > 0 ? " (" + App.format_track_time(parseInt(App.info.duration)) + ")" : "";
$("#div_info").html("" + App.info.tag.artist + "<br>\n<i>" + App.info.tag.album + "</i><br>\n<b>" + App.info.tag.title + duration + "</b>");
$("#radio_stations").hide()[0].selectedIndex = 0;
} else {
- $("#div_info").html("<b>" + App.info.tag.title + "</b>");
+ $("#div_info").html("<b>" + App.info.tag.title + position + "</b>");
}
}
if (App.info.radio_title && App.info.file.match(/http:\/\//)) {
10 src/radio-box-client.coffee
View
@@ -48,11 +48,11 @@ window.App =
$("#bt_pause").html('<i class="icon-play">&nbsp;&nbsp;play')
if App.info.tag
+ position = if parseInt(App.info.position) > 0
+ " (" + App.format_track_time(parseInt(App.info.position)) + ")"
+ else
+ ""
if App.info.radio_title
- position = if parseInt(App.info.position) > 0
- " (" + App.format_track_time(parseInt(App.info.position)) + ")"
- else
- ""
$("#div_info").html """
#{App.info.tag.title}<br>
<b>#{App.info.radio_title}#{position}</b>
@@ -72,7 +72,7 @@ window.App =
else
$("#div_info").html """
- <b>#{App.info.tag.title}</b>
+ <b>#{App.info.tag.title}#{position}</b>
"""
if App.info.radio_title && App.info.file.match(/http:\/\//)
Please sign in to comment.
Something went wrong with that request. Please try again.