Nekmo / telegram-upload
Showing 1 of 1 files from the diff.

@@ -44,16 +44,17 @@
Loading
44 44
        if hasattr(metadata, '_MultipleMetadata__groups'):
45 45
            # Is mkv
46 46
            meta_groups = metadata._MultipleMetadata__groups
47 -
        if not metadata.has('width') and meta_groups:
47 +
        if metadata is not None and not metadata.has('width') and meta_groups:
48 48
            video_meta = meta_groups[next(filter(lambda x: x.startswith('video'), meta_groups._key_list))]
49 -
        supports_streaming = isinstance(video_meta, MP4Metadata)
50 -
        attrs.append(DocumentAttributeVideo(
51 -
            (0, metadata.get('duration').seconds)[metadata.has('duration')],
52 -
            (0, video_meta.get('width'))[video_meta.has('width')],
53 -
            (0, video_meta.get('height'))[video_meta.has('height')],
54 -
            False,
55 -
            supports_streaming,
56 -
        ))
49 +
        if metadata is not None:
50 +
            supports_streaming = isinstance(video_meta, MP4Metadata)
51 +
            attrs.append(DocumentAttributeVideo(
52 +
                (0, metadata.get('duration').seconds)[metadata.has('duration')],
53 +
                (0, video_meta.get('width'))[video_meta.has('width')],
54 +
                (0, video_meta.get('height'))[video_meta.has('height')],
55 +
                False,
56 +
                supports_streaming,
57 +
            ))
57 58
    return attrs
58 59
59 60
Files Coverage
telegram_upload 87.44%
tests 100.00%
Project Totals (17 files) 92.29%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading