'Get quality from file metadata
:param filename: Filename to analyse
:return: Quality prefix'

@staticmethod
def qualityFromFileMeta(filename):

    data = {}
    quality = Quality.UNKNOWN
    if os.path.isfile(filename):
        meta = getFileMetadata(filename)
        try:
            if meta.get(u'resolution_width'):
                data[u'resolution_width'] = meta.get(u'resolution_width')
                data[u'resolution_height'] = meta.get(u'resolution_height')
                data[u'aspect'] = round((float(meta.get(u'resolution_width')) / meta.get(u'resolution_height', 1)), 2)
            else:
                data.update(getResolution(filename))
        except:
            return quality
        base_filename = os.path.basename(filename)
        bluray = (re.search(u'blue?-?ray|hddvd|b[rd](rip|mux)', base_filename, re.I) is not None)
        webdl = (re.search(u'\\bweb\\b|web.?dl|web(rip|mux|hd)', base_filename, re.I) is not None)
        if (3240 < data[u'resolution_height']):
            ret = ((Quality.UHD_8K_TV, Quality.UHD_8K_BLURAY)[bluray], Quality.UHD_8K_WEBDL)[webdl]
        if (1620 < data[u'resolution_height'] <= 3240):
            ret = ((Quality.UHD_4K_TV, Quality.UHD_4K_BLURAY)[bluray], Quality.UHD_4K_WEBDL)[webdl]
        elif (800 < data[u'resolution_height'] <= 1620):
            quality = ((Quality.FULLHDTV, Quality.FULLHDBLURAY)[bluray], Quality.FULLHDWEBDL)[webdl]
        elif (680 < data[u'resolution_height'] < 800):
            quality = ((Quality.HDTV, Quality.HDBLURAY)[bluray], Quality.HDWEBDL)[webdl]
        elif (data[u'resolution_height'] < 680):
            quality = (Quality.SDTV, Quality.SDDVD)[(re.search(u'dvd|b[rd]rip|blue?-?ray', base_filename, re.I) is not None)]
    return quality
