How to use the mediafile.MP4StorageStyle function in mediafile

To help you get started, we’ve selected a few mediafile examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github beetbox / mediafile / mediafile.py View on Github external
MP3ListStorageStyle('TCON'),
        MP4ListStorageStyle('\xa9gen'),
        ListStorageStyle('GENRE'),
        ASFStorageStyle('WM/Genre'),
    )
    genre = genres.single_field()

    lyricist = MediaField(
        MP3StorageStyle('TEXT'),
        MP4StorageStyle('----:com.apple.iTunes:LYRICIST'),
        StorageStyle('LYRICIST'),
        ASFStorageStyle('WM/Writer'),
    )
    composer = MediaField(
        MP3StorageStyle('TCOM'),
        MP4StorageStyle('\xa9wrt'),
        StorageStyle('COMPOSER'),
        ASFStorageStyle('WM/Composer'),
    )
    composer_sort = MediaField(
        MP3StorageStyle('TSOC'),
        MP4StorageStyle('soco'),
        StorageStyle('COMPOSERSORT'),
        ASFStorageStyle('WM/Composersortorder'),
    )
    arranger = MediaField(
        MP3PeopleStorageStyle('TIPL', involvement='arranger'),
        MP4StorageStyle('----:com.apple.iTunes:Arranger'),
        StorageStyle('ARRANGER'),
        ASFStorageStyle('beets/Arranger'),
    )
