forked from Github/Axter-Stash
Fix bug when getting number from ID having mix text and number
This commit is contained in:
@@ -1903,7 +1903,7 @@ def updateScenesInReport(fileName, scene):
|
|||||||
idx = line.find(strToFind, idx) + len(strToFind)
|
idx = line.find(strToFind, idx) + len(strToFind)
|
||||||
id = line[idx:]
|
id = line[idx:]
|
||||||
stash.Debug(f"id = {id}, idx = {idx}")
|
stash.Debug(f"id = {id}, idx = {idx}")
|
||||||
id = id[:id.find('"')]
|
id = stash.getNum(id[:id.find('"')])
|
||||||
stash.Debug(f"id = {id}")
|
stash.Debug(f"id = {id}")
|
||||||
if scene1 == -1:
|
if scene1 == -1:
|
||||||
scene1 = int(id)
|
scene1 = int(id)
|
||||||
|
|||||||
@@ -882,6 +882,9 @@ class StashPluginHelper(StashInterface):
|
|||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def getNum(self, data):
|
||||||
|
return ''.join(filter(lambda i: i.isdigit(), data))
|
||||||
|
|
||||||
# ############################################################################################################
|
# ############################################################################################################
|
||||||
# Functions which are candidates to be added to parent class use snake_case naming convention.
|
# Functions which are candidates to be added to parent class use snake_case naming convention.
|
||||||
# ############################################################################################################
|
# ############################################################################################################
|
||||||
|
|||||||
Reference in New Issue
Block a user