diff options
| author | exislow <exislow@users.noreply.github.com> | 2025-10-17 15:41:10 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-17 15:41:10 +0200 |
| commit | 4f01f605e47462df6e2b11c60e587a8812530382 (patch) | |
| tree | ffc6bfced4bbbdc95818d69b34a7f97425195c9f /tidal_dl_ng/metadata.py | |
| parent | 3d5b52209e7bfd5e292a32a75d454965ec468e5f (diff) | |
| parent | c8cb43adf73e7d8dbcb8ee58bfb2c74d6a2ea7e9 (diff) | |
| download | tidal-dl-ng-4f01f605e47462df6e2b11c60e587a8812530382.tar.gz | |
Merge pull request #589 from exislow:486-explicit-tagging
feat(metadata): ✨ add explicit track metadata handling
Diffstat (limited to 'tidal_dl_ng/metadata.py')
| -rw-r--r-- | tidal_dl_ng/metadata.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tidal_dl_ng/metadata.py b/tidal_dl_ng/metadata.py index c8e1728..7d8ccb9 100644 --- a/tidal_dl_ng/metadata.py +++ b/tidal_dl_ng/metadata.py @@ -31,6 +31,7 @@ class Metadata: replay_gain_write: bool upc: str target_upc: dict[str, str] + explicit: bool m: mutagen.mp4.MP4 | mutagen.mp4.MP4 | mutagen.flac.FLAC def __init__( @@ -59,6 +60,7 @@ class Metadata: url_share: str = "", replay_gain_write: bool = True, upc: str = "", + explicit: bool = False, ): self.path_file = path_file self.title = title @@ -84,6 +86,7 @@ class Metadata: self.replay_gain_write = replay_gain_write self.upc = upc self.target_upc = target_upc + self.explicit = explicit self.m: mutagen.FileType = mutagen.File(self.path_file) def _cover(self) -> bool: @@ -189,6 +192,7 @@ class Metadata: self.m.tags["isrc"] = self.isrc self.m.tags["\xa9url"] = self.url_share self.m.tags[f"----:com.apple.iTunes:{self.target_upc['MP4']}"] = self.upc.encode("utf-8") + self.m.tags["rtng"] = [1 if self.explicit else 0] if self.replay_gain_write: self.m.tags["----:com.apple.iTunes:REPLAYGAIN_ALBUM_GAIN"] = str(self.album_replay_gain).encode("utf-8") |
