#500 flac: handle files where the first metadata block is not STREAMINFO

Open Paul Collins chucklebot
Coverage Reach
mutagen/id3/_frames.py mutagen/id3/_specs.py mutagen/id3/_tags.py mutagen/id3/_file.py mutagen/id3/_id3v1.py mutagen/id3/_util.py mutagen/id3/__init__.py mutagen/mp4/__init__.py mutagen/mp4/_as_entry.py mutagen/mp4/_atom.py mutagen/mp4/_util.py mutagen/asf/_objects.py mutagen/asf/_attrs.py mutagen/asf/__init__.py mutagen/asf/_util.py mutagen/_tools/mid3v2.py mutagen/_tools/mid3iconv.py mutagen/_tools/mid3cp.py mutagen/_tools/mutagen_pony.py mutagen/_tools/_util.py mutagen/_tools/moggsplit.py mutagen/_tools/mutagen_inspect.py mutagen/mp3/_util.py mutagen/mp3/__init__.py mutagen/_util.py mutagen/flac.py mutagen/apev2.py mutagen/ogg.py mutagen/easyid3.py mutagen/aac.py mutagen/_iff.py mutagen/dsf.py mutagen/ac3.py mutagen/musepack.py mutagen/_vorbis.py mutagen/dsdiff.py mutagen/easymp4.py mutagen/smf.py mutagen/tak.py mutagen/aiff.py mutagen/_file.py mutagen/wave.py mutagen/oggtheora.py mutagen/oggvorbis.py mutagen/oggflac.py mutagen/oggopus.py mutagen/oggspeex.py mutagen/wavpack.py mutagen/m4a.py mutagen/monkeysaudio.py mutagen/optimfrog.py mutagen/_tags.py mutagen/_riff.py mutagen/trueaudio.py mutagen/__init__.py mutagen/_constants.py tests/test_id3.py tests/test__id3frames.py tests/test_mp4.py tests/test__util.py tests/test_ogg.py tests/test_flac.py tests/test___init__.py tests/test_asf.py tests/test_easyid3.py tests/test_mp3.py tests/test_apev2.py tests/test_aiff.py tests/test_tools_mid3v2.py tests/test__id3specs.py tests/test__vorbis.py tests/test_oggvorbis.py tests/test_wave.py tests/test_tools_mid3cp.py tests/test_easymp4.py tests/test__riff.py tests/test_dsf.py tests/__init__.py tests/test_oggflac.py tests/test_musepack.py tests/test__id3util.py tests/test_tools_mid3iconv.py tests/test_aac.py tests/test_oggopus.py tests/test_wavpack.py tests/test_dsdiff.py tests/test_oggtheora.py tests/test_oggspeex.py tests/test_optimfrog.py tests/test_tools.py tests/test_monkeysaudio.py tests/test_trueaudio.py tests/test_tak.py tests/test_ac3.py tests/test_tools_moggsplit.py tests/test_encoding.py tests/test_tools_util.py tests/test_m4a.py tests/quality/test_flake8.py tests/test_tools_mutagen_inspect.py tests/test_smf.py tests/test_tools_mutagen_pony.py tests/test__iff.py

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 1 of 1 files from the diff.

@@ -797,7 +797,7 @@
Loading
797 797
            pass
798 798
799 799
        try:
800 -
            self.metadata_blocks[0].length
800 +
            self.info.length
801 801
        except (AttributeError, IndexError):
802 802
            raise FLACNoHeaderError("Stream info block not found")
803 803
@@ -811,7 +811,11 @@
Loading
811 811
812 812
    @property
813 813
    def info(self):
814 -
        return self.metadata_blocks[0]
814 +
        streaminfo_blocks = [
815 +
            block for block in self.metadata_blocks
816 +
            if block.code == StreamInfo.code
817 +
        ]
818 +
        return streaminfo_blocks[0]
815 819
816 820
    def add_picture(self, picture):
817 821
        """Add a new picture to the file.

Everything is accounted for!

No changes detected that need to be reviewed.
What changes does Codecov check for?
Lines, not adjusted in diff, that have changed coverage data.
Files that introduced coverage data that had none before.
Files that have missing coverage data that once were tracked.
Files Coverage
mutagen +<.01% 90.88%
tests 98.62%
Project Totals (103 files) 94.53%
Loading