.015 fixed search issue, added last.fm support from smrq
This commit is contained in:
parent
06b9ea8ff5
commit
73b5d8ccf9
4 changed files with 43 additions and 8 deletions
1
README
1
README
|
@ -14,6 +14,7 @@ External Subsonic Music Player
|
|||
10/13/2011 .012 added Current Playlist, fixed some bugs
|
||||
10/14/2011 .013 moved auto playlists, album display tweaks
|
||||
10/14/2011 .014 multiple api call issue fix
|
||||
11/15/2011 .015 fixed search issue, added last.fm support from smrq
|
||||
|
||||
TO DO: (In no particular order...)
|
||||
- Jukebox Control
|
||||
|
|
17
index.html
17
index.html
|
@ -418,6 +418,23 @@
|
|||
var next = $('#CurrentPlaylistContainer li.playing').next();
|
||||
changeTrack(next);
|
||||
},
|
||||
updatePlayhead: function (percent) {
|
||||
var player = this.settings.createPlayer;
|
||||
var scrubber = $(this.wrapper).find("." + player.scrubberClass);
|
||||
var progress = $(this.wrapper).find("." + player.progressClass);
|
||||
|
||||
progress.css('width', (scrubber.get(0).offsetWidth * percent) + 'px');
|
||||
|
||||
var played = $(this.wrapper).find("." + player.playedClass);
|
||||
var p = this.duration * percent,
|
||||
m = Math.floor(p / 60),
|
||||
s = Math.floor(p % 60);
|
||||
played.html((m < 10 ? '0' : '') + m + ':' + (s < 10 ? '0' : '') + s);
|
||||
|
||||
if (!scrobbled && p > 30 && (percent > 0.5 || p > 480)) {
|
||||
scrobbleSong(true);
|
||||
}
|
||||
},
|
||||
useFlash: (function() {
|
||||
var a = document.createElement('audio'),
|
||||
userAgent = navigator.userAgent.toLowerCase(),
|
||||
|
|
25
js/app.js
25
js/app.js
|
@ -188,6 +188,7 @@ function refreshRowColor() {
|
|||
$(this).addClass(rowcolor);
|
||||
});
|
||||
}
|
||||
var scrobbled = false;
|
||||
function playSong(el, songid, albumid) {
|
||||
$.ajax({
|
||||
url: baseURL + '/getMusicDirectory.view?v=1.6.0&c=subweb&f=json&id=' + albumid,
|
||||
|
@ -220,6 +221,24 @@ function playSong(el, songid, albumid) {
|
|||
$(el).addClass('playing');
|
||||
$('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png');
|
||||
$('#PlayTrack').addClass('playing');
|
||||
scrobbleSong(false);
|
||||
scrobbled = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
function scrobbleSong(submission) {
|
||||
var songid = $('#songdetails_song').attr('childid');
|
||||
$.ajax({
|
||||
url: baseURL + '/scrobble.view?v=1.6.0&c=subweb&f=json&id=' + songid + "&submission=" + submission,
|
||||
method: 'GET',
|
||||
dataType: 'json',
|
||||
beforeSend: function (req) {
|
||||
req.setRequestHeader('Authorization', auth);
|
||||
},
|
||||
success: function () {
|
||||
if (submission) {
|
||||
scrobbled = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -295,10 +314,8 @@ function search(type, query) {
|
|||
|
||||
var track;
|
||||
if (child.track === undefined) { track = " "; } else { track = child.track; }
|
||||
albumhtml = '<li class=\"song ' + rowcolor + '\" childid=\"' + child.id + '\" parentid=\"' + child.parent + '\">';
|
||||
albumhtml += '<span class=\"track\">' + track + '</span> ';
|
||||
albumhtml += child.title;
|
||||
albumhtml += '</li>';
|
||||
var time = secondsToTime(child.duration);
|
||||
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.album, time['m'], time['s']);
|
||||
$(albumhtml).appendTo("#AlbumContainer");
|
||||
});
|
||||
}
|
||||
|
|
|
@ -441,8 +441,8 @@ ul.songlist li.selected
|
|||
}
|
||||
#submenu_Chat
|
||||
{
|
||||
left: 526px;
|
||||
bottom: 55px;
|
||||
left: 490px;
|
||||
bottom: 59px;
|
||||
margin: 0 0 0 1px;
|
||||
position: absolute;
|
||||
width: 220px;
|
||||
|
@ -473,8 +473,8 @@ ul.songlist li.selected
|
|||
}
|
||||
#submenu_NowPlaying
|
||||
{
|
||||
left: 641px;
|
||||
bottom: 55px;
|
||||
left: 605px;
|
||||
bottom: 59px;
|
||||
margin: 0 0 0 1px;
|
||||
position: absolute;
|
||||
width: 220px;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue