Bug 90674

Summary: tooltip with meta data should be a little more intelligent
Product: [Applications] kfile-plugins Reporter: Thomas Zander <zander>
Component: mp3Assignee: Multimedia Developers <kde-multimedia>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: tooltip with mostly empty rows.

Description Thomas Zander 2004-10-02 22:35:06 UTC
Version:           3.3 (using KDE 3.3.0, compiled sources)
Compiler:          gcc version 3.3.4 (Debian)
OS:                Linux (i686) release 2.4.21

I created an mp3 with xmms by streaming a radio station to HD (as well as listing to it).
The resulting mp3 has all fields in the ID3 tag empty, no title, artist etc.
Naturally the mp3-id3 tag metadata plugin also supplies things like bitrate and length.

I, therefore, was surprised to see a tooltip in konq with 4 empty fields, and one filled field.  I would appreciate it if fields that are empty are not shown in the tooltip.
Comment 1 Thomas Zander 2004-10-02 22:36:13 UTC
Created attachment 7765 [details]
tooltip with mostly empty rows.

A picture describes it best.
Comment 2 Stephan Binner 2004-11-07 21:32:30 UTC
> I would appreciate it if fields that are empty are not shown in the tooltip.

They are not shown, your mp3 must contain some non-printing garbage.
Comment 3 Thomas Zander 2004-11-22 11:24:26 UTC
The theory that they contain some non-printing stuff is incorrect.
I just opened the properties for this dialog and put some little text in each field and pressed OK.
Then I opened the dialog again and this time I removed all the texts and fields.

The result was the same as the picture shows. So unless you also think the properties dialog puts non-printable garbage in my MP3, this theory is debunked.

Next; I took a perfectly correct MP3 and removed all the fields with the same result (I only can't remove the Genre, but OK).

No idea if its relevant; but doing the same thing on an ogg does have the correct result.
Comment 4 Brad Hards 2004-12-05 06:32:00 UTC
CVS commit by bhards: 

Handle empty (but not null) entries from mp3 files. I don't have a lot of
mp3s, so I could only test with the ones from kbattleship :-)

Thomas: can you update kdemultimedia/kfile-plugins/mp3 and test
if this is still a problem?

CCMAIL:90674@bugs.kde.org


  M +15 -5     kfile_mp3.cpp   1.71


--- kdemultimedia/kfile-plugins/mp3/kfile_mp3.cpp  #1.70:1.71
@@ -154,11 +154,21 @@ bool KMp3Plugin::readInfo(KFileMetaInfo 
         QString track = file.tag()->track() > 0 ? QString::number(file.tag()->track()) : QString::null;
 
-        appendItem(id3group, "Title",       TStringToQString(file.tag()->title()).stripWhiteSpace());
-        appendItem(id3group, "Artist",      TStringToQString(file.tag()->artist()).stripWhiteSpace());
-        appendItem(id3group, "Album",       TStringToQString(file.tag()->album()).stripWhiteSpace());
+        QString title = TStringToQString(file.tag()->title()).stripWhiteSpace();
+        if (!title.isEmpty())
+            appendItem(id3group, "Title", title);
+        QString artist = TStringToQString(file.tag()->artist()).stripWhiteSpace();
+        if (!artist.isEmpty())
+            appendItem(id3group, "Artist", artist);
+        QString album = TStringToQString(file.tag()->album()).stripWhiteSpace();
+        if (!album.isEmpty())
+            appendItem(id3group, "Album", album);
         appendItem(id3group, "Date",        date);
-        appendItem(id3group, "Comment",     TStringToQString(file.tag()->comment()).stripWhiteSpace());
+        QString comment = TStringToQString(file.tag()->comment()).stripWhiteSpace();
+        if (!comment.isEmpty())
+            appendItem(id3group, "Comment", comment);
         appendItem(id3group, "Tracknumber", track);
-        appendItem(id3group, "Genre",       TStringToQString(file.tag()->genre()).stripWhiteSpace());
+        QString genre = TStringToQString(file.tag()->genre()).stripWhiteSpace();
+        if (!genre.isEmpty())
+            appendItem(id3group, "Genre", genre);
     }
 


Comment 5 Thomas Zander 2004-12-05 15:49:09 UTC
Commit did indeed fix bug.