Esempio n. 1
0
def get_files_video():
    """
    Semantics: scan all shares in config for video files
    Arguments: None
    Return: list of FileInfo classes
    """
    shares = read_config()
    all_files = []
    for share in shares:
        print("share:", share)
        # comment
        if share[0] == '#':
            continue
        # local folder
        if share[0] == '/' and share[1] != '/':
            mount_point = share
            host = 'localhost'
            file_list = index_folder_rec(host, mount_point)
        # network share
        else:
            # mounting
            mount_point = mount_smb.mount_smb(share)
            host, ip = mount_smb.get_ip_and_host(share)
            # find video files
            file_list = index_folder_rec(host, mount_point, 0)
            mount_smb.umount_smb(mount_point)
        for f in file_list:
            all_files.append(f)
    return all_files
Esempio n. 2
0
def get_files_video():
    """
    Semantics: scan all shares in config for video files
    Arguments: None
    Return: list of FileInfo classes
    """
    shares = read_config()
    all_files = []
    for share in shares:
        print("share:", share)
        # comment
        if share[0] == '#':
            continue
        # local folder
        if share[0] == '/' and share[1] != '/':
            mount_point = share
            host = 'localhost'
            file_list = index_folder_rec(host, mount_point, 0)
        # network share
        else:
            # mounting
            mount_point = mount_smb.mount_smb(share)
            host, ip = mount_smb.get_ip_and_host(share)
            # find video files
            file_list = index_folder_rec(host, mount_point, 0)
            mount_smb.umount_smb(mount_point)
        for f in file_list:
            all_files.append(f)
    return all_files
Esempio n. 3
0
def get_files_video():
    shares = read_config()
    all_files = []
    for share in shares:
        print("share:", share)
        if share[0] == '#':
            continue
        if share[0] == '/' and share[1] != '/':
            mount_point = share
            host = 'localhost'
            file_list = index_folder(host, mount_point)
        else:
            mount_point = mount_smb.mount_smb(share)
            host, ip = mount_smb.get_ip_and_host(share)
            file_list = index_folder(host, mount_point)
            mount_smb.umount_smb(mount_point)
        for f in file_list:
            all_files.append(f)
    return all_files