# Path: ififuncs.py
# def get_milliseconds(filename):
#     '''
#     Returns a float with the duration of a file in milliseconds.
#     '''
#     milliseconds = get_mediainfo(
#         'miliseconds',
#         '--inform=General;%Duration%',
#         filename
#     )
#     return float(milliseconds)


import os
import sys
from ififuncs import get_milliseconds
#!/usr/bin/env python
'''
This script will ask mediainfo to get all durations with a folder
'''


def main():
    '''
    Recursively search for AV files and print duration in seconds
    '''
    all_files = sys.argv[1:]
    duration = 0
    for parent_directory in all_files:
        for root, dirnames, filenames in os.walk(parent_directory):
            for filename in filenames:
                if filename.endswith(('.MP4', '.mov', '.mkv')):

# Path: ififuncs.py
# def get_milliseconds(filename):
#     '''
#     Returns a float with the duration of a file in milliseconds.
#     '''
#     milliseconds = get_mediainfo(
#         'miliseconds',
#         '--inform=General;%Duration%',
#         filename
#     )
#     return float(milliseconds)


# Path: durationcheck.py
import os
import sys
from ififuncs import get_milliseconds

#!/usr/bin/env python
'''
This script will ask mediainfo to get all durations with a folder
'''


def main():
    '''
    Recursively search for AV files and print duration in seconds
    '''
    all_files = sys.argv[1:]
    duration = 0
    for parent_directory in all_files:
        for root, dirnames, filenames in os.walk(parent_directory):
            for filename in filenames:
                if filename.endswith(('.MP4', '.mov', '.mkv')):

                    milliseconds = get_milliseconds(