Commits

Markus Kuppe  committed 432609f

Read tracks from a given cue sheet file and add as CHAPs to mp3 file (set FrameHeader conditionally)

  • Participants
  • Parent commits 03da3ba

Comments (0)

Files changed (1)

File src/eyed3/id3/frames.py

                 data += b'\xff\xff\xff\xff'
 
         for f in self.sub_frames.getAllFrames():
-            f.header = FrameHeader(TITLE_FID, self.header.version)
             data += f.render()
 
         self.data = data;
 
     @title.setter
     def title(self, title):
-        self.sub_frames.setTextFrame(TITLE_FID, title)
+        self.sub_frames.setTextFrame(TITLE_FID, title, FrameHeader(TITLE_FID, ID3_V2_3))
 
     @property
     def subtitle(self):
 
     @subtitle.setter
     def subtitle(self, subtitle):
-        self.sub_frames.setTextFrame(SUBTITLE_FID, subtitle)
-
+        self.sub_frames.setTextFrame(SUBTITLE_FID, subtitle, FrameHeader(SUBTITLE_FID, ID3_V2_3))
 
 class FrameSet(dict):
     def __init__(self):
         return frames
 
     @requireUnicode(2)
-    def setTextFrame(self, fid, text):
+    def setTextFrame(self, fid, text, header=None):
         '''Set a text frame value.
         Text frame IDs must be unique.  If a frame with
         the same Id is already in the list it's value is changed, otherwise
             self[fid][0].text = text
         else:
             if fid in DATE_FIDS:
-                self[fid] = DateFrame(fid, date=text)
+                f = DateFrame(fid, date=text)
             else:
-                self[fid] = TextFrame(fid, text=text)
+                f = TextFrame(fid, text=text)
+            if header is not None:
+                f.header = header
+            self[fid] = f 
 
 
 def deunsyncData(data):