This commit is contained in:
MLH
2024-12-12 00:23:34 +01:00
parent 809d4bb50e
commit 86129f2335
2 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ modification_rules:
insert_text: '<div class="seasonals-container"></div><script src="seasonals.js"></script><link rel="stylesheet" href="seasonals.css">' insert_text: '<div class="seasonals-container"></div><script src="seasonals.js"></script><link rel="stylesheet" href="seasonals.css">'
# Page title and requests tab # Page title and requests tab
- before_text: '<link href="main.jellyfin.1ed46a7a22b550acaef3.css?1a23c104c65d0a7517c7" rel="stylesheet">' - before_text: '<link href="main.jellyfin.1ed46a7a22b550acaef3.css?22b44eb501cfeefd535d" rel="stylesheet">'
insert_text: > insert_text: >
<script> <script>
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function () {

View File

@ -173,7 +173,7 @@ def modifyFiles(config, destinationDirectory):
if after_text not in content: #if not re.search(after_text, content): # for use of * wildcard in text if after_text not in content: #if not re.search(after_text, content): # for use of * wildcard in text
raise ValueError(f"Text '{after_text}' not found in file: {filePath}") raise ValueError(f"Text '{after_text}' not found in file: {filePath}")
elif insert_text not in content: elif insert_text not in content:
print(f" {Colors.GREEN}Inserting text after: {after_text} + -> {insert_text}{Colors.RESET}") print(f" {Colors.GREEN}Inserting text after: {after_text} {Colors.YELLOW}+ ->{Colors.GREEN} {insert_text}{Colors.RESET}")
content = content.replace(after_text, after_text + insert_text) content = content.replace(after_text, after_text + insert_text)
else: else:
print(f" {Colors.YELLOW}Text already present after: {after_text}{Colors.RESET}") print(f" {Colors.YELLOW}Text already present after: {after_text}{Colors.RESET}")
@ -186,7 +186,7 @@ def modifyFiles(config, destinationDirectory):
if before_text not in content: if before_text not in content:
raise ValueError(f"Text '{before_text}' not found in file: {filePath}") raise ValueError(f"Text '{before_text}' not found in file: {filePath}")
elif insert_text not in content: elif insert_text not in content:
print(f" {Colors.GREEN}Inserting text before: {insert_text} + <- {before_text}{Colors.RESET}") print(f" {Colors.GREEN}Inserting text before: {insert_text} {Colors.YELLOW}+ <-{Colors.GREEN} {before_text}{Colors.RESET}")
content = content.replace(before_text, insert_text + before_text) content = content.replace(before_text, insert_text + before_text)
else: else:
print(f" {Colors.YELLOW}Text already present before: {before_text}{Colors.RESET}") print(f" {Colors.YELLOW}Text already present before: {before_text}{Colors.RESET}")
@ -199,7 +199,7 @@ def modifyFiles(config, destinationDirectory):
if old_text not in content and new_text not in content: if old_text not in content and new_text not in content:
raise ValueError(f"Text '{old_text}' not found in file: {filePath}") raise ValueError(f"Text '{old_text}' not found in file: {filePath}")
elif new_text not in content: elif new_text not in content:
print(f" {Colors.GREEN}Replacing text: {old_text} -> {new_text}{Colors.RESET}") print(f" {Colors.GREEN}Replacing text: {old_text} {Colors.YELLOW}->{Colors.GREEN} {new_text}{Colors.RESET}")
content = content.replace(old_text, new_text) content = content.replace(old_text, new_text)
else: else:
print(f" {Colors.YELLOW}Text already replaced: {old_text} -> {new_text}{Colors.RESET}") print(f" {Colors.YELLOW}Text already replaced: {old_text} -> {new_text}{Colors.RESET}")