mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 11:50:37 +02:00
Merge branch 'master' into databasegenerator
This commit is contained in:
@@ -31,19 +31,19 @@ Tomahawk.resolver = {
|
|||||||
|
|
||||||
Tomahawk.timestamp = function() {
|
Tomahawk.timestamp = function() {
|
||||||
return Math.round( new Date()/1000 );
|
return Math.round( new Date()/1000 );
|
||||||
}
|
};
|
||||||
|
|
||||||
Tomahawk.dumpResult = function( result ) {
|
Tomahawk.dumpResult = function( result ) {
|
||||||
var results = result.results;
|
var results = result.results;
|
||||||
Tomahawk.log("Dumping " + results.length + " results for query " + result.qid + "...");
|
Tomahawk.log("Dumping " + results.length + " results for query " + result.qid + "...");
|
||||||
for(var i=0; i<results.length;i++)
|
for(var i=0; i<results.length;i++)
|
||||||
{
|
{
|
||||||
var result = results[i];
|
var result1 = results[i];
|
||||||
Tomahawk.log( result.artist + " - " + result.track + " | " + result.url );
|
Tomahawk.log( result1.artist + " - " + result1.track + " | " + result1.url );
|
||||||
}
|
}
|
||||||
|
|
||||||
Tomahawk.log("Done.");
|
Tomahawk.log("Done.");
|
||||||
}
|
};
|
||||||
|
|
||||||
// javascript part of Tomahawk-Object API
|
// javascript part of Tomahawk-Object API
|
||||||
Tomahawk.extend = function(object, members) {
|
Tomahawk.extend = function(object, members) {
|
||||||
@@ -57,7 +57,7 @@ Tomahawk.extend = function(object, members) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return newObject;
|
return newObject;
|
||||||
}
|
};
|
||||||
|
|
||||||
|
|
||||||
// Resolver BaseObject, inherit it to implement your own resolver
|
// Resolver BaseObject, inherit it to implement your own resolver
|
||||||
@@ -77,7 +77,9 @@ var TomahawkResolver = {
|
|||||||
{
|
{
|
||||||
var configJson = window.localStorage[ this.scriptPath() ];
|
var configJson = window.localStorage[ this.scriptPath() ];
|
||||||
if( configJson === undefined )
|
if( configJson === undefined )
|
||||||
|
{
|
||||||
configJson = "{}";
|
configJson = "{}";
|
||||||
|
}
|
||||||
|
|
||||||
var config = JSON.parse( configJson );
|
var config = JSON.parse( configJson );
|
||||||
|
|
||||||
@@ -153,11 +155,15 @@ var TomahawkResolver = {
|
|||||||
Tomahawk.valueForSubNode = function(node, tag)
|
Tomahawk.valueForSubNode = function(node, tag)
|
||||||
{
|
{
|
||||||
if(node === undefined)
|
if(node === undefined)
|
||||||
|
{
|
||||||
throw new Error("Tomahawk.valueForSubnode: node is undefined!");
|
throw new Error("Tomahawk.valueForSubnode: node is undefined!");
|
||||||
|
}
|
||||||
|
|
||||||
var element = node.getElementsByTagName(tag)[0];
|
var element = node.getElementsByTagName(tag)[0];
|
||||||
if( element === undefined )
|
if( element === undefined )
|
||||||
|
{
|
||||||
return undefined;
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
return element.textContent;
|
return element.textContent;
|
||||||
};
|
};
|
||||||
@@ -165,11 +171,13 @@ Tomahawk.valueForSubNode = function(node, tag)
|
|||||||
|
|
||||||
Tomahawk.syncRequest = function(url)
|
Tomahawk.syncRequest = function(url)
|
||||||
{
|
{
|
||||||
var xmlHttpRequest = new XMLHttpRequest();
|
var xmlHttpRequest = new XMLHttpRequest();
|
||||||
xmlHttpRequest.open('GET', url, false);
|
xmlHttpRequest.open('GET', url, false);
|
||||||
xmlHttpRequest.send(null);
|
xmlHttpRequest.send(null);
|
||||||
return xmlHttpRequest.responseText;
|
if (xmlHttpRequest.status == 200){
|
||||||
}
|
return xmlHttpRequest.responseText;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -210,7 +218,7 @@ Tomahawk.sha256=function(s){
|
|||||||
m[l >> 5] |= 0x80 << (24 - l % 32);
|
m[l >> 5] |= 0x80 << (24 - l % 32);
|
||||||
m[((l + 64 >> 9) << 4) + 15] = l;
|
m[((l + 64 >> 9) << 4) + 15] = l;
|
||||||
|
|
||||||
for ( var i = 0; i<m.length; i+=16 ) {
|
for ( i = 0; i<m.length; i+=16 ) {
|
||||||
a = HASH[0];
|
a = HASH[0];
|
||||||
b = HASH[1];
|
b = HASH[1];
|
||||||
c = HASH[2];
|
c = HASH[2];
|
||||||
@@ -220,9 +228,15 @@ Tomahawk.sha256=function(s){
|
|||||||
g = HASH[6];
|
g = HASH[6];
|
||||||
h = HASH[7];
|
h = HASH[7];
|
||||||
|
|
||||||
for ( var j = 0; j<64; j++) {
|
for ( j = 0; j<64; j++) {
|
||||||
if (j < 16) W[j] = m[j + i];
|
if (j < 16)
|
||||||
else W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
|
{
|
||||||
|
W[j] = m[j + i];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
W[j] = safe_add(safe_add(safe_add(Gamma1256(W[j - 2]), W[j - 7]), Gamma0256(W[j - 15])), W[j - 16]);
|
||||||
|
}
|
||||||
|
|
||||||
T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
|
T1 = safe_add(safe_add(safe_add(safe_add(h, Sigma1256(e)), Ch(e, f, g)), K[j]), W[j]);
|
||||||
T2 = safe_add(Sigma0256(a), Maj(a, b, c));
|
T2 = safe_add(Sigma0256(a), Maj(a, b, c));
|
||||||
@@ -297,4 +311,4 @@ Tomahawk.sha256=function(s){
|
|||||||
s = Utf8Encode(s);
|
s = Utf8Encode(s);
|
||||||
return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
|
return binb2hex(core_sha256(str2binb(s), s.length * chrsz));
|
||||||
|
|
||||||
}
|
};
|
@@ -31,7 +31,7 @@ set( libSources
|
|||||||
viewpage.cpp
|
viewpage.cpp
|
||||||
viewmanager.cpp
|
viewmanager.cpp
|
||||||
globalactionmanager.cpp
|
globalactionmanager.cpp
|
||||||
contextMenu.cpp
|
contextmenu.cpp
|
||||||
|
|
||||||
sip/SipPlugin.cpp
|
sip/SipPlugin.cpp
|
||||||
sip/SipHandler.cpp
|
sip/SipHandler.cpp
|
||||||
@@ -204,7 +204,7 @@ set( libHeaders
|
|||||||
sourceplaylistinterface.h
|
sourceplaylistinterface.h
|
||||||
viewmanager.h
|
viewmanager.h
|
||||||
globalactionmanager.h
|
globalactionmanager.h
|
||||||
contextMenu.h
|
contextmenu.h
|
||||||
|
|
||||||
artist.h
|
artist.h
|
||||||
album.h
|
album.h
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
* along with Tomahawk. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "contextMenu.h"
|
#include "contextmenu.h"
|
||||||
|
|
||||||
#include "globalactionmanager.h"
|
#include "globalactionmanager.h"
|
||||||
#include "playlistview.h"
|
#include "playlistview.h"
|
@@ -23,7 +23,8 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
|
|
||||||
#include "typedefs.h"
|
#include "typedefs.h"
|
||||||
|
#include "album.h"
|
||||||
|
#include "artist.h"
|
||||||
#include "dllmacro.h"
|
#include "dllmacro.h"
|
||||||
|
|
||||||
namespace Tomahawk
|
namespace Tomahawk
|
@@ -210,7 +210,7 @@ Pipeline::reportResults( QID qid, const QList< result_ptr >& results )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new FuncTimeout( 50, boost::bind( &Pipeline::timeoutShunt, this, q ), this );
|
new FuncTimeout( 100, boost::bind( &Pipeline::timeoutShunt, this, q ), this );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -247,7 +247,7 @@ Pipeline::shuntNext()
|
|||||||
}
|
}
|
||||||
|
|
||||||
setQIDState( q, rc );
|
setQIDState( q, rc );
|
||||||
new FuncTimeout( 50, boost::bind( &Pipeline::shunt, this, q ), this );
|
new FuncTimeout( 100, boost::bind( &Pipeline::shunt, this, q ), this );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
#include "contextMenu.h"
|
#include "contextmenu.h"
|
||||||
#include "treemodel.h"
|
#include "treemodel.h"
|
||||||
#include "treeproxymodel.h"
|
#include "treeproxymodel.h"
|
||||||
#include "viewpage.h"
|
#include "viewpage.h"
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
#include <QSortFilterProxyModel>
|
#include <QSortFilterProxyModel>
|
||||||
|
|
||||||
#include "contextMenu.h"
|
#include "contextmenu.h"
|
||||||
#include "playlistitemdelegate.h"
|
#include "playlistitemdelegate.h"
|
||||||
#include "album.h"
|
#include "album.h"
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user