-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmedia-tools
executable file
·127 lines (120 loc) · 3.81 KB
/
media-tools
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
commands=(
"Change Volume"
"Compare Audio"
"Convert to Opus"
"Generate Album Sections"
"Lossless Separator"
"Mass Crop Images"
"Mass Thumbnail"
"Remove Audio"
"Remove Metadata"
"Rotate Video"
"Scale Image"
"Sort by Album"
"Sort by Artist"
"Sort by Genre"
"Sort by Resolution"
"View Metadata"
"Quit"
)
selected=0
# Function to display the list and highlight the selected item
display_list() {
clear
echo -e "\033[1m Media Tools\033[0m\n -----------"
for i in "${!commands[@]}"; do
if [ $i -eq $selected ]; then
echo -e "\033[1m➤ ${commands[$i]}\033[0m\n"
else
echo -e " ${commands[$i]}\n"
fi
done
}
# Function to execute the selected command
execute_command() {
case ${commands[$selected]} in
"Change Volume")
python3 ~/Media-Tools/tools/change-volume.py
read -p "Press Enter to return to the menu..."
;;
"Compare Audio")
python3 ~/Media-Tools/tools/compare-audio.py
read -p "Press Enter to return to the menu..."
;;
"Convert to Opus")
python3 ~/Media-Tools/tools/convert-to-opus.py
read -p "Press Enter to return to the menu..."
;;
"Generate Album Sections")
python3 ~/Media-Tools/tools/generate-album-sections.py
read -p "Press Enter to return to the menu..."
;;
"Lossless Separator")
python3 ~/Media-Tools/tools/lossless-separator.py
read -p "Press Enter to return to the menu..."
;;
"Mass Crop Images")
python3 ~/Media-Tools/tools/mass-crop-images.py
read -p "Press Enter to return to the menu..."
;;
"Mass Thumbnail")
python3 ~/Media-Tools/tools/mass-thumbnail.py
read -p "Press Enter to return to the menu..."
;;
"Remove Audio")
python3 ~/Media-Tools/tools/remove-audio.py
read -p "Press Enter to return to the menu..."
;;
"Remove Metadata")
python3 ~/Media-Tools/tools/remove-metadata.py
read -p "Press Enter to return to the menu..."
;;
"Rotate Video")
python3 ~/Media-Tools/tools/rotate-video.py
read -p "Press Enter to return to the menu..."
;;
"Scale Image")
python3 ~/Media-Tools/tools/scale-image.py
read -p "Press Enter to return to the menu..."
;;
"Sort by Album")
python3 ~/Media-Tools/tools/sort-by-album.py
read -p "Press Enter to return to the menu..."
;;
"Sort by Artist")
python3 ~/Media-Tools/tools/sort-by-artist.py
read -p "Press Enter to return to the menu..."
;;
"Sort by Genre")
python3 ~/Media-Tools/tools/sort-by-genre.py
read -p "Press Enter to return to the menu..."
;;
"Sort by Resolution")
python3 ~/Media-Tools/tools/sort-by-resolution.py
read -p "Press Enter to return to the menu..."
;;
"View Metadata")
python3 ~/Media-Tools/tools/view-metadata.py
read -p "Press Enter to return to the menu..."
;;
"Quit")
echo -e "\n\033[1mExiting script\033[0m"
exit 0
;;
*)
echo -e "\nInvalid selection"
;;
esac
}
# Main loop
while true; do
display_list
read -sn 1 key
case $key in
"A") ((selected--)); [ $selected -lt 0 ] && selected=$(( ${#commands[@]} - 1 ));;
"B") ((selected++)); [ $selected -ge ${#commands[@]} ] && selected=0 ;;
"") execute_command ;;
*) ;;
esac
done