Change DB name and path to adapt to DSM7

Luckily in our case only the database name and the name of the
directory where the files are saved have changed.
This commit is contained in:
Jeena 2021-08-25 03:32:55 +02:00
parent 44aa4989da
commit 1f6f2cd6be
3 changed files with 4 additions and 4 deletions

View file

@ -93,7 +93,7 @@ if __name__ == "__main__":
names = "richard|yingfen"
pictures = synology.fetch_paths_for_names(conn, names, 20)
synology.close_db(conn)
dirpath = synology.fetch_files("jeena@" + host_ip, "/var/services/homes/jeena/Drive", pictures)
dirpath = synology.fetch_files("jeena@" + host_ip, "/var/services/homes/jeena/Photos", pictures)
creds = get_creds()
gclient = login_gphoto(creds)

2
ha.py
View file

@ -28,7 +28,7 @@ if __name__ == "__main__":
names = "richard|yingfen"
pictures = synology.fetch_paths_for_names(conn, names, 20)
synology.close_db(conn)
dirpath = synology.fetch_files("jeena@" + host_ip, "/var/services/homes/jeena/Drive", pictures)
dirpath = synology.fetch_files("jeena@" + host_ip, "/var/services/homes/jeena/Photos", pictures)
with os.scandir(dirpath) as dirs:
for i, entry in enumerate(dirs):

View file

@ -8,7 +8,7 @@ import os
def connect_db(db_host, db_user, db_passwd):
return psycopg2.connect(
host=db_host,
database="synophoto",
database="synofoto",
user=db_user,
password=db_passwd)
@ -50,5 +50,5 @@ if __name__ == "__main__":
names = "richard|yingfen"
pictures = fetch_paths_for_names(conn, names, 5)
close_db(conn)
dirpath = fetch_files("jeena@" + host_ip, "/var/services/homes/jeena/Drive", pictures)
dirpath = fetch_files("jeena@" + host_ip, "/var/services/homes/jeena/Photos", pictures)
shutil.rmtree(dirpath)