Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
Merge branch 'pr/41' into fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyRacer1337 committed Mar 23, 2022
2 parents d7cb437 + 0210f29 commit 3defe5f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions StashInterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ def populateStudios(self):
allStudios
{
id
aliases
name
url
image_path
Expand Down Expand Up @@ -357,7 +358,7 @@ def findScenes(self, **kwargs):
}
movies
{
movie
movie
{
id
}
Expand Down Expand Up @@ -415,7 +416,7 @@ def addPerformer(self, performer_data):
query = """
mutation performerCreate($input:PerformerCreateInput!) {
performerCreate(input: $input){
id
id
}
}
"""
Expand All @@ -442,7 +443,7 @@ def addStudio(self, studio_data):
query = """
mutation studioCreate($input:StudioCreateInput!) {
studioCreate(input: $input){
id
id
}
}
"""
Expand All @@ -460,7 +461,7 @@ def addTag(self, tag_data):
query = """
mutation tagCreate($input:TagCreateInput!) {
tagCreate(input: $input){
id
id
}
}
"""
Expand Down Expand Up @@ -553,7 +554,7 @@ def updatePerformer(self, performer_data):
id
name
aliases
image_path
image_path
}
}
"""
Expand All @@ -563,15 +564,15 @@ def updatePerformer(self, performer_data):

def scrapePerformerFreeones(self, name):
variables = {}
query = """
query = """
{
scrapePerformerList(scraper_id:"builtin_freeones", query:\"""" + name + """\")
{ name url twitter instagram birthdate ethnicity country eye_color height measurements fake_tits career_length tattoos piercings aliases }
}"""
result = self.callGraphQL(query)
try:
if len(result['data']["scrapePerformerList"]) != 0:
query = """
query = """
query ScrapePerformer($scraped_performer: ScrapedPerformerInput!){
scrapePerformer(scraper_id:"builtin_freeones", scraped_performer: $scraped_performer)
{ url twitter instagram birthdate ethnicity country eye_color height measurements fake_tits career_length tattoos piercings aliases }
Expand Down Expand Up @@ -616,6 +617,9 @@ def getStudioByName(self, name):
for studio in self.studios:
if studio['name'].lower().strip() == name.lower().strip():
return studio
for studio in self.studios:
if name.lower().strip() in list(map(lambda x: x.lower().strip(), studio['aliases'])):
return studio
return None

def getTagByName(self, name, add_tag_if_missing=False):
Expand Down

0 comments on commit 3defe5f

Please sign in to comment.