summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2024-07-03 01:21:19 +0200
committercos <cos>2024-07-03 11:31:23 +0200
commit530d003e1d9956de18ab42a607f37770b3467243 (patch)
tree4488a69f461876c29d2dd4a1a9a90a536eab35cc
parent51e0b338fc72a28b7e50c8ded9eeddb049f8b773 (diff)
downloadAntennaPodDbFixer-530d003e1d9956de18ab42a607f37770b3467243.zip
Support giving empty.db as argument
-rwxr-xr-xAntennaPodDbFixer.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/AntennaPodDbFixer.py b/AntennaPodDbFixer.py
index 15d225a..b506ba6 100755
--- a/AntennaPodDbFixer.py
+++ b/AntennaPodDbFixer.py
@@ -6,7 +6,7 @@ import os
import sys
def usage():
- return sys.argv[0] + " [--help] [corrupt.db]"
+ return sys.argv[0] + " [--help] [corrupt.db] [empty.db]"
if len(sys.argv) > 1:
if sys.argv[1] == "--help":
@@ -38,7 +38,10 @@ if corruptedVersion == "0":
exit(1)
print("Corrupted file version: " + corruptedVersion)
-emptyFilePath = "empty/" + corruptedVersion + ".db"
+if len(sys.argv) > 2:
+ emptyFilePath = sys.argv[2]
+else:
+ emptyFilePath = "empty/" + corruptedVersion + ".db"
if not os.path.isfile(emptyFilePath):
print("If needed, you can download old app versions on F-Droid and export an empty database.")
emptyFilePath = input("Enter file path to an EMPTY AntennaPod database with the same version: ")