forked from Github/Axter-Stash
Compare commits
9 Commits
10b329afad
...
6ef3c77735
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ef3c77735 | ||
|
|
fae44f7678 | ||
|
|
5d92f387fa | ||
|
|
b802233efa | ||
|
|
899053cdbc | ||
|
|
d2eb18e217 | ||
|
|
85104e6b15 | ||
|
|
3b029943bd | ||
|
|
1eae580325 |
1
plugins/DupFileManager/.python-version
Normal file
1
plugins/DupFileManager/.python-version
Normal file
@@ -0,0 +1 @@
|
||||
3.12.7
|
||||
@@ -196,17 +196,17 @@ matchPhaseDistanceText = "Exact Match"
|
||||
logTraceForAdvanceMenuOpt = False
|
||||
if (stash.PLUGIN_TASK_NAME == "tag_duplicates_task" or stash.PLUGIN_TASK_NAME == "create_duplicate_report_task") and 'Target' in stash.JSON_INPUT['args']:
|
||||
stash.enableProgressBar(False)
|
||||
if stash.JSON_INPUT['args']['Target'].startswith("0"):
|
||||
if str(stash.JSON_INPUT['args']['Target']).startswith("0"):
|
||||
matchDupDistance = 0
|
||||
elif stash.JSON_INPUT['args']['Target'].startswith("1"):
|
||||
elif str(stash.JSON_INPUT['args']['Target']).startswith("1"):
|
||||
matchDupDistance = 1
|
||||
elif stash.JSON_INPUT['args']['Target'].startswith("2"):
|
||||
elif str(stash.JSON_INPUT['args']['Target']).startswith("2"):
|
||||
matchDupDistance = 2
|
||||
elif stash.JSON_INPUT['args']['Target'].startswith("3"):
|
||||
elif str(stash.JSON_INPUT['args']['Target']).startswith("3"):
|
||||
matchDupDistance = 3
|
||||
|
||||
stash.Trace(f"Target = {stash.JSON_INPUT['args']['Target']}")
|
||||
targets = stash.JSON_INPUT['args']['Target'].split(":")
|
||||
targets = str(stash.JSON_INPUT['args']['Target']).split(":")
|
||||
if len(targets) > 1:
|
||||
significantTimeDiff = float(targets[1])
|
||||
excludeFromReportIfSignificantTimeDiff = True
|
||||
@@ -973,7 +973,7 @@ def writeRowToHtmlReport(fileHtmlReport, DupFile, DupFileToKeep, itemIndex, tagD
|
||||
|
||||
fileHtmlReport.write(f"</tr>{ToDeleteSceneIDSrchStr}{DupFile['id']}{ToKeepSceneIDSrchStr}{DupFileToKeep['id']}{itemIndexSrchStr}{itemIndex}:: -->\n")
|
||||
|
||||
fragmentForSceneDetails = 'id tags {id name ignore_auto_tag} groups {group {name} } performers {name} galleries {id} files {path width height duration size video_codec bit_rate frame_rate} details '
|
||||
fragmentForSceneDetails = 'id tags {id name ignore_auto_tag} groups {group {name} } performers {id name} galleries {id} files {path width height duration size video_codec bit_rate frame_rate} details '
|
||||
htmlFileData = " paths {screenshot sprite webp " + htmlPreviewOrStream + "} "
|
||||
mergeFieldData = " code director title rating100 date studio {id name} urls "
|
||||
fragmentForSceneDetails += mergeFieldData + htmlFileData
|
||||
|
||||
@@ -50,7 +50,7 @@ report_config = {
|
||||
# If enabled, create an HTML report when tagging duplicate files
|
||||
"createHtmlReport" : True,
|
||||
# To use a private or an alternate site to access report and advance menu
|
||||
"remoteReportDirURL" : "https://stash.axter.com/1.1/",
|
||||
"remoteReportDirURL" : "https://stash.tremendousturtle.tools/custom/",
|
||||
# To use a private or an alternate site to access jquery, easyui, and jquery.prompt
|
||||
"js_DirURL" : "https://www.axter.com/js/",
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ def modulesInstalled(moduleNames, install=True, silent=False):
|
||||
else:
|
||||
if install and (results:=installModule(moduleName)) > 0:
|
||||
if results == 1:
|
||||
print(f"Module {moduleName!r} has been installed")
|
||||
if not silent: print(f"Module {moduleName!r} has been installed")
|
||||
else:
|
||||
if not silent: print(f"Module {moduleName!r} is already installed")
|
||||
continue
|
||||
@@ -37,7 +37,7 @@ def modulesInstalled(moduleNames, install=True, silent=False):
|
||||
except ImportError as e:
|
||||
if install and (results:=installModule(moduleName)) > 0:
|
||||
if results == 1:
|
||||
print(f"Module {moduleName!r} has been installed")
|
||||
if not silent: print(f"Module {moduleName!r} has been installed")
|
||||
else:
|
||||
if not silent: print(f"Module {moduleName!r} is already installed")
|
||||
continue
|
||||
@@ -73,6 +73,7 @@ def installModule(moduleName):
|
||||
pipArg = " --disable-pip-version-check"
|
||||
if isDocker():
|
||||
pipArg += " --break-system-packages"
|
||||
pipArg += " --root-user-action ignore"
|
||||
results = os.popen(f"{sys.executable} -m pip install {moduleName}{pipArg}").read() # May need to be f"{sys.executable} -m pip install {moduleName}"
|
||||
results = results.strip("\n")
|
||||
if results.find("Requirement already satisfied:") > -1:
|
||||
|
||||
@@ -511,20 +511,25 @@ class StashPluginHelper(StashInterface):
|
||||
if self._mergeMetadata == None:
|
||||
self.initMergeMetadata(excludeMergeTags)
|
||||
errMsg = None
|
||||
stopRetry = False
|
||||
for i in range(0, retryCount):
|
||||
try:
|
||||
if errMsg != None:
|
||||
self.Warn(errMsg)
|
||||
if type(SrcData) is int:
|
||||
SrcData = self.find_scene(SrcData)
|
||||
DestData = self.find_scene(DestData)
|
||||
return self._mergeMetadata.merge(SrcData, DestData)
|
||||
except (requests.exceptions.ConnectionError, ConnectionResetError):
|
||||
except (requests.exceptions.ConnectionError, ConnectionResetError) as e:
|
||||
tb = traceback.format_exc()
|
||||
errMsg = f"Exception calling [mergeMetadata]. Will retry; count({i}); Error: {e}\nTraceBack={tb}"
|
||||
except Exception as e:
|
||||
tb = traceback.format_exc()
|
||||
errMsg = f"Exception calling [mergeMetadata]. Will retry; count({i}); Error: {e}\nTraceBack={tb}"
|
||||
errMsg = f"Data Exception calling [mergeMetadata]. Will not retry; count({i}); Error: {e}\nTraceBack={tb}"
|
||||
stopRetry = True
|
||||
|
||||
if errMsg != None:
|
||||
self.Warn(errMsg)
|
||||
if stopRetry:
|
||||
break
|
||||
time.sleep(sleepSecondsBetweenRetry)
|
||||
|
||||
def getUpdateProgressBarIter(self, qtyResults):
|
||||
@@ -962,9 +967,9 @@ class StashPluginHelper(StashInterface):
|
||||
}
|
||||
"""
|
||||
if fragment:
|
||||
query = re.sub(r'\.\.\.SceneSlim', fragment, query)
|
||||
query = re.sub(r'\.\.\.SceneSlim', fragment, query)
|
||||
else:
|
||||
query += "fragment SceneSlim on Scene { id }"
|
||||
query += "fragment SceneSlim on Scene { id }"
|
||||
|
||||
variables = { "distance": distance, "duration_diff": duration_diff }
|
||||
result = self.call_GQL(query, variables)
|
||||
|
||||
Reference in New Issue
Block a user