Skip to content

Commit

Permalink
Update for Stash v0.24 (Darklyter#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeLund authored Dec 27, 2023
1 parent bc739cc commit 620bcb8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Contents/Code/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def update(self, metadata, media, lang, force=False):
DEBUG = Prefs['debug']
Log("update(%s)" % metadata.id)
mid = metadata.id
id_query = "query{findScene(id:%s){path,id,title,details,url,date,rating,rating100,paths{screenshot,stream}movies{movie{id,name}}studio{id,name,image_path,parent_studio{id,name,details}}organized,stash_ids{stash_id}tags{id,name}performers{name,image_path,tags{id,name}}movies{movie{name}}galleries{id,title,url,images{id,title,path,file{size,width,height}}}}}"
id_query = "query{findScene(id:%s){id,title,details,url,date,rating100,paths{screenshot,stream}movies{movie{id,name}}studio{id,name,image_path,parent_studio{id,name,details}}organized,stash_ids{stash_id}tags{id,name}performers{name,image_path,tags{id,name}}movies{movie{name}}galleries{id,title,url}}}"
data = HttpReq(id_query % mid)
data = data['data']['findScene']
metadata.collections.clear()
Expand Down Expand Up @@ -205,12 +205,12 @@ def update(self, metadata, media, lang, force=False):
metadata.studio = data["studio"]["name"]

# Get the rating
if not data["rating"] is None:
if not data["rating100"] is None:
stashRating = float(data["rating100"] / 10)
metadata.rating = stashRating
if Prefs["CreateRatingTags"]:
if int(data["rating"]) > 0:
rating = str(int(data["rating"]))
if int(stashRating) > 0:
rating = str(int(stashRating))
ratingstring = "Rating: " + rating + " Stars"
try:
metadata.collections.add(ratingstring)
Expand Down

0 comments on commit 620bcb8

Please sign in to comment.