Bug 303704

Summary: enhanced feature for nowlistening plugin
Product: [Unmaintained] kopete Reporter: Mad <mad.soft>
Component: Now Listening PluginAssignee: Kopete Developers <kopete-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: wishlist    
Priority: NOR    
Version First Reported In: SVN   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Mad 2012-07-17 20:45:31 UTC
I modified nlmpris.cpp from line 151 to 161 to:
If the file is playing doesn't have metadata, then m_artist must show " " and not %artist.
The same for m_track...
But if your mp3 file, doesn't have metadata, it show the name of file without mp3 extension

This is my piece of code

    if ( newTrack != m_track )
    {
        m_newTrack = true;
        m_track = newTrack;
        if (m_track.isEmpty())
        {
            m_track = " ";
        }
        // Fetch album
        m_album = metaData["album"].toString();
        if (m_album.isEmpty())
        {
            m_album = " ";
        }
        // Fetch artist
        m_artist = metaData["artist"].toString();
        if (m_artist.isEmpty())
        {
            m_artist = " ";
            if (m_track.isEmpty())
            {
                QStringList l;
                const QString tracktemp = metaData["location"].toString();
                l = tracktemp.split("/", QString::SkipEmptyParts);
                m_track = l[l.count() - 1];
            }
        }
    }

What do you think?

PD: It's my first time with QT, i'm a "rookie" :D

Reproducible: Always
Comment 1 Mad 2012-08-01 18:09:14 UTC
Uops! 
after  m_artist.isEmpty()

correct if (m_track.isEmpty())
by this
 if (m_track.compare(" ") == 0)
Comment 2 Christoph Cullmann 2024-09-18 18:28:23 UTC
Dear user, unfortunately Kopete is no longer maintained.

Please migrate to another solution, e.g. for Jabber a possibility is Kaidan, for Matrix a candidate is NeoChat.