.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/13/2011 .012 added Current Playlist, fixed some bugs
|
||||||
10/14/2011 .013 moved auto playlists, album display tweaks
|
10/14/2011 .013 moved auto playlists, album display tweaks
|
||||||
10/14/2011 .014 multiple api call issue fix
|
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...)
|
TO DO: (In no particular order...)
|
||||||
- Jukebox Control
|
- Jukebox Control
|
||||||
|
|
17
index.html
17
index.html
|
@ -418,6 +418,23 @@
|
||||||
var next = $('#CurrentPlaylistContainer li.playing').next();
|
var next = $('#CurrentPlaylistContainer li.playing').next();
|
||||||
changeTrack(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() {
|
useFlash: (function() {
|
||||||
var a = document.createElement('audio'),
|
var a = document.createElement('audio'),
|
||||||
userAgent = navigator.userAgent.toLowerCase(),
|
userAgent = navigator.userAgent.toLowerCase(),
|
||||||
|
|
25
js/app.js
25
js/app.js
|
@ -188,6 +188,7 @@ function refreshRowColor() {
|
||||||
$(this).addClass(rowcolor);
|
$(this).addClass(rowcolor);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
var scrobbled = false;
|
||||||
function playSong(el, songid, albumid) {
|
function playSong(el, songid, albumid) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: baseURL + '/getMusicDirectory.view?v=1.6.0&c=subweb&f=json&id=' + albumid,
|
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');
|
$(el).addClass('playing');
|
||||||
$('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png');
|
$('#PlayTrack').find('img').attr('src', 'images/pause_24x32.png');
|
||||||
$('#PlayTrack').addClass('playing');
|
$('#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;
|
var track;
|
||||||
if (child.track === undefined) { track = " "; } else { track = child.track; }
|
if (child.track === undefined) { track = " "; } else { track = child.track; }
|
||||||
albumhtml = '<li class=\"song ' + rowcolor + '\" childid=\"' + child.id + '\" parentid=\"' + child.parent + '\">';
|
var time = secondsToTime(child.duration);
|
||||||
albumhtml += '<span class=\"track\">' + track + '</span> ';
|
albumhtml = generateSongHTML(rowcolor, child.id, child.parent, track, child.title, child.album, time['m'], time['s']);
|
||||||
albumhtml += child.title;
|
|
||||||
albumhtml += '</li>';
|
|
||||||
$(albumhtml).appendTo("#AlbumContainer");
|
$(albumhtml).appendTo("#AlbumContainer");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -441,8 +441,8 @@ ul.songlist li.selected
|
||||||
}
|
}
|
||||||
#submenu_Chat
|
#submenu_Chat
|
||||||
{
|
{
|
||||||
left: 526px;
|
left: 490px;
|
||||||
bottom: 55px;
|
bottom: 59px;
|
||||||
margin: 0 0 0 1px;
|
margin: 0 0 0 1px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 220px;
|
width: 220px;
|
||||||
|
@ -473,8 +473,8 @@ ul.songlist li.selected
|
||||||
}
|
}
|
||||||
#submenu_NowPlaying
|
#submenu_NowPlaying
|
||||||
{
|
{
|
||||||
left: 641px;
|
left: 605px;
|
||||||
bottom: 55px;
|
bottom: 59px;
|
||||||
margin: 0 0 0 1px;
|
margin: 0 0 0 1px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 220px;
|
width: 220px;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue