pysonic/pysonic/types.py

50 lines
917 B
Python
Raw Permalink Normal View History

# known mimes
MIME_MPEG = "audio/mpeg"
2017-08-13 22:08:40 -07:00
MIME_FLAC = "audio/flac"
MIME_XFLAC = "audio/x-flac"
2018-04-05 19:02:17 -07:00
MIME_XWAV = "audio/x-wav"
2018-04-05 19:02:17 -07:00
MIME_JPEG = "image/jpeg"
MIME_PNG = "image/png"
MIME_GIF = "image/gif"
2018-04-05 19:02:17 -07:00
# groupings of similar files by mime
KNOWN_MIMES = [MIME_MPEG, MIME_FLAC, MIME_XFLAC, MIME_XWAV, MIME_JPEG, MIME_PNG]
2018-04-05 19:02:17 -07:00
MUSIC_TYPES = [MIME_MPEG, MIME_FLAC, MIME_XFLAC, MIME_XWAV]
MPX_TYPES = [MIME_MPEG]
FLAC_TYPES = [MIME_FLAC, MIME_XFLAC]
WAV_TYPES = [MIME_XWAV]
IMAGE_TYPES = [MIME_JPEG, MIME_PNG, MIME_GIF]
2018-04-05 19:02:17 -07:00
IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "gif"]
MUSIC_EXTENSIONS = ["mp3", "flac", "wav"]
2020-10-06 16:59:23 -07:00
TYPE_TO_EXTENSION = {
MIME_MPEG: "mp3",
MIME_FLAC: "flac",
MIME_XFLAC: "flac",
MIME_XWAV: "wav",
MIME_JPEG: "jpg",
MIME_PNG: "png",
2020-10-06 16:59:23 -07:00
}
EXTENSION_TO_TYPE = {
"mp3": MIME_MPEG,
"flac": MIME_FLAC,
"wav": MIME_XWAV,
"jpg": MIME_JPEG,
"png": MIME_PNG,
2020-10-06 16:59:23 -07:00
}
UNKNOWN_MIME = None