void MagnatuneAlbumDownloader::downloadAlbum( MagnatuneDownloadInfo * info )
{
    DEBUG_BLOCK

    m_currentAlbum = info->album();

    KUrl downloadUrl = info->getCompleteDownloadUrl();
    m_currentAlbumUnpackLocation = info->getUnpackLocation();
    debug() << "Download: " << downloadUrl.url() << " to: " << m_currentAlbumUnpackLocation;


    //m_currentAlbumFileName = downloadUrl.fileName();
    if ( m_currentAlbum )
        m_currentAlbumFileName = m_currentAlbum->albumCode() + ".zip";
    else
        m_currentAlbumFileName = "temp_album.zip";


    debug() << "Using temporary location: " << m_tempDir->name() + m_currentAlbumFileName;

    m_albumDownloadJob = KIO::file_copy( downloadUrl, KUrl( m_tempDir->name() + m_currentAlbumFileName ), -1, KIO::Overwrite | KIO::HideProgressInfo );

    connect( m_albumDownloadJob, SIGNAL( result( KJob* ) ), SLOT( albumDownloadComplete( KJob* ) ) );

    The::statusBar()->newProgressOperation( m_albumDownloadJob, i18n( "Downloading album" ) )
    ->setAbortSlot( this, SLOT( albumDownloadAborted() ) );
}
void MagnatuneAlbumDownloader::downloadAlbum( MagnatuneDownloadInfo * info )
{


    m_currentAlbumId = info->getAlbumId();

    KURL downloadUrl = info->getCompleteDownloadUrl();
    m_currentAlbumFileName = downloadUrl.fileName( false );

    m_currentAlbumUnpackLocation = info->getUnpackLocation();



    debug() << "Download: " << downloadUrl.url() << " to: " << m_currentAlbumUnpackLocation << endl;
    debug() << "Using temporary location: " << m_tempDir.name() + m_currentAlbumFileName << endl;

    m_albumDownloadJob = KIO::file_copy( downloadUrl, KURL( m_tempDir.name() + m_currentAlbumFileName ), -1, true, false, false );

    connect( m_albumDownloadJob, SIGNAL( result( KIO::Job* ) ), SLOT( albumDownloadComplete( KIO::Job* ) ) );

    Amarok::StatusBar::instance() ->newProgressOperation( m_albumDownloadJob )
    .setDescription( i18n( "Downloading album" ) )
    .setAbortSlot( this, SLOT( albumDownloadAborted() ) );
}