OFMetadataToStash
OFMetadataToStash copied to clipboard
Enhancement - Alternate Studio Name and Scene/Image Title
I am not fully versed in proper GitHub collaboration or annotation so I'm raising this here in the event it helps at all.
I made some modifications to your OFMetadataToStash.ps1 script locally to better streamline things and line it up with some of the guidelines for how things should be formatted. Might be a personal preference, or it might be an optional template people can choose between?
Amending the created studio name to be "modelname (OnlyFans)"
Lines 558-568
$StashGQL_QueryVariables = '{
"filter": {
"q": ""
},
"studio_filter": {
"name": {
"value": "'+$performername+' (OnlyFans)",
"modifier": "EQUALS"
}
}
}'
Lines 598-594
$StashGQL_QueryVariables = '{
"input": {
"name": "'+$performername+' (OnlyFans)",
"url": "www.onlyfans.com/'+$performername+'"
}
}'
Changed title to be first sentence of description
REMOVED lines 1005-1009
$proposedtitle = $proposedtitle.replace("'","''")
$proposedtitle = $proposedtitle.replace("\","\\")
$proposedtitle = $proposedtitle.replace('"','\"')
$proposedtitle = $proposedtitle.replace('“','\"') #literally removing the curly quote entirely
$proposedtitle = $proposedtitle.replace('”','\"') #literally removing the curly quote entirely
Added at line 1005-1006
$detailsToAddToStash = $detailsToAddToStash.replace('??','?') #Replace any ?? with a single ? (Somehow ? are being duplicated)
$proposedtitle = ($detailsToAddToStash -split '[\.\?!]')[0]
Link to Parent Studio
I did attempt at trying to get the new 'modelname (OnlyFans)' studio to link up with the parent 'OnlyFans (Network)' studio but couldn't get the query right. Something like this:
#If Stash returns with an ID for 'OnlyFans', great. Otherwise, let's create a new studio
if ($null -eq $OnlyFansStudioID){
$StashGQL_Query = 'mutation StudioCreate($input: StudioCreateInput!) {
studioCreate(input: $input) {
name
url
parent_studio {
name
}
}
}'
$StashGQL_QueryVariables = '{
"input": {
"name": "'+$performername+' (OnlyFans)",
"url": "www.onlyfans.com/'+$performername+'"
"parent_studio": {
"name": "OnlyFans (Network)"
}
}
}'