-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstants.py
More file actions
81 lines (72 loc) · 3.25 KB
/
constants.py
File metadata and controls
81 lines (72 loc) · 3.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
ART = r"""
███╗ ███╗██╗ ██╗████████╗ █████╗ ███╗ ██╗████████╗ ███╗ ██╗ ██████╗ ████████╗███████╗
████╗ ████║██║ ██║╚══██╔══╝██╔══██╗████╗ ██║╚══██╔══╝ ████╗ ██║██╔═══██╗╚══██╔══╝██╔════╝
██╔████╔██║██║ ██║ ██║ ███████║██╔██╗ ██║ ██║ ██╔██╗ ██║██║ ██║ ██║ █████╗
██║╚██╔╝██║██║ ██║ ██║ ██╔══██║██║╚██╗██║ ██║ ██║╚██╗██║██║ ██║ ██║ ██╔══╝
██║ ╚═╝ ██║╚██████╔╝ ██║ ██║ ██║██║ ╚████║ ██║ ██║ ╚████║╚██████╔╝ ██║ ███████╗
╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚══════╝
M U T A N T - N O T E
"""
SINGLE = "Single"
ALBUM = "Album"
BATCH = "Batch"
PER_FILE = "Per file"
info_fields = [
("title", "Title"),
("artist", "Artist"),
("album", "Album"),
("year", "Year"),
("genre", "Genre"),
("track", "Track"),
("tracks", "Tracks"),
("disk", "Disk"),
("disks", "Disks"),
("compositor", "Compositor"),
("albumArtist", "AlbumArtist"),
("comments", "Comments"),
("lyrics", "Lyrics (from text file)"),
("image", "Image (from image)"),
("bpm", "BPM"),
("isrc", "ISRC"),
]
info_list = [key for key, _ in info_fields]
info_list_labels = [label for _, label in info_fields]
empty_info = {key: "" for key in info_list}
file_extensions_supported = [
".mp3", ".flac", ".ogg", ".opus",
".mp4", ".m4a", ".m4b", ".m4p", ".m4v",
".3gp", ".asf", ".wma", ".wmv", ".aif",
".aiff", ".wav",
]
_ID3_FIELDS = [
"title", "artist", "album", "year", "genre",
"track", "tracks", "disk", "disks",
"compositor", "albumArtist", "comments",
"image", "bpm", "isrc",
]
_VORBIS_FIELDS = [
"title", "artist", "album", "year", "genre",
"track", "tracks", "disk", "disks", "image", "isrc",
]
_FLAC_FIELDS = [
"title", "artist", "album", "year", "genre",
"track", "image", "isrc",
]
_ASF_FIELDS = [
"title", "artist", "album", "year", "genre",
"track", "comments", "compositor", "albumArtist",
"image", "bpm", "isrc",
]
metadata_by_file_extension = {
ext: _ID3_FIELDS
for ext in [".mp3", ".mp4", ".m4a", ".m4b", ".m4p", ".m4v",
".3gp", ".aif", ".aiff", ".wav"]
} | {
ext: _VORBIS_FIELDS
for ext in [".ogg", ".opus"]
} | {
ext: _ASF_FIELDS
for ext in [".asf", ".wma", ".wmv"]
} | {
".flac": _FLAC_FIELDS,
}