forked from dragoonDorise/EmuDeck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.sh
162 lines (123 loc) · 4.18 KB
/
api.sh
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
#!/bin/bash
. $HOME/.config/EmuDeck/backend/functions/all.sh
API_pull(){
local branch=$1
cd ~/.config/EmuDeck/backend && touch ~/emudeck/logs/git.log && git reset --hard && git clean -fd && git checkout $branch && git pull && appImageInit && echo "OK" || echo "KO" >&2
}
API_autoSave(){
RetroArch_autoSave 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_bezels(){
RetroArch_setBezels 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_shaders_LCD(){
RetroArch_setShadersMAT 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_shaders_CRT(){
RetroArch_setShadersCRT 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_shaders_3D(){
RetroArch_setShaders3DCRT 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_ar_snes(){
if [ "$arSnes" == 87 ]; then
RetroArch_snes_ar87 1> /dev/null && RetroArch_nes_ar87 1> /dev/null && echo "OK" || echo "KO" >&2
else
RetroArch_snes_ar43 1> /dev/null && RetroArch_nes_ar43 1> /dev/null && echo "OK" || echo "KO" >&2
fi
}
API_ar_sega(){
RetroArch_mastersystem_ar32 1> /dev/null && RetroArch_genesis_ar32 1> /dev/null && RetroArch_segacd_ar32 1> /dev/null && RetroArch_sega32x_ar32 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_ar_gamecube(){
Dolphin_setCustomizations 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_setAR(){
RetroArch_setCustomizations 1> /dev/null && Xemu_setCustomizations 1> /dev/null && DuckStation_setCustomizations 1> /dev/null && PCSX2QT_setCustomizations 1> /dev/null && Dolphin_setCustomizations 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_setCloud(){
if [ $cloud_sync_status == "false" ]; then
setSetting cloud_sync_status "true" 1> /dev/null && echo "OK" || echo "KO" >&2
else
setSetting cloud_sync_status "false" 1> /dev/null && echo "OK" || echo "KO" >&2
fi
}
API_setToken(){
local token=$1
local user=$2
echo $token > "$HOME/.config/EmuDeck/.rat" && echo $user > "$HOME/.config/EmuDeck/.rau" && RetroArch_retroAchievementsSetLogin && DuckStation_retroAchievementsSetLogin && PCSX2QT_retroAchievementsSetLogin && echo "OK" || echo "KO" >&2
}
API_getToken(){
local escapedUserName=$1
local escapedPass=$2
curl --location --data-urlencode u='$escapedUserName' --data-urlencode p='$escapedPass' --request POST 'https://retroachievements.org/dorequest.php?r=login' && echo "OK" || echo "KO" >&2
}
API_cloudSyncHealth(){
cloudSyncHealth 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_RetroArch_install(){
RetroArch_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Dolphin_install(){
Dolphin_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_PrimeHack_install(){
PrimeHack_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_PPSSPP_install(){
PPSSPP_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_DuckStation_install(){
DuckStation_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_melonDS_install(){
melonDS_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Citra_install(){
Citra_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_PCSX2_install(){
PCSX2_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_RPCS3_install(){
RPCS3_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Yuzu_install(){
Yuzu_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Ryujinx_install(){
Ryujinx_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Xemu_install(){
Xemu_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_SRM_install(){
SRM_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_RMG_install(){
RMG_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_MAME_install(){
MAME_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Vita3K_install(){
Vita3K_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Flycast_install(){
Flycast_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_ScummVM_install(){
ScummVM_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Xenia_install(){
Xenia_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_mGBA_install(){
mGBA_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_ESDE_install(){
ESDE_install 1> /dev/null && echo "OK" || echo "KO" >&2
}
API_Pegasus_install(){
Pegasus_install 1> /dev/null && echo "OK" || echo "KO" >&2
}