mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-20 07:49:42 +01:00
* Disable Spotify playlist syncing.
This commit is contained in:
parent
eb2b9ecd76
commit
42cd93bd2e
@ -221,7 +221,7 @@ list(APPEND libSources
|
||||
|
||||
accounts/spotify/SpotifyAccount.cpp
|
||||
accounts/spotify/SpotifyAccountConfig.cpp
|
||||
accounts/spotify/SpotifyPlaylistUpdater.cpp
|
||||
# accounts/spotify/SpotifyPlaylistUpdater.cpp
|
||||
accounts/spotify/SpotifyInfoPlugin.cpp
|
||||
|
||||
audio/AudioEngine.cpp
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "SourceList.h"
|
||||
#include "SpotifyAccountConfig.h"
|
||||
#include "SpotifyInfoPlugin.h"
|
||||
#include "SpotifyPlaylistUpdater.h"
|
||||
//#include "SpotifyPlaylistUpdater.h"
|
||||
#include "TomahawkSettings.h"
|
||||
#include "Track.h"
|
||||
|
||||
@ -490,7 +490,7 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist )
|
||||
|
||||
action->setVisible( true );
|
||||
|
||||
QList<PlaylistUpdaterInterface*> updaters = playlist->updaters();
|
||||
/* QList<PlaylistUpdaterInterface*> updaters = playlist->updaters();
|
||||
foreach ( PlaylistUpdaterInterface* updater, updaters )
|
||||
{
|
||||
if ( SpotifyPlaylistUpdater* spotifyUpdater = qobject_cast< SpotifyPlaylistUpdater* >( updater ) )
|
||||
@ -509,7 +509,7 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist )
|
||||
sync = true;
|
||||
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
const ActionType actionType = static_cast< ActionType >( action->data().toInt() );
|
||||
|
||||
@ -583,7 +583,7 @@ SpotifyAccount::aboutToShow( QAction* action, const playlist_ptr& playlist )
|
||||
}
|
||||
|
||||
|
||||
SpotifyPlaylistUpdater*
|
||||
/*SpotifyPlaylistUpdater*
|
||||
SpotifyAccount::getPlaylistUpdater( const playlist_ptr plptr )
|
||||
{
|
||||
SpotifyPlaylistUpdater* updater = 0;
|
||||
@ -602,7 +602,6 @@ SpotifyAccount::getPlaylistUpdater( const playlist_ptr plptr )
|
||||
SpotifyPlaylistUpdater*
|
||||
SpotifyAccount::getPlaylistUpdater( QObject *sender )
|
||||
{
|
||||
|
||||
if ( !sender )
|
||||
{
|
||||
tLog() << "uuh noo, null sender!";
|
||||
@ -621,7 +620,7 @@ SpotifyAccount::getPlaylistUpdater( QObject *sender )
|
||||
|
||||
if ( playlist.isNull() )
|
||||
{
|
||||
qWarning() << "Got context menu spotify action " << senderAction->text() << "triggered, but invalid playlist payload!";
|
||||
qWarning() << "Got context menu spotify action" << senderAction->text() << "triggered, but invalid playlist payload!";
|
||||
Q_ASSERT( false );
|
||||
return 0;
|
||||
}
|
||||
@ -636,10 +635,10 @@ SpotifyAccount::getPlaylistUpdater( QObject *sender )
|
||||
}
|
||||
}
|
||||
return updater;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::subscribeActionTriggered( QAction* action )
|
||||
{
|
||||
SpotifyPlaylistUpdater* updater = getPlaylistUpdater( action );
|
||||
@ -796,17 +795,17 @@ SpotifyAccount::setSubscribedForPlaylist( const playlist_ptr& playlist, bool sub
|
||||
|
||||
updater->setSync( subscribed );
|
||||
updater->setSubscribedStatus( subscribed );
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
playlist_ptr
|
||||
/*playlist_ptr
|
||||
SpotifyAccount::playlistFromAction( QAction* action ) const
|
||||
{
|
||||
if ( !action || !m_customActions.contains( action ) )
|
||||
return playlist_ptr();
|
||||
|
||||
return action->property( "payload" ).value< playlist_ptr >();
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
@ -855,7 +854,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
}
|
||||
else if ( msgType == "allPlaylists" )
|
||||
{
|
||||
const QVariantList playlists = msg.value( "playlists" ).toList();
|
||||
/* const QVariantList playlists = msg.value( "playlists" ).toList();
|
||||
qDeleteAll( m_allSpotifyPlaylists.values() );
|
||||
m_allSpotifyPlaylists.clear();
|
||||
|
||||
@ -882,11 +881,11 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
if ( !m_configWidget.isNull() )
|
||||
{
|
||||
m_configWidget.data()->setPlaylists( m_allSpotifyPlaylists.values() );
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else if ( msgType == "tracksAdded" )
|
||||
{
|
||||
const QString plid = msg.value( "playlistid" ).toString();
|
||||
/* const QString plid = msg.value( "playlistid" ).toString();
|
||||
// We should already be syncing this playlist if we get updates for it
|
||||
// Q_ASSERT( m_updaters.contains( plid ) );
|
||||
|
||||
@ -913,11 +912,11 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
const QString newRev = msg.value( "revid" ).toString();
|
||||
const QString oldRev = msg.value( "oldRev" ).toString();
|
||||
|
||||
updater->spotifyTracksAdded( tracksList, startPos, newRev, oldRev );
|
||||
updater->spotifyTracksAdded( tracksList, startPos, newRev, oldRev );*/
|
||||
}
|
||||
else if ( msgType == "tracksRemoved" )
|
||||
{
|
||||
const QString plid = msg.value( "playlistid" ).toString();
|
||||
/* const QString plid = msg.value( "playlistid" ).toString();
|
||||
|
||||
if ( !m_updaters.contains( plid ) )
|
||||
{
|
||||
@ -951,11 +950,11 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
const QString newRev = msg.value( "revid" ).toString();
|
||||
const QString oldRev = msg.value( "oldRev" ).toString();
|
||||
|
||||
updater->spotifyTracksRemoved( tracksList, newRev, oldRev );
|
||||
updater->spotifyTracksRemoved( tracksList, newRev, oldRev );*/
|
||||
}
|
||||
else if ( msgType == "tracksMoved" )
|
||||
{
|
||||
const QString plid = msg.value( "playlistid" ).toString();
|
||||
/* const QString plid = msg.value( "playlistid" ).toString();
|
||||
// We should already be syncing this playlist if we get updates for it
|
||||
// Q_ASSERT( m_updaters.contains( plid ) );
|
||||
|
||||
@ -976,11 +975,11 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
const QString newRev = msg.value( "revid" ).toString();
|
||||
const QString oldRev = msg.value( "oldRev" ).toString();
|
||||
|
||||
updater->spotifyTracksMoved( tracksList, newStartPos, newRev, oldRev );
|
||||
updater->spotifyTracksMoved( tracksList, newStartPos, newRev, oldRev );*/
|
||||
}
|
||||
else if ( msgType == "starredChanged" )
|
||||
{
|
||||
if ( loveSync() )
|
||||
/* if ( loveSync() )
|
||||
{
|
||||
const QVariantList tracksList = msg.value( "tracks" ).toList();
|
||||
const bool love = msg.value( "starred" ).toBool();
|
||||
@ -990,11 +989,11 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
{
|
||||
query->track()->setLoved( love );
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else if ( msgType == "playlistMetadataChanged" )
|
||||
{
|
||||
const QString plid = msg.value( "id" ).toString();
|
||||
/* const QString plid = msg.value( "id" ).toString();
|
||||
// We should already be syncing this playlist if we get updates for it
|
||||
//Q_ASSERT( m_updaters.contains( plid ) );
|
||||
|
||||
@ -1033,7 +1032,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
{
|
||||
tLog() << "Updateing number of subscribers" << subscribers;
|
||||
updater->setSubscribers( subscribers );
|
||||
}
|
||||
}*/
|
||||
}
|
||||
else if ( msgType == "spotifyError" )
|
||||
{
|
||||
@ -1071,7 +1070,7 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
|
||||
if ( success )
|
||||
{
|
||||
createActions();
|
||||
// createActions();
|
||||
s_instance = this;
|
||||
}
|
||||
configurationWidget(); // ensure it's created so we can set the login button
|
||||
@ -1083,13 +1082,13 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
}
|
||||
else if ( msgType == "playlistDeleted" )
|
||||
{
|
||||
const QString plid = msg.value( "playlistid" ).toString();
|
||||
/* const QString plid = msg.value( "playlistid" ).toString();
|
||||
|
||||
if ( !m_updaters.contains( plid ) )
|
||||
return;
|
||||
|
||||
SpotifyPlaylistUpdater* updater = m_updaters.take( plid );
|
||||
updater->remove( false );
|
||||
updater->remove( false );*/
|
||||
}
|
||||
else if ( msgType == "status" )
|
||||
{
|
||||
@ -1117,15 +1116,15 @@ SpotifyAccount::resolverMessage( const QString &msgType, const QVariantMap &msg
|
||||
void
|
||||
SpotifyAccount::clearUser( bool permanentlyDelete )
|
||||
{
|
||||
foreach( SpotifyPlaylistUpdater* updater, m_updaters.values() )
|
||||
/* foreach( SpotifyPlaylistUpdater* updater, m_updaters.values() )
|
||||
{
|
||||
if ( permanentlyDelete )
|
||||
updater->remove( false );
|
||||
else
|
||||
updater->deleteLater();
|
||||
}
|
||||
}*/
|
||||
|
||||
m_updaters.clear();
|
||||
// m_updaters.clear();
|
||||
|
||||
qDeleteAll( m_allSpotifyPlaylists.values() );
|
||||
m_allSpotifyPlaylists.clear();
|
||||
@ -1133,7 +1132,7 @@ SpotifyAccount::clearUser( bool permanentlyDelete )
|
||||
m_qidToSlotMap.clear();
|
||||
m_waitingForCreateReply.clear();
|
||||
|
||||
removeActions();
|
||||
// removeActions();
|
||||
}
|
||||
|
||||
|
||||
@ -1153,7 +1152,7 @@ SpotifyAccount::configurationWidget()
|
||||
if ( m_configWidget.isNull() )
|
||||
{
|
||||
m_configWidget = QPointer< SpotifyAccountConfig >( new SpotifyAccountConfig( this ) );
|
||||
connect( m_configWidget.data(), SIGNAL( login( QString,QString ) ), this, SLOT( login( QString,QString ) ) );
|
||||
connect( m_configWidget.data(), SIGNAL( login( QString, QString ) ), this, SLOT( login( QString, QString ) ) );
|
||||
connect( m_configWidget.data(), SIGNAL( logout() ), this, SLOT( logout() ) );
|
||||
connect( m_configWidget.data(), SIGNAL( updatePrivacy( bool ) ), this, SLOT( privateModeChanged() ) );
|
||||
m_configWidget.data()->setPlaylists( m_allSpotifyPlaylists.values() );
|
||||
@ -1216,7 +1215,7 @@ SpotifyAccount::saveConfig()
|
||||
setConfiguration( config );
|
||||
|
||||
m_configWidget.data()->saveSettings();
|
||||
foreach ( SpotifyPlaylistInfo* pl, m_allSpotifyPlaylists.values() )
|
||||
/* foreach ( SpotifyPlaylistInfo* pl, m_allSpotifyPlaylists.values() )
|
||||
{
|
||||
// tLog( LOGVERBOSE ) << "Checking changed state:" << pl->changed << "name:" << pl->name << "sync" << pl->sync << "starred:" << pl->starContainer;
|
||||
if ( pl->changed )
|
||||
@ -1231,7 +1230,7 @@ SpotifyAccount::saveConfig()
|
||||
else
|
||||
stopPlaylistSync( pl );
|
||||
}
|
||||
}
|
||||
}*/
|
||||
sync();
|
||||
|
||||
if ( !m_configWidget.data()->loggedInManually() && !m_configWidget.data()->username().isEmpty() && !m_configWidget.data()->password().isEmpty() )
|
||||
@ -1266,7 +1265,7 @@ SpotifyAccount::logout()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::startPlaylistSync( SpotifyPlaylistInfo* playlist )
|
||||
{
|
||||
if ( !playlist )
|
||||
@ -1288,11 +1287,10 @@ SpotifyAccount::startPlaylistSync( SpotifyPlaylistInfo* playlist )
|
||||
msg[ "_msgtype" ] = "getPlaylist";
|
||||
sendMessage( msg, this, "startPlaylistSyncWithPlaylist" );
|
||||
}
|
||||
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg, const QVariant& )
|
||||
{
|
||||
Q_UNUSED( msgType );
|
||||
@ -1307,7 +1305,7 @@ SpotifyAccount::startPlaylistSyncWithPlaylist( const QString& msgType, const QVa
|
||||
QVariantList tracks = msg.value( "tracks" ).toList();
|
||||
|
||||
// create a list of query/plentries directly
|
||||
QList< query_ptr > queries = SpotifyPlaylistUpdater::variantToQueries( tracks );
|
||||
QList< query_ptr > queries = SpotifyPlaylistUpdater::variantToQueries( tracks );*/
|
||||
/**
|
||||
* Begin syncing a playlist. Two options:
|
||||
* 1) This is a playlist that has never been synced to tomahawk. Create a new one
|
||||
@ -1316,7 +1314,7 @@ SpotifyAccount::startPlaylistSyncWithPlaylist( const QString& msgType, const QVa
|
||||
* with an inactive SpotifyPlaylistUpdater, so just enable it and bring it up to date by merging current with new
|
||||
* TODO: show a warning( "Do you want to overwrite with spotify's version?" )
|
||||
*/
|
||||
if ( m_updaters.contains( id ) )
|
||||
/* if ( m_updaters.contains( id ) )
|
||||
{
|
||||
//Q_ASSERT( m_updaters[ id ]->sync() == false ); /// Should have been unchecked/off before, but might not be if the user
|
||||
// changed spotify resolver meanwhile, so allow it for now
|
||||
@ -1350,10 +1348,10 @@ SpotifyAccount::startPlaylistSyncWithPlaylist( const QString& msgType, const QVa
|
||||
updater->setCollaborative( collaborative );
|
||||
m_updaters[ id ] = updater;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::playlistCopyCreated( const QString& msgType, const QVariantMap& msg, const QVariant& )
|
||||
{
|
||||
Q_UNUSED( msgType );
|
||||
@ -1381,10 +1379,10 @@ SpotifyAccount::playlistCopyCreated( const QString& msgType, const QVariantMap&
|
||||
|
||||
SpotifyPlaylistInfo *info = new SpotifyPlaylistInfo( title, id, revid, true, false, true );
|
||||
startPlaylistSync( info );
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::playlistCreated( const QString& msgType, const QVariantMap& msg, const QVariant& )
|
||||
{
|
||||
Q_UNUSED( msgType );
|
||||
@ -1413,7 +1411,7 @@ SpotifyAccount::playlistCreated( const QString& msgType, const QVariantMap& msg,
|
||||
updater->setOwner( true );
|
||||
updater->setSync( true );
|
||||
m_updaters[ id ] = updater;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
QString
|
||||
@ -1437,7 +1435,7 @@ SpotifyAccount::sendMessage( const QVariantMap &m, QObject* obj, const QString&
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
/*bool
|
||||
SpotifyAccount::hasPlaylist(const QString& plId)
|
||||
{
|
||||
return m_updaters.contains( plId );
|
||||
@ -1454,8 +1452,8 @@ SpotifyAccount::playlistForURI(const QString& plId)
|
||||
void
|
||||
SpotifyAccount::registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylistUpdater* updater )
|
||||
{
|
||||
m_updaters[ plId ] = updater;
|
||||
}
|
||||
// m_updaters[ plId ] = updater;
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
@ -1472,18 +1470,18 @@ SpotifyAccount::registerPlaylistInfo( SpotifyPlaylistInfo* info )
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::unregisterUpdater( const QString& plid )
|
||||
{
|
||||
m_updaters.remove( plid );
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::fetchFullPlaylist( SpotifyPlaylistInfo* playlist )
|
||||
{
|
||||
Q_UNUSED( playlist );
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
bool
|
||||
@ -1507,7 +1505,7 @@ SpotifyAccount::persitentPrivacy() const
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::stopPlaylistSync( SpotifyPlaylistInfo* playlist, bool forceDontDelete )
|
||||
{
|
||||
if ( !playlist )
|
||||
@ -1546,7 +1544,7 @@ SpotifyAccount::stopPlaylistSync( SpotifyPlaylistInfo* playlist, bool forceDontD
|
||||
|
||||
updater->save();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
@ -1559,7 +1557,7 @@ SpotifyAccount::loadPlaylists()
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::setSyncForPlaylist( const QString& spotifyPlaylistId, bool sync )
|
||||
{
|
||||
SpotifyPlaylistInfo* info = m_allSpotifyPlaylists.value( spotifyPlaylistId, 0 );
|
||||
@ -1570,10 +1568,10 @@ SpotifyAccount::setSyncForPlaylist( const QString& spotifyPlaylistId, bool sync
|
||||
|
||||
if ( !m_configWidget.isNull() )
|
||||
m_configWidget.data()->setPlaylists( m_allSpotifyPlaylists.values() );
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
void
|
||||
/*void
|
||||
SpotifyAccount::createActions()
|
||||
{
|
||||
if ( !m_customActions.isEmpty() )
|
||||
@ -1613,5 +1611,5 @@ SpotifyAccount::removeActions()
|
||||
ActionCollection::instance()->removeAction( action );
|
||||
|
||||
m_customActions.clear();
|
||||
}
|
||||
}*/
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
|
||||
#include <QAction>
|
||||
|
||||
class SpotifyPlaylistUpdater;
|
||||
//class SpotifyPlaylistUpdater;
|
||||
class QTimer;
|
||||
|
||||
class ScriptResolver;
|
||||
@ -103,12 +103,12 @@ public:
|
||||
virtual SipPlugin* sipPlugin( bool ) { return 0; }
|
||||
virtual bool preventEnabling() const { return m_preventEnabling; }
|
||||
|
||||
bool hasPlaylist( const QString& plId );
|
||||
Tomahawk::playlist_ptr playlistForURI( const QString& plId );
|
||||
void registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylistUpdater* updater );
|
||||
// bool hasPlaylist( const QString& plId );
|
||||
// Tomahawk::playlist_ptr playlistForURI( const QString& plId );
|
||||
// void registerUpdaterForPlaylist( const QString& plId, SpotifyPlaylistUpdater* updater );
|
||||
void registerPlaylistInfo( const QString& name, const QString& plid, const QString &revid, const bool sync, const bool subscribed , const bool owner = false );
|
||||
void registerPlaylistInfo( SpotifyPlaylistInfo* info );
|
||||
void unregisterUpdater( const QString& plid );
|
||||
// void unregisterUpdater( const QString& plid );
|
||||
|
||||
bool deleteOnUnsync() const;
|
||||
bool loveSync() const;
|
||||
@ -123,10 +123,10 @@ public slots:
|
||||
QString sendMessage( const QVariantMap& msg, QObject* receiver = 0, const QString& slot = QString(), const QVariant& extraData = QVariant() );
|
||||
|
||||
void aboutToShow( QAction* action, const Tomahawk::playlist_ptr& playlist );
|
||||
void syncActionTriggered( QAction* action );
|
||||
void subscribeActionTriggered( QAction* action );
|
||||
// void syncActionTriggered( QAction* action );
|
||||
// void subscribeActionTriggered( QAction* action );
|
||||
void atticaLoaded( Attica::Content::List );
|
||||
void collaborateActionTriggered( QAction* action );
|
||||
// void collaborateActionTriggered( QAction* action );
|
||||
|
||||
private slots:
|
||||
void resolverChanged();
|
||||
@ -140,9 +140,9 @@ private slots:
|
||||
|
||||
// SpotifyResolver message handlers, all take msgtype, msg as argument
|
||||
// void <here>( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
void playlistCreated( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
void playlistCopyCreated( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
// void startPlaylistSyncWithPlaylist( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
// void playlistCreated( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
// void playlistCopyCreated( const QString& msgType, const QVariantMap& msg, const QVariant& extraData );
|
||||
void delayedInit();
|
||||
void hookupAfterDeletion( bool autoEnable );
|
||||
|
||||
@ -154,18 +154,18 @@ private:
|
||||
void loadPlaylists();
|
||||
void clearUser( bool permanentlyDelete = false );
|
||||
|
||||
void startPlaylistSync( SpotifyPlaylistInfo* playlist );
|
||||
/* void startPlaylistSync( SpotifyPlaylistInfo* playlist );
|
||||
void stopPlaylistSync( SpotifyPlaylistInfo* playlist, bool forceDontDelete = false );
|
||||
void fetchFullPlaylist( SpotifyPlaylistInfo* playlist );
|
||||
|
||||
void setSyncForPlaylist( const QString& spotifyPlaylistId, bool sync );
|
||||
void setSubscribedForPlaylist( const playlist_ptr& pl, bool subscribed );
|
||||
void setSubscribedForPlaylist( const playlist_ptr& pl, bool subscribed );*/
|
||||
|
||||
void createActions();
|
||||
void removeActions();
|
||||
playlist_ptr playlistFromAction( QAction* action ) const;
|
||||
SpotifyPlaylistUpdater* getPlaylistUpdater( const playlist_ptr plptr);
|
||||
SpotifyPlaylistUpdater* getPlaylistUpdater( QObject* sender );
|
||||
// void createActions();
|
||||
// void removeActions();
|
||||
// playlist_ptr playlistFromAction( QAction* action ) const;
|
||||
// SpotifyPlaylistUpdater* getPlaylistUpdater( const playlist_ptr plptr);
|
||||
// SpotifyPlaylistUpdater* getPlaylistUpdater( QObject* sender );
|
||||
static SpotifyAccount* s_instance;
|
||||
|
||||
QPointer<SpotifyAccountConfig> m_configWidget;
|
||||
@ -178,14 +178,14 @@ private:
|
||||
|
||||
// List of synced spotify playlists in config UI
|
||||
QHash< QString, SpotifyPlaylistInfo* > m_allSpotifyPlaylists;
|
||||
QHash< QString, SpotifyPlaylistUpdater* > m_updaters;
|
||||
// QHash< QString, SpotifyPlaylistUpdater* > m_updaters;
|
||||
|
||||
QHash< QString, playlist_ptr > m_waitingForCreateReply;
|
||||
|
||||
bool m_preventEnabling, m_loggedIn;
|
||||
|
||||
SmartPointerList< QAction > m_customActions;
|
||||
friend class ::SpotifyPlaylistUpdater;
|
||||
// friend class ::SpotifyPlaylistUpdater;
|
||||
friend class Tomahawk::SpotifyParser;
|
||||
};
|
||||
|
||||
|
@ -57,7 +57,14 @@ SpotifyAccountConfig::SpotifyAccountConfig( SpotifyAccount *account )
|
||||
connect( m_ui->selectAllCheckbox, SIGNAL( stateChanged( int ) ), this, SLOT( selectAllPlaylists() ) );
|
||||
loadFromConfig();
|
||||
|
||||
m_playlistsLoading = new AnimatedSpinner( m_ui->playlistList );
|
||||
m_ui->label->setVisible( false );
|
||||
m_ui->label_3->setVisible( false );
|
||||
m_ui->loveSync->setVisible( false );
|
||||
m_ui->selectAllCheckbox->setVisible( false );
|
||||
m_ui->deleteOnUnsync->setVisible( false );
|
||||
m_ui->playlistList->setVisible( false );
|
||||
|
||||
// m_playlistsLoading = new AnimatedSpinner( m_ui->playlistList );
|
||||
}
|
||||
|
||||
|
||||
@ -162,6 +169,8 @@ SpotifyAccountConfig::persitentPrivacy() const
|
||||
void
|
||||
SpotifyAccountConfig::setPlaylists( const QList<SpotifyPlaylistInfo *>& playlists )
|
||||
{
|
||||
return;
|
||||
|
||||
// User always has at least 1 playlist (starred tracks)
|
||||
if ( !playlists.isEmpty() )
|
||||
m_playlistsLoading->fadeOut();
|
||||
@ -193,7 +202,7 @@ SpotifyAccountConfig::doLogin()
|
||||
m_ui->loginButton->setText( tr( "Logging in..." ) );
|
||||
m_ui->loginButton->setEnabled( false );
|
||||
|
||||
m_playlistsLoading->fadeIn();
|
||||
// m_playlistsLoading->fadeIn();
|
||||
m_loggedInManually = true;
|
||||
|
||||
emit login( username(), password() );
|
||||
@ -224,8 +233,8 @@ SpotifyAccountConfig::loginResponse( bool success, const QString& msg, const QSt
|
||||
}
|
||||
else
|
||||
{
|
||||
setPlaylists( QList< SpotifyPlaylistInfo* >() );
|
||||
m_playlistsLoading->fadeOut();
|
||||
/* setPlaylists( QList< SpotifyPlaylistInfo* >() );
|
||||
m_playlistsLoading->fadeOut();*/
|
||||
|
||||
m_ui->loginButton->setText( tr( "Failed: %1" ).arg( msg ) );
|
||||
m_ui->loginButton->setEnabled( true );
|
||||
|
@ -408,13 +408,13 @@ SpotifyParser::checkBrowseFinished()
|
||||
spotifyUsername = creds.value( "username" ).toString();
|
||||
}
|
||||
|
||||
if ( spotifyAccountLoggedIn && Accounts::SpotifyAccount::instance()->hasPlaylist( m_browseUri ) )
|
||||
/* if ( spotifyAccountLoggedIn && Accounts::SpotifyAccount::instance()->hasPlaylist( m_browseUri ) )
|
||||
{
|
||||
// The playlist is already registered with Tomahawk, so just open it instead of adding another instance.
|
||||
m_playlist = Accounts::SpotifyAccount::instance()->playlistForURI( m_browseUri );
|
||||
playlistCreated();
|
||||
}
|
||||
else
|
||||
else*/
|
||||
{
|
||||
m_playlist = Playlist::create( SourceList::instance()->getLocal(),
|
||||
uuid(),
|
||||
@ -426,7 +426,7 @@ SpotifyParser::checkBrowseFinished()
|
||||
|
||||
connect( m_playlist.data(), SIGNAL( revisionLoaded( Tomahawk::PlaylistRevision ) ), this, SLOT( playlistCreated() ) );
|
||||
|
||||
if ( spotifyAccountLoggedIn )
|
||||
/* if ( spotifyAccountLoggedIn )
|
||||
{
|
||||
SpotifyPlaylistUpdater* updater = new SpotifyPlaylistUpdater(
|
||||
Accounts::SpotifyAccount::instance(), m_playlist->currentrevision(), m_browseUri, m_playlist );
|
||||
@ -446,8 +446,7 @@ SpotifyParser::checkBrowseFinished()
|
||||
// On default, set the playlist as subscribed
|
||||
if( !updater->owner() )
|
||||
Accounts::SpotifyAccount::instance()->setSubscribedForPlaylist( m_playlist, true );
|
||||
|
||||
}
|
||||
}*/
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "Typedefs.h"
|
||||
#include "Query.h"
|
||||
#include "jobview/JobStatusItem.h"
|
||||
#include "accounts/spotify/SpotifyPlaylistUpdater.h"
|
||||
//#include "accounts/spotify/SpotifyPlaylistUpdater.h"
|
||||
#include "accounts/spotify/SpotifyAccount.h"
|
||||
#include <QObject>
|
||||
#include <QSet>
|
||||
@ -40,7 +40,6 @@
|
||||
|
||||
class NetworkReply;
|
||||
class SpotifyAccount;
|
||||
class SpotifyPlaylistUpdater;
|
||||
|
||||
namespace Tomahawk
|
||||
{
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
#include "accounts/lastfm/LastFmAccount.h"
|
||||
#include "accounts/spotify/SpotifyAccount.h"
|
||||
#include "accounts/spotify/SpotifyPlaylistUpdater.h"
|
||||
//#include "accounts/spotify/SpotifyPlaylistUpdater.h"
|
||||
#include "accounts/AccountManager.h"
|
||||
#include "audio/AudioEngine.h"
|
||||
#include "database/Database.h"
|
||||
@ -651,7 +651,7 @@ TomahawkApp::onInfoSystemReady()
|
||||
Tomahawk::EchonestCatalogSynchronizer::instance();
|
||||
|
||||
PlaylistUpdaterInterface::registerUpdaterFactory( new XspfUpdaterFactory );
|
||||
PlaylistUpdaterInterface::registerUpdaterFactory( new SpotifyUpdaterFactory );
|
||||
// PlaylistUpdaterInterface::registerUpdaterFactory( new SpotifyUpdaterFactory );
|
||||
|
||||
// Following work-around/fix taken from Clementine rev. 13e13ccd9a95 and courtesy of David Sansome
|
||||
// A bug in Qt means the wheel_scroll_lines setting gets ignored and replaced
|
||||
|
Loading…
x
Reference in New Issue
Block a user