remove rename camera sh and add syncNC to py script
This commit is contained in:
1 parent
6e369c3656
commit
e4ebc3c5b2
2 files changed
+8
-14
No files matched your search
@@ -8,12 +8,14 @@ from PIL import Image, ExifTags
|
|||||||
from pillow_heif import open_heif
|
from pillow_heif import open_heif
|
||||||
import subprocess
|
import subprocess
|
||||||
import json
|
import json
|
||||||
from serverlibary import safe_rename
|
from serverlibrary import safe_rename
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
# Folder to scan
|
# Folder to scan
|
||||||
folder_path = '.'
|
folder_path = '.'
|
||||||
# Supported image and video extensions
|
# Supported image and video extensions
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
video_extensions = {
|
video_extensions = {
|
||||||
'.mp4', '.mov', '.avi', '.mkv', '.hevc', '.mov',
|
'.mp4', '.mov', '.avi', '.mkv', '.hevc', '.mov',
|
||||||
}
|
}
|
||||||
@@ -280,14 +282,14 @@ def process_images(folder):
|
|||||||
# ---- Main script entry ----
|
# ---- Main script entry ----
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
print("Usage: python script.py <image_folder_path>")
|
folder_path = "/data/nextcloud/syncuser/pictures/Camera"
|
||||||
sys.exit(1)
|
else:
|
||||||
|
folder_path = sys.argv[1]
|
||||||
folder_path = sys.argv[1]
|
|
||||||
|
|
||||||
if not os.path.isdir(folder_path):
|
if not os.path.isdir(folder_path):
|
||||||
print(f"Error: '{folder_path}' is not a valid directory.")
|
print(f"Error: '{folder_path}' is not a valid directory.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
subprocess.run(["syncNC", "-c"])
|
||||||
print(f"Processing images in: {os.path.abspath(folder_path)}\n")
|
print(f"Processing images in: {os.path.abspath(folder_path)}\n")
|
||||||
process_images(folder_path)
|
process_images(folder_path)
|
||||||
|
subprocess.run(["syncNC", "-c"])
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
FOLDER=/data/nextcloud/syncuser/pictures/Camera/
|
|
||||||
|
|
||||||
export PYTHONPATH=/home/lucas/scripts
|
|
||||||
syncNC -c
|
|
||||||
/home/lucas/scripts/file\ processing/rename_camera_folder.py ${FOLDER}
|
|
||||||
|
|
||||||
syncNC -c
|
|
||||||
Reference in new issue
Block a user