Save metadata blocks to a file. Args: filething (filething) deleteid3 (bool): delete id3 tags while at it padding (:obj:`mutagen.PaddingFunction`) If no filename is given, the one most recently loaded is used.
(self, filething=None, deleteid3=False, padding=None)
| 837 | @convert_error(IOError, error) |
| 838 | @loadfile(writable=True) |
| 839 | def save(self, filething=None, deleteid3=False, padding=None): |
| 840 | """Save metadata blocks to a file. |
| 841 | |
| 842 | Args: |
| 843 | filething (filething) |
| 844 | deleteid3 (bool): delete id3 tags while at it |
| 845 | padding (:obj:`mutagen.PaddingFunction`) |
| 846 | |
| 847 | If no filename is given, the one most recently loaded is used. |
| 848 | """ |
| 849 | # add new cuesheet and seektable |
| 850 | if self.cuesheet and self.cuesheet not in self.metadata_blocks: |
| 851 | if not isinstance(self.cuesheet, CueSheet): |
| 852 | raise ValueError("Invalid cuesheet object type!") |
| 853 | self.metadata_blocks.append(self.cuesheet) |
| 854 | if self.seektable and self.seektable not in self.metadata_blocks: |
| 855 | if not isinstance(self.seektable, SeekTable): |
| 856 | raise ValueError("Invalid seektable object type!") |
| 857 | self.metadata_blocks.append(self.seektable) |
| 858 | |
| 859 | self._save(filething, self.metadata_blocks, deleteid3, padding) |
| 860 | |
| 861 | def _save(self, filething, metadata_blocks, deleteid3, padding): |
| 862 | f = StrictFileObject(filething.fileobj) |