github beetbox / mediafile / mediafile.py View on Github external
StorageStyle('RELEASETYPE'),
        StorageStyle('MUSICBRAINZ_ALBUMTYPE'),
        ASFStorageStyle('MusicBrainz/Album Type'),
    )
    label = MediaField(
        MP3StorageStyle('TPUB'),
        MP4StorageStyle('----:com.apple.iTunes:LABEL'),
        MP4StorageStyle('----:com.apple.iTunes:publisher'),
        MP4StorageStyle('----:com.apple.iTunes:Label', read_only=True),
        StorageStyle('LABEL'),
        StorageStyle('PUBLISHER'),  # Traktor
        ASFStorageStyle('WM/Publisher'),
    )
    artist_sort = MediaField(
        MP3StorageStyle('TSOP'),
        MP4StorageStyle('soar'),
        StorageStyle('ARTISTSORT'),
        ASFStorageStyle('WM/ArtistSortOrder'),
    )
    albumartist_sort = MediaField(
        MP3DescStorageStyle(u'ALBUMARTISTSORT'),
        MP4StorageStyle('soaa'),
        StorageStyle('ALBUMARTISTSORT'),
        ASFStorageStyle('WM/AlbumArtistSortOrder'),
    )
    asin = MediaField(
        MP3DescStorageStyle(u'ASIN'),
        MP4StorageStyle('----:com.apple.iTunes:ASIN'),
        StorageStyle('ASIN'),
        ASFStorageStyle('MusicBrainz/ASIN'),
    )
    catalognum = MediaField(
github beetbox / mediafile / mediafile.py View on Github external
method retrieves the corresponding value from `dict` and updates
        the `MediaFile`. If a key has the value `None`, the
        corresponding property is deleted from the `MediaFile`.
        """
        for field in self.sorted_fields():
            if field in dict:
                if dict[field] is None:
                    delattr(self, field)
                else:
                    setattr(self, field, dict[field])

    # Field definitions.

    title = MediaField(
        MP3StorageStyle('TIT2'),
        MP4StorageStyle('\xa9nam'),
        StorageStyle('TITLE'),
        ASFStorageStyle('Title'),
    )
    artist = MediaField(
        MP3StorageStyle('TPE1'),
        MP4StorageStyle('\xa9ART'),
        StorageStyle('ARTIST'),
        ASFStorageStyle('Author'),
    )
    album = MediaField(
        MP3StorageStyle('TALB'),
        MP4StorageStyle('\xa9alb'),
        StorageStyle('ALBUM'),
        ASFStorageStyle('WM/AlbumTitle'),
    )
    genres = ListMediaField(
github beetbox / mediafile / mediafile.py View on Github external
)
    artist_sort = MediaField(
        MP3StorageStyle('TSOP'),
        MP4StorageStyle('soar'),
        StorageStyle('ARTISTSORT'),
        ASFStorageStyle('WM/ArtistSortOrder'),
    )
    albumartist_sort = MediaField(
        MP3DescStorageStyle(u'ALBUMARTISTSORT'),
        MP4StorageStyle('soaa'),
        StorageStyle('ALBUMARTISTSORT'),
        ASFStorageStyle('WM/AlbumArtistSortOrder'),
    )
    asin = MediaField(
        MP3DescStorageStyle(u'ASIN'),
        MP4StorageStyle('----:com.apple.iTunes:ASIN'),
        StorageStyle('ASIN'),
        ASFStorageStyle('MusicBrainz/ASIN'),
    )
    catalognum = MediaField(
        MP3DescStorageStyle(u'CATALOGNUMBER'),
        MP4StorageStyle('----:com.apple.iTunes:CATALOGNUMBER'),
        StorageStyle('CATALOGNUMBER'),
        ASFStorageStyle('WM/CatalogNo'),
    )
    barcode = MediaField(
        MP3DescStorageStyle(u'BARCODE'),
        MP4StorageStyle('----:com.apple.iTunes:BARCODE'),
        StorageStyle('BARCODE'),
        ASFStorageStyle('WM/Barcode'),
    )
    disctitle = MediaField(
github beetbox / mediafile / mediafile.py View on Github external
# *Original* release date.
    original_date = DateField(
        MP3StorageStyle('TDOR'),
        MP4StorageStyle('----:com.apple.iTunes:ORIGINAL YEAR'),
        StorageStyle('ORIGINALDATE'),
        ASFStorageStyle('WM/OriginalReleaseYear'))

    original_year = original_date.year_field()
    original_month = original_date.month_field()
    original_day = original_date.day_field()

    # Nonstandard metadata.
    artist_credit = MediaField(
        MP3DescStorageStyle(u'Artist Credit'),
        MP4StorageStyle('----:com.apple.iTunes:Artist Credit'),
        StorageStyle('ARTIST_CREDIT'),
        ASFStorageStyle('beets/Artist Credit'),
    )
    albumartist_credit = MediaField(
        MP3DescStorageStyle(u'Album Artist Credit'),
        MP4StorageStyle('----:com.apple.iTunes:Album Artist Credit'),
        StorageStyle('ALBUMARTIST_CREDIT'),
        ASFStorageStyle('beets/Album Artist Credit'),
    )

    # Legacy album art field
    art = CoverArtField()

    # Image list
    images = ImageListField()
github beetbox / mediafile / mediafile.py View on Github external
lyricist = MediaField(
        MP3StorageStyle('TEXT'),
        MP4StorageStyle('----:com.apple.iTunes:LYRICIST'),
        StorageStyle('LYRICIST'),
        ASFStorageStyle('WM/Writer'),
    )
    composer = MediaField(
        MP3StorageStyle('TCOM'),
        MP4StorageStyle('\xa9wrt'),
        StorageStyle('COMPOSER'),
        ASFStorageStyle('WM/Composer'),
    )
    composer_sort = MediaField(
        MP3StorageStyle('TSOC'),
        MP4StorageStyle('soco'),
        StorageStyle('COMPOSERSORT'),
        ASFStorageStyle('WM/Composersortorder'),
    )
    arranger = MediaField(
        MP3PeopleStorageStyle('TIPL', involvement='arranger'),
        MP4StorageStyle('----:com.apple.iTunes:Arranger'),
        StorageStyle('ARRANGER'),
        ASFStorageStyle('beets/Arranger'),
    )

    grouping = MediaField(
        MP3StorageStyle('TIT1'),
        MP4StorageStyle('\xa9grp'),
        StorageStyle('GROUPING'),
        ASFStorageStyle('WM/ContentGroupDescription'),
    )
github beetbox / mediafile / mediafile.py View on Github external
ASFStorageStyle(
            u'replaygain_track_gain',
            float_places=2, suffix=u' dB'
        ),
        out_type=float
    )
    rg_album_gain = MediaField(
        MP3DescStorageStyle(
            u'REPLAYGAIN_ALBUM_GAIN',
            float_places=2, suffix=u' dB'
        ),
        MP3DescStorageStyle(
            u'replaygain_album_gain',
            float_places=2, suffix=u' dB'
        ),
        MP4StorageStyle(
            '----:com.apple.iTunes:replaygain_album_gain',
            float_places=2, suffix=' dB'
        ),
        StorageStyle(
            u'REPLAYGAIN_ALBUM_GAIN',
            float_places=2, suffix=u' dB'
        ),
        ASFStorageStyle(
            u'replaygain_album_gain',
            float_places=2, suffix=u' dB'
        ),
        out_type=float
    )
    rg_track_peak = MediaField(
        MP3DescStorageStyle(
            u'REPLAYGAIN_TRACK_PEAK',
github beetbox / mediafile / mediafile.py View on Github external
items = self.deserialize(self.fetch(mutagen_file))
        items[self.index] = int(value)
        self.store(mutagen_file, items)

    def delete(self, mutagen_file):
        if self.index == 0:
            super(MP4TupleStorageStyle, self).delete(mutagen_file)
        else:
            self.set(mutagen_file, None)


class MP4ListStorageStyle(ListStorageStyle, MP4StorageStyle):
    pass


class MP4SoundCheckStorageStyle(SoundCheckStorageStyleMixin, MP4StorageStyle):
    def __init__(self, key, index=0, **kwargs):
        super(MP4SoundCheckStorageStyle, self).__init__(key, **kwargs)
        self.index = index


class MP4BoolStorageStyle(MP4StorageStyle):
    """A style for booleans in MPEG-4 files. (MPEG-4 has an atom type
    specifically for representing booleans.)
    """
    def get(self, mutagen_file):
        try:
            return mutagen_file[self.key]
        except KeyError:
            return None

    def get_list(self, mutagen_file):
github beetbox / mediafile / mediafile.py View on Github external
)
    mb_releasetrackid = MediaField(
        MP3DescStorageStyle(u'MusicBrainz Release Track Id'),
        MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Release Track Id'),
        StorageStyle('MUSICBRAINZ_RELEASETRACKID'),
        ASFStorageStyle('MusicBrainz/Release Track Id'),
    )
    mb_workid = MediaField(
        MP3DescStorageStyle(u'MusicBrainz Work Id'),
        MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Work Id'),
        StorageStyle('MUSICBRAINZ_WORKID'),
        ASFStorageStyle('MusicBrainz/Work Id'),
    )
    mb_albumid = MediaField(
        MP3DescStorageStyle(u'MusicBrainz Album Id'),
        MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Album Id'),
        StorageStyle('MUSICBRAINZ_ALBUMID'),
        ASFStorageStyle('MusicBrainz/Album Id'),
    )
    mb_artistid = MediaField(
        MP3DescStorageStyle(u'MusicBrainz Artist Id'),
        MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Artist Id'),
        StorageStyle('MUSICBRAINZ_ARTISTID'),
        ASFStorageStyle('MusicBrainz/Artist Id'),
    )
    mb_albumartistid = MediaField(
        MP3DescStorageStyle(u'MusicBrainz Album Artist Id'),
        MP4StorageStyle('----:com.apple.iTunes:MusicBrainz Album Artist Id'),
        StorageStyle('MUSICBRAINZ_ALBUMARTISTID'),
        ASFStorageStyle('MusicBrainz/Album Artist Id'),
    )
    mb_releasegroupid = MediaField(
github beetbox / mediafile / mediafile.py View on Github external
MP3StorageStyle('TALB'),
        MP4StorageStyle('\xa9alb'),
        StorageStyle('ALBUM'),
        ASFStorageStyle('WM/AlbumTitle'),
    )
    genres = ListMediaField(
        MP3ListStorageStyle('TCON'),
        MP4ListStorageStyle('\xa9gen'),
        ListStorageStyle('GENRE'),
        ASFStorageStyle('WM/Genre'),
    )
    genre = genres.single_field()

    lyricist = MediaField(
        MP3StorageStyle('TEXT'),
        MP4StorageStyle('----:com.apple.iTunes:LYRICIST'),
        StorageStyle('LYRICIST'),
        ASFStorageStyle('WM/Writer'),
    )
    composer = MediaField(
        MP3StorageStyle('TCOM'),
        MP4StorageStyle('\xa9wrt'),
        StorageStyle('COMPOSER'),
        ASFStorageStyle('WM/Composer'),
    )
    composer_sort = MediaField(
        MP3StorageStyle('TSOC'),
        MP4StorageStyle('soco'),
        StorageStyle('COMPOSERSORT'),
        ASFStorageStyle('WM/Composersortorder'),
    )
    arranger = MediaField(