[Amarok] use cached lyrics (if available)
Alex Merry
kde at randomguy3.me.uk
Tue Sep 15 01:36:38 CEST 2009
On Tuesday 15 September 2009 00:17:33 you wrote:
> > --- a/src/context/engines/lyrics/LyricsEngine.cpp
> > +++ b/src/context/engines/lyrics/LyricsEngine.cpp
> > @@ -120,7 +120,7 @@ void LyricsEngine::update()
> > QString lyrics = currentTrack->cachedLyrics();
> >
> > // don't rely on caching for streams
> > - const bool cached = !lyrics.isEmpty() &&
> > !The::engineController()->isStream() && ( currentTrack->name() == m_title
> > ) && ( currentTrack->artist()->name() == m_artist ); + const bool
> > cached = !lyrics.isEmpty() && !The::engineController()->isStream();
>
> Sorry, how does this fix anything? If anything, it will introduce
> false positives. We should never be showing lyrics when there is an
> artist and title mismatch.
It's the surrounding code that makes the check pointless.
m_artist and m_title at the point of the test are the artist and title of the
previous track. So the old code would only have used the cached lyrics
(obtained from The::engineController->currentTrack(), so obviously the correct
cached lyrics) if the artist and title of the previously playing track was the
same as that of the currently playing track.
I suspect the checks were from when the engine cached the lyrics internally,
rather that using Meta::Track to do it.
Alex
--
Why have I got six monitors? Because I haven't got room for eight.
-- Terry Pratchett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/amarok-devel/attachments/20090915/c691ef6d/attachment.sig
More information about the Amarok-devel
mailing list