PiRSquared17 / flac2all

Automatically exported from code.google.com/p/flac2all
0 stars 0 forks source link

Track titles truncated at the first colon #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. using the program with flac files that have a : in the track title e.g. 
./flac2all_v3.28.py mp3 flacdir/ -c -o MP3dir
2.
3.

What is the expected output? What do you see instead?

Track titles truncated at the first colon

What version of the product are you using? On what operating system?

v3.28 on Debian Wheezy

Please provide any additional information below.

The fix is in getflacmeta, by replacing:

     datalist.append(string.split(data,":"))
with
     datalist.append(string.split(data,":",1))

This will ensure the comment data parser only splits off up to the first colon. 
Check out the track title in this metaflac dump, where the MP3 file title ended 
up being "4" instead of "4:39am ...."

$ metaflac --list ../Music/Roger\ Waters/The\ Pros\ and\ Cons\ of\ Hitch\ 
Hiking/04.\ 4\:39am\ \(For\ The\ First\ Time\ Today\,\ Part\ 2\).flac 
METADATA block #0
  type: 0 (STREAMINFO)
  is last: false
  length: 34
  minimum blocksize: 4608 samples
  maximum blocksize: 4608 samples
  minimum framesize: 6453 bytes
  maximum framesize: 15346 bytes
  sample_rate: 44100 Hz
  channels: 2
  bits-per-sample: 16
  total samples: 5404896
  MD5 signature: f1bbdeb84c6991f240cf2e22df51a40e
METADATA block #1
  type: 3 (SEEKTABLE)
  is last: false
  length: 216
  seek points: 12
    point 0: sample_number=0, stream_offset=0, frame_samples=4608
    point 1: sample_number=446976, stream_offset=836197, frame_samples=4608
    point 2: sample_number=898560, stream_offset=1635784, frame_samples=4608
    point 3: sample_number=1350144, stream_offset=2647529, frame_samples=4608
    point 4: sample_number=1797120, stream_offset=3856226, frame_samples=4608
    point 5: sample_number=2248704, stream_offset=4978619, frame_samples=4608
    point 6: sample_number=2700288, stream_offset=6210121, frame_samples=4608
    point 7: sample_number=3151872, stream_offset=7483671, frame_samples=4608
    point 8: sample_number=3598848, stream_offset=8439309, frame_samples=4608
    point 9: sample_number=4050432, stream_offset=9423708, frame_samples=4608
    point 10: sample_number=4502016, stream_offset=10441031, frame_samples=4608
    point 11: sample_number=4953600, stream_offset=11447905, frame_samples=4608
METADATA block #2
  type: 4 (VORBIS_COMMENT)
  is last: false
  length: 225
  vendor string: reference libFLAC 1.1.2 20050205
  comments: 7
    comment[0]: TITLE=4:39am (For The First Time Today, Part 2)
    comment[1]: ARTIST=Roger Waters
    comment[2]: ALBUM=The Pros and Cons of Hitch Hiking
    comment[3]: DATE=1983
    comment[4]: TRACKNUMBER=04
    comment[5]: TRACKTOTAL=12
    comment[6]: GENRE=Soundtrack
METADATA block #3
  type: 1 (PADDING)
  is last: true
  length: 4078

Great program BTW! Very useful for making MP3s for the car stereo.

Original issue reported on code.google.com by pivotman...@gmail.com on 24 Sep 2013 at 4:12

GoogleCodeExporter commented 9 years ago
Now this is an actual bug. One that I would have expected people to hit 
earlier.  

Should not have assumed that there is only one colon in a filename. I have made 
the the changes and committed them. revision 34 included your fix. 

I am glad you like it! And thank you very much for your help!

Original comment by i...@ziva-vatra.com on 2 Nov 2013 at 7:51