1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-13 01:24:11 +02:00

Only show original creator if it's not the same as the user herself

This commit is contained in:
Leo Franchi
2012-07-23 17:59:47 -04:00
parent c2285dba84
commit f4b1c5ba9f

View File

@@ -355,11 +355,19 @@ SpotifyParser::checkBrowseFinished()
if ( m_createNewPlaylist && !m_tracks.isEmpty() ) if ( m_createNewPlaylist && !m_tracks.isEmpty() )
{ {
QString spotifyUsername;
if ( Accounts::SpotifyAccount::instance() && Accounts::SpotifyAccount::instance()->loggedIn() )
{
QVariantHash creds = Accounts::SpotifyAccount::instance()->credentials();
spotifyUsername = creds.value( "username" ).toString();
}
m_playlist = Playlist::create( SourceList::instance()->getLocal(), m_playlist = Playlist::create( SourceList::instance()->getLocal(),
uuid(), uuid(),
m_title, m_title,
m_info, m_info,
m_creator, spotifyUsername == m_creator ? QString() : m_creator,
false, false,
m_tracks ); m_tracks );
@@ -370,10 +378,9 @@ SpotifyParser::checkBrowseFinished()
SpotifyPlaylistUpdater* updater = new SpotifyPlaylistUpdater( SpotifyPlaylistUpdater* updater = new SpotifyPlaylistUpdater(
Accounts::SpotifyAccount::instance(), m_playlist->currentrevision(), m_browseUri, m_playlist ); Accounts::SpotifyAccount::instance(), m_playlist->currentrevision(), m_browseUri, m_playlist );
QVariantHash creds = Accounts::SpotifyAccount::instance()->credentials();
// If the user isnt dropping a playlist the he owns, its subscribeable // If the user isnt dropping a playlist the he owns, its subscribeable
if ( !m_browseUri.contains( creds.value( "username" ).toString() ) ) if ( !m_browseUri.contains( spotifyUsername ) )
updater->setCanSubscribe( true ); updater->setCanSubscribe( true );
// Just register the infos // Just register the infos