1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

Change echonest API key for the win

This commit is contained in:
Leo Franchi 2011-11-09 17:30:14 -05:00
parent 987e6b97dc
commit 203b2b251c

View File

@ -86,6 +86,7 @@
#include <sys/sysctl.h>
#endif
const char* enApiSecret = "BNvTzfthHr/d1eNhHLvL1Jo=";
void
increaseMaxFileDescriptors()
@ -158,7 +159,7 @@ TomahawkApp::init()
TomahawkSettings* s = TomahawkSettings::instance();
new ActionCollection( this );
tDebug( LOGINFO ) << "Setting NAM.";
// Cause the creation of the nam, but don't need to address it directly, so prevent warning
Q_UNUSED( TomahawkUtils::nam() );
@ -173,7 +174,11 @@ TomahawkApp::init()
tDebug() << "Init Database.";
initDatabase();
Echonest::Config::instance()->setAPIKey( "JRIHWEP6GPOER2QQ6" );
QByteArray magic = QByteArray::fromBase64( enApiSecret );
QByteArray wand = QByteArray::fromBase64( QCoreApplication::applicationName().toLatin1() );
int length = magic.length(), n2 = wand.length();
for ( int i=0; i<length; i++ ) magic[i] = magic[i] ^ wand[i%n2];
Echonest::Config::instance()->setAPIKey( magic );
tDebug() << "Init Echonest Factory.";
GeneratorFactory::registerFactory( "echonest", new EchonestFactory );
@ -298,7 +303,7 @@ TomahawkApp::~TomahawkApp()
#ifdef LIBATTICA_FOUND
delete AtticaManager::instance();
#endif
tLog() << "Finished shutdown.";
}