Skip to content

Commit

Permalink
Added rudimentary support for iTunes MVNM and MVIN frames.
Browse files Browse the repository at this point in the history
  • Loading branch information
obskyr committed Feb 7, 2025
1 parent 2cdef0d commit bb4eff4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
14 changes: 14 additions & 0 deletions eyed3/id3/apple.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
TDES_FID = b"TDES"
TGID_FID = b"TGID"
GRP1_FID = b"GRP1"
MVNM_FID = b"MVNM"
MVIN_FID = b"MVIN"


class PCST(Frame):
Expand Down Expand Up @@ -56,3 +58,15 @@ class GRP1(TextFrame):

def __init__(self, _=None, **kwargs):
super().__init__(GRP1_FID, **kwargs)

class MVNM(TextFrame):
"""Movement name. An Apple extension for classical music."""

def __init__(self, _=None, **kwargs):
super().__init__(MVNM_FID, **kwargs)

class MVIN(TextFrame):
"""Movement index (e.g. "3/9"). An Apple extension for classical music."""

def __init__(self, _=None, **kwargs):
super().__init__(MVIN_FID, **kwargs)
7 changes: 6 additions & 1 deletion eyed3/id3/frames.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ def render(self):
@staticmethod
def isValidFrameId(fid: bytes) -> bool:
return (fid[0:1] == b'T' or
fid in [b"XSOA", b"XSOP", b"XSOT", b"XDOR", b"WFED", b"GRP1"])
fid in [b"XSOA", b"XSOP", b"XSOT", b"XDOR", b"WFED", b"GRP1",
b"MVNM", b"MVIN"])


class UserTextFrame(TextFrame):
Expand Down Expand Up @@ -2254,4 +2255,8 @@ def map2_2FrameId(orig_id):
ID3_V2, TextFrame),
b"GRP1": ("iTunes extension; grouping.",
ID3_V2, apple.GRP1),
b"MVNM": ("iTunes extension; movement name.",
ID3_V2, apple.MVNM),
b"MVIN": ("iTunes extension; movement index.",
ID3_V2, apple.MVIN)
}

0 comments on commit bb4eff4

Please sign in to comment.