Edit titlechange.sh script

This commit is contained in:
nomadics9 2025-02-03 20:19:14 +03:00
parent bfa6f0a29a
commit f83e6f0bef
No known key found for this signature in database

View file

@ -1,43 +1,31 @@
# #!/bin/bash #!/bin/sh
#
# # Set the base directory where Jellyfin's files are located
# BASE_DIR="/jellyfin/jellyfin-web"
#
# # Update document.title to "AlaskarTV" in all relevant files
# grep -rl 'document\.title="Jellyfin"' "$BASE_DIR" | while read -r file; do
# sed -i 's/document\.title="Jellyfin"/document\.title="AlaskarTV"/g' "$file"
# done
#
# # Ensure fallback title is also updated to "AlaskarTV"
# grep -rl 'document.title=e||"Jellyfin"' "$BASE_DIR" | while IFS= read -r file; do
# sed -i 's/document.title=e||"Jellyfin"/document.title=e||"AlaskarTV"/g' "$file"
# done
#
# echo "Document titles updated to 'AlaskarTV' in all files!"
#!/bin/bash
# Set the base directory where Jellyfin's files are located # Set the base directory where Jellyfin's files are located
BASE_DIR="/jellyfin/jellyfin-web" BASE_DIR="/jellyfin/jellyfin-web"
# Update document.title to "AlaskarTV" in all relevant files (case-insensitive) # Determine the name of this script so we can exclude it
grep -rli 'document\.title="jellyfin"' "$BASE_DIR" | while IFS= read -r file; do SCRIPT_NAME=$(basename "$0")
# Update document.title to "AlaskarTV" in all relevant files (caseinsensitive),
# excluding this script itself.
grep -rli --exclude="$SCRIPT_NAME" 'document\.title="jellyfin"' "$BASE_DIR" | while IFS= read -r file; do
echo "Updating document.title in: $file" echo "Updating document.title in: $file"
# The 'gI' flags mean "global" and "case-insensitive" # The 'gI' flags mean global replacement and caseinsensitive matching (GNU sed)
sed -i 's/document\.title="jellyfin"/document.title="AlaskarTV"/gI' "$file" sed -i 's/document\.title="jellyfin"/document.title="AlaskarTV"/gI' "$file"
done done
# Update fallback title (case-insensitive) # Update fallback title (caseinsensitive), again excluding this script.
grep -rli 'document.title=e||"jellyfin"' "$BASE_DIR" | while IFS= read -r file; do grep -rli --exclude="$SCRIPT_NAME" 'document.title=e||"jellyfin"' "$BASE_DIR" | while IFS= read -r file; do
echo "Updating fallback title in: $file" echo "Updating fallback title in: $file"
sed -i 's/document.title=e||"jellyfin"/document.title=e||"AlaskarTV"/gI' "$file" sed -i 's/document.title=e||"jellyfin"/document.title=e||"AlaskarTV"/gI' "$file"
done done
# Update enableBackdrops function in main.jellyfin.bundle.js # Update enableBackdrops function in main.jellyfin.bundle.js
# This will change: enableBackdrops:function(){return _} # This changes:
# To: enableBackdrops:function(){return E} # enableBackdrops:function(){return _}
# to:
# enableBackdrops:function(){return E}
FILE="$BASE_DIR/main.jellyfin.bundle.js" FILE="$BASE_DIR/main.jellyfin.bundle.js"
if [[ -f "$FILE" ]]; then if [ -f "$FILE" ]; then
echo "Updating enableBackdrops in: $FILE" echo "Updating enableBackdrops in: $FILE"
sed -i 's/enableBackdrops:function(){return _}/enableBackdrops:function(){return E}/g' "$FILE" sed -i 's/enableBackdrops:function(){return _}/enableBackdrops:function(){return E}/g' "$FILE"
else else