1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-31 06:02:27 +02:00

Simplify logic, de-duplicate

This commit is contained in:
Jeff Mitchell 2011-06-19 09:23:56 -04:00
parent 8939af7407
commit 33ed1373e8

View File

@ -39,22 +39,7 @@ Tomahawk::result_ptr
SourcePlaylistInterface::siblingItem( int itemsAway )
{
Q_UNUSED( itemsAway );
qDebug() << Q_FUNC_INFO;
if ( m_source.isNull() || m_source->currentTrack().isNull() || m_source->currentTrack()->results().isEmpty() )
{
qDebug() << Q_FUNC_INFO << " Results were empty for current track or source no longer valid";
m_currentItem = Tomahawk::result_ptr();
return m_currentItem;
}
else if ( !m_gotNextSong )
{
qDebug() << Q_FUNC_INFO << " This song was already fetched";
return Tomahawk::result_ptr();
}
m_gotNextSong = false;
m_currentItem = m_source->currentTrack()->results().first();
return m_currentItem;
return nextItem();
}