Added option to include paths for scheduled task

Added rename_generated_files
This commit is contained in:
David Maisonave
2024-08-15 14:50:57 -04:00
parent bbeb0291da
commit 8a23918249
9 changed files with 643 additions and 276 deletions

View File

@@ -37,6 +37,8 @@ class StashPluginHelper(StashInterface):
CALLED_AS_STASH_PLUGIN = False
RUNNING_IN_COMMAND_LINE_MODE = False
FRAGMENT_SERVER = None
STASHPATHSCONFIG = None
STASH_PATHS = []
# printTo argument
LOG_TO_FILE = 1
@@ -71,7 +73,8 @@ class StashPluginHelper(StashInterface):
# Externally modifiable variables
log_to_err_set = LOG_TO_FILE + LOG_TO_STDERR # This can be changed by the calling source in order to customize what targets get error messages
log_to_norm = LOG_TO_FILE + LOG_TO_CONSOLE # Can be change so-as to set target output for normal logging
log_to_wrn_set = LOG_TO_FILE + LOG_TO_STASH # This can be changed by the calling source in order to customize what targets get warning messages
# Warn message goes to both plugin log file and stash when sent to Stash log file.
log_to_wrn_set = LOG_TO_STASH # This can be changed by the calling source in order to customize what targets get warning messages
def __init__(self,
debugTracing = None, # Set debugTracing to True so as to output debug and trace logging
@@ -158,6 +161,9 @@ class StashPluginHelper(StashInterface):
if self.STASH_INTERFACE_INIT:
self.PLUGIN_CONFIGURATION = self.get_configuration()["plugins"]
self.STASH_CONFIGURATION = self.get_configuration()["general"]
self.STASHPATHSCONFIG = self.STASH_CONFIGURATION['stashes']
for item in self.STASHPATHSCONFIG:
self.STASH_PATHS.append(item["path"])
if settings:
self.pluginSettings = settings
if self.PLUGIN_ID in self.PLUGIN_CONFIGURATION:
@@ -312,7 +318,7 @@ class StashPluginHelper(StashInterface):
}
"""
clean_metadata_input = {
"blobFiles": blobFiles,
"blobFiles": blobFiles,
"dryRun": dryRun,
"imageThumbnails": imageThumbnails,
"markers": markers,
@@ -322,10 +328,13 @@ class StashPluginHelper(StashInterface):
}
result = self.call_GQL(query, {"input": clean_metadata_input})
return result
# def find_duplicate_scenes(self, distance: PhashDistance=PhashDistance.EXACT, fragment=None, duration_diff=0):
def rename_generated_files(self):
return self.call_GQL("mutation MigrateHashNaming {migrateHashNaming}")
# def find_duplicate_scenes(self, distance: PhashDistance=PhashDistance.EXACT, fragment=None):
# query = """
# query FindDuplicateScenes($distance: Int) {
# findDuplicateScenes(distance: $distance, duration_diff: $duration_diff) {
# findDuplicateScenes(distance: $distance) {
# ...SceneSlim
# }
# }
@@ -335,13 +344,11 @@ class StashPluginHelper(StashInterface):
# else:
# query = """
# query FindDuplicateScenes($distance: Int) {
# findDuplicateScenes(distance: $distance, duration_diff: $duration_diff) {
# }
# findDuplicateScenes(distance: $distance)
# }
# """
# """
# variables = {
# "distance": distance,
# "duration_diff": duration_diff
# "distance": distance
# }
# result = self.call_GQL(query, variables)
# return result['findDuplicateScenes']