'Get scene naming parameters from filename and quality
:param name: Filename to check
:param quality: int of quality to make sure we get the right rip type
:return: encoder type for scene quality naming'

@staticmethod
def sceneQualityFromName(name, quality):

    codec_list = [u'xvid', u'divx']
    x264_list = [u'x264', u'x    264', u'x.264']
    h264_list = [u'h264', u'h    264', u'h.264', u'avc']
    x265_list = [u'x265', u'x    265', u'x.265']
    h265_list = [u'h265', u'h    265', u'h.265', u'hevc']
    codec_list += (((x264_list + h264_list) + x265_list) + h265_list)
    found_codecs = {}
    found_codec = None
    for codec in codec_list:
        if (codec in name.lower()):
            found_codecs[name.lower().rfind(codec)] = codec
    if found_codecs:
        sorted_codecs = sorted(found_codecs, reverse=True)
        found_codec = found_codecs[list(sorted_codecs)[0]]
    if (quality == 2):
        if re.search(u'b(r|d|rd)?(-|    |\\.)?(rip|mux)', name.lower()):
            rip_type = u'    BDRip'
        elif re.search(u'(dvd)(-|    |\\.)?(rip|mux)?', name.lower()):
            rip_type = u'    DVDRip'
        else:
            rip_type = u''
    if found_codec:
        if (codec_list[0] in found_codec):
            found_codec = u'XviD'
        elif (codec_list[1] in found_codec):
            found_codec = u'DivX'
        elif (found_codec in x264_list):
            found_codec = x264_list[0]
        elif (found_codec in h264_list):
            found_codec = h264_list[0]
        elif (found_codec in x265_list):
            found_codec = x265_list[0]
        elif (found_codec in h265_list):
            found_codec = h265_list[0]
        if (quality == 2):
            return ((rip_type + u'    ') + found_codec)
        else:
            return (u'    ' + found_codec)
    elif (quality == 2):
        return rip_type
    else:
        return u''
