1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-10-03 22:17:08 +02:00

Qbittorrent mod: Add clean file note

This commit is contained in:
GilbN 2022-12-20 19:42:15 +01:00
parent 6c07a6fdb3
commit 6aa2647df3
2 changed files with 32 additions and 30 deletions

View File

@ -97,34 +97,35 @@ sed_file(){
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
}
clean_html() {
clean_file() {
perl -i -pe 's/QBT_TR?\(//' "$1"
perl -i -pe 's/\)QBT_TR\[CONTEXT=.*?\]//' "$1"
}
# Adding stylesheets
echo '---------------------------------------'
echo '| Adding the stylesheet to html files |'
echo '---------------------------------------'
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/public/index.html; then
# Adding stylesheets
echo '---------------------------------------'
echo '| Adding the stylesheet to html files |'
echo '---------------------------------------'
sed_file /themepark/public/index.html
clean_html /themepark/public/index.html
clean_file /themepark/public/index.html
# Clean JS files
find /themepark -type f -iname "*.js" | while read fname
do
clean_html $fname
done
fi
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/private/index.html; then
find /themepark/private -type f -iname "*.html" | while read fname
do
sed_file $fname
clean_html $fname
done
fi
# Clean all files
printf 'Cleaning files in /themepark for any translation text...\n\n
--------------------------------------------------------------------------
| !!! RESTART THE CONTAINER IF THIS IS THE FIRST TIME CLEANING FILES !!! |
--------------------------------------------------------------------------\n\n'
find /themepark -type f \( ! -iname "*.svg" \) | while read fname
do
clean_file $fname
done
if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then
echo '--------------------------------------'
echo '| Adding WebUI\RootFolder=/themepark |'

View File

@ -82,34 +82,35 @@ sed_file(){
printf 'Stylesheet set to %s on %s\n\n' "${TP_THEME}" "$1"
}
clean_html() {
clean_file() {
perl -i -pe 's/QBT_TR?\(//' "$1"
perl -i -pe 's/\)QBT_TR\[CONTEXT=.*?\]//' "$1"
}
# Adding stylesheets
echo '---------------------------------------'
echo '| Adding the stylesheet to html files |'
echo '---------------------------------------'
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/public/index.html; then
# Adding stylesheets
echo '---------------------------------------'
echo '| Adding the stylesheet to html files |'
echo '---------------------------------------'
sed_file /themepark/public/index.html
clean_html /themepark/public/index.html
clean_file /themepark/public/index.html
# Clean JS files
find /themepark -type f -iname "*.js" | while read fname
do
clean_html $fname
done
fi
if ! grep -q "${TP_DOMAIN}/css/base" /themepark/private/index.html; then
find /themepark/private -type f -iname "*.html" | while read fname
do
sed_file $fname
clean_html $fname
done
fi
# Clean all files
printf 'Cleaning files in /themepark for any translation text...\n\n
--------------------------------------------------------------------------
| !!! RESTART THE CONTAINER IF THIS IS THE FIRST TIME CLEANING FILES !!! |
--------------------------------------------------------------------------\n\n'
find /themepark -type f \( ! -iname "*.svg" \) | while read fname
do
clean_file $fname
done
if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then
echo '--------------------------------------'
echo '| Adding WebUI\RootFolder=/themepark |'