GNOME Bugzilla – Bug 789155
Ignore newline in track metadata
Last modified: 2017-10-25 11:56:19 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
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)
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
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.
commit 817785f5e sets single-paragraph-mode on the property view
(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 ? )
(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
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.
(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.