mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-02-04 20:04:27 -06:00
Update renamerOnUpdate.py (#7)
This commit is contained in:
parent
08ed338414
commit
f35b7470ab
@ -479,9 +479,11 @@ if (os.path.isfile(current_path) == True):
|
||||
f.write("{}|{}|{}\n".format(FRAGMENT_SCENE_ID, current_path, new_path))
|
||||
f.close()
|
||||
else:
|
||||
log.LogWarning("[OS] File failed to rename ? {}".format(new_path))
|
||||
log.LogError("[OS] File failed to rename ? {}".format(new_path))
|
||||
sys.exit(1)
|
||||
else:
|
||||
log.LogWarning("[OS] File don't exist in your Disk/Drive ({})".format(current_path))
|
||||
log.LogError("[OS] File don't exist in your Disk/Drive ({})".format(current_path))
|
||||
sys.exit(1)
|
||||
|
||||
# Database rename
|
||||
cursor.execute("UPDATE scenes SET path=? WHERE id=?;", [new_path, FRAGMENT_SCENE_ID])
|
||||
@ -492,3 +494,5 @@ sqliteConnection.close()
|
||||
log.LogInfo("[SQLITE] Database updated!")
|
||||
|
||||
print("{'output':'Hook 'Update' Plugin finished.'}\n")
|
||||
|
||||
# Last Updated July 02, 2021
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user