Skip to content
This repository has been archived by the owner on May 27, 2023. It is now read-only.

Commit

Permalink
show position for radio without title
Browse files Browse the repository at this point in the history
  • Loading branch information
msoap committed Feb 2, 2013
1 parent 9cb21e0 commit 456a61a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions mojolicious-radio-box.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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:\/\//)) {
Expand Down
10 changes: 5 additions & 5 deletions src/radio-box-client.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand All @@ -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:\/\//)
Expand Down

0 comments on commit 456a61a

Please sign in to comment.