Removed unneeded string processing when syncing entries

Former-commit-id: 2e8a632d487013cfd68ff8e2898a12b302bebd4c
Former-commit-id: 2253b64577cff33cf564fbbc31f0d2b62a39fdff
This commit is contained in:
2023-06-03 19:45:16 -04:00
parent 1040a6f2ed
commit 227924cd81
+4 -6
View File
@@ -159,19 +159,17 @@ def run_profile(_profile_dir, _silent):
if int(_index_local[1][_i]) > int(_index_remote[1][_i]):
print(f"\u001b[38;5;4m{_title[:-4]}\u001b[0m is newer locally, uploading...")
run(('scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5], _user_data[3] + _title,
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{'/'.join(_title.split('/')[:-1]) + '/'}"))
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}"))
elif int(_index_local[1][_i]) < int(_index_remote[1][_i]):
print(f"\u001b[38;5;2m{_title[:-4]}\u001b[0m is newer remotely, downloading...")
run(('scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5],
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}",
f"{_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}"))
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}", f"{_user_data[3]}{_title}"))
else:
print(f"\u001b[38;5;4m{_title[:-4]}\u001b[0m is not on remote server, uploading...")
run(('scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5], _user_data[3] + _title,
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{'/'.join(_title.split('/')[:-1]) + '/'}"))
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}"))
for _title in _index_remote[0]:
if _title not in _index_local[0]:
print(f"\u001b[38;5;2m{_title[:-4]}\u001b[0m is not in local directory, downloading...")
run(('scp', '-pqs', '-P', _user_data[2], '-i', _user_data[5],
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}",
f"{_user_data[3]}{'/'.join(_title.split('/')[:-1]) + '/'}"))
f"{_user_data[0]}@{_user_data[1]}:{_user_data[4]}{_title}", f"{_user_data[3]}{_title}"))