示例#1
0
void ShoutcastFetcher::playlistDownloaded(PlsFile * file)
{
	ShoutcastStation s = m_pendingPlaylistUrlsForStation.take(file->url());
	m_stationPlaylistMapping[s] = QSharedPointer<PlsFile>(file);
	//qDebug() << file->url() << file->urls().count();
	file->setParent(0);
	emit playlistAvailable(s);
}
示例#2
0
void Playlist::downloadEntries() {
    if (_refreshIterator == _refreshEntries.end()) {
        _entries = _refreshEntries;
        _playbackIterator = _entries.end();
        --_playbackIterator;
        emit playlistAvailable();

        cleanupStaleEntries();
        return;
    }

    QFile entryFile(_entryPath.filePath(_refreshIterator->fileId));
    if (! entryFile.exists()) {
        qDebug() << "Downloading" << _refreshIterator->url;
        auto reply = _nam.get(QNetworkRequest(_refreshIterator->url));
        connect(reply, &QNetworkReply::finished, this, &Playlist::onFetchEntryFinished);
    } else {
        ++_refreshIterator;
        downloadEntries();
    }
}