After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 789155 - Ignore newline in track metadata
Ignore newline in track metadata
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: Normal normal
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-10-18 15:52 UTC by gkrithi8
Modified: 2017-10-25 11:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Rhythmbox displaying newline (U+000A) in UI from track metadata (42.00 KB, image/png)
2017-10-18 15:52 UTC, gkrithi8
Details

Description gkrithi8 2017-10-18 15:52:48 UTC
Created attachment 361818 [details]
Rhythmbox displaying newline (U+000A) in UI from track metadata

Rhythmbox displays newline (U+000A) in UI from track metadata ( ID3 tags ). This causes weird characters to be displayed in UI, and entries spanning multiple lines in the property browser. Please refer attachment.

Corresponding mp3 file ( nuls.mp3 ) available from URL:

https://github.com/pculture/miro/tree/master/tv/resources/testdata/metadata
Comment 1 gkrithi8 2017-10-18 15:53:50 UTC
mplayer reading tags:
---------------------

user@vbox:~/test/rhythmbox/downloads$ mplayer nuls.mp3 
Playing nuls.mp3.
libavformat version 57.71.100 (external)
Audio only file format detected.
Clip info:
 Title: Invisible Walls
 Artist: Revolution Void
 Album: Increase The Dosage
 Year: 
 Comment: 
 Track: 1
 Genre: Blues
Load subtitles in ./
==========================================================================
Opening audio decoder: [mpg123] MPEG 1.0/2.0/2.5 layers I, II, III
AUDIO: 44100 Hz, 2 ch, s16le, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [mpg123] afm: mpg123 (MPEG 1.0/2.0/2.5 layers I, II, III)
==========================================================================
AO: [pulse] 44100Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   0.8 (00.8) of 1.0 (01.0)  0.3% 
Exiting... (End of file)
Comment 2 gkrithi8 2017-10-18 15:55:24 UTC
gst-discoverer-1.0 reading tags:
--------------------------------

user@vbox:~/test/rhythmbox/downloads$ gst-discoverer-1.0 nuls.mp3 
Analyzing file:///home/user/test/rhythmbox/downloads/nuls.mp3
Done discovering file:///home/user/test/rhythmbox/downloads/nuls.mp3

Topology:
  unknown: ID3 tag
    audio: MPEG-1 Layer 3 (MP3)

Properties:
  Duration: 0:00:01.044000000
  Seekable: yes
  Tags: 
      title: Invisible
Wa, ls
      artist: Revolut, on Void
      album: Increase The
Dos, ge
      track number: 1
      genre: Blu, s
      container format: ID3 tag
      encoder: LAME 32bits ver
      duration: 1000000000
      has crc: false
      channel mode: joint-stereo
      audio codec: MPEG-1 Layer 3 (MP3)
      nominal bitrate: 128000
Comment 3 Jonathan Matthew 2017-10-23 09:49:20 UTC
mplayer isn't ignoring the newlines there, it's displaying the id3v1 tag rather than the id3v2 tag, and the id3v1 tag doesn't have the newlines in it.

There's no sensible way to display a tag containing a newline in the browser or track list.  I think all we can do is set single-paragraph-mode on the browser so it only takes up one line, which also makes it consistent with the track list.  The track list sets single-paragraph-mode to handle comment tags with newlines, where they at least sort of belong.
Comment 4 Jonathan Matthew 2017-10-23 09:51:42 UTC
commit 817785f5e sets single-paragraph-mode on the property view
Comment 5 gkrithi8 2017-10-23 17:44:44 UTC
(In reply to Jonathan Matthew from comment #4)
> commit 817785f5e sets single-paragraph-mode on the property view

Sure. But, is it possible to do a unicode regexp replace, something like the Java equivalent below:

track_comment.replaceAll("\\p{C}", "?");

The unicode blocks with hex code looks quite weird when displayed in the UI. Any mechanism to shunt it would be nice. ( Preference option to make it user configurable ? )
Comment 6 gkrithi8 2017-10-23 17:46:45 UTC
(In reply to gkrithi8 from comment #5)
> (In reply to Jonathan Matthew from comment #4)

> track_comment.replaceAll("\\p{C}", "?");

\p{C} or \p{Other}: invisible control characters and unused code points. 

Source: http://www.regular-expressions.info/unicode.html
Comment 7 Jonathan Matthew 2017-10-23 22:10:15 UTC
It's possible, but the result isn't any more correct than what you get now, so I don't think it's a useful thing to do.
Comment 8 gkrithi8 2017-10-25 11:56:19 UTC
(In reply to Jonathan Matthew from comment #7)
> It's possible, but the result isn't any more correct than what you get now,
> so I don't think it's a useful thing to do.

One more thing that got missed out is that gst-discoverer-1.0 prints the complete text ( compare title and album in comment#2 with screenshot ), but Rhythmbox misses the last bits.