pysonic/pysonic/types.py
dave 2de8547ab7
All checks were successful
Gitea/pysonic/pipeline/head This commit looks good
fix tag picking for flac as flac uses different tag names
2022-06-02 15:17:12 -07:00

50 lines
917 B
Python

# known mimes
MIME_MPEG = "audio/mpeg"
MIME_FLAC = "audio/flac"
MIME_XFLAC = "audio/x-flac"
MIME_XWAV = "audio/x-wav"
MIME_JPEG = "image/jpeg"
MIME_PNG = "image/png"
MIME_GIF = "image/gif"
# groupings of similar files by mime
KNOWN_MIMES = [MIME_MPEG, MIME_FLAC, MIME_XFLAC, MIME_XWAV, MIME_JPEG, MIME_PNG]
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]
IMAGE_EXTENSIONS = ["jpg", "jpeg", "png", "gif"]
MUSIC_EXTENSIONS = ["mp3", "flac", "wav"]
TYPE_TO_EXTENSION = {
MIME_MPEG: "mp3",
MIME_FLAC: "flac",
MIME_XFLAC: "flac",
MIME_XWAV: "wav",
MIME_JPEG: "jpg",
MIME_PNG: "png",
}
EXTENSION_TO_TYPE = {
"mp3": MIME_MPEG,
"flac": MIME_FLAC,
"wav": MIME_XWAV,
"jpg": MIME_JPEG,
"png": MIME_PNG,
}
UNKNOWN_MIME = None