Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
David-Maisonave committed Aug 16, 2024
2 parents 971d0ea + bce5318 commit fdea121
Show file tree
Hide file tree
Showing 31 changed files with 1,042 additions and 184 deletions.
10 changes: 5 additions & 5 deletions plugins/AITagger/ai_tagger.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ async def __tag_images(images):
log.error(f"Error processing image: {result['error']}")
media_handler.add_error_images([id])
else:
actions = result['actions']
action_stashtag_ids = media_handler.get_tag_ids(actions)
action_stashtag_ids.append(media_handler.ai_tagged_tag_id)
media_handler.add_tags_to_image(id, action_stashtag_ids)
tags = media_handler.get_all_tags_from_server_result(result)
stashtag_ids = media_handler.get_tag_ids(tags)
stashtag_ids.append(media_handler.ai_tagged_tag_id)
media_handler.add_tags_to_image(id, stashtag_ids)

log.info(f"Tagged {len(imageIds)} images")
media_handler.remove_tagme_tags_from_images(imageIds)
Expand All @@ -166,7 +166,7 @@ async def __tag_images(images):
except asyncio.TimeoutError as a:
log.error(f"Timeout processing images: {a}")
except Exception as e:
log.error(f"Failed to process images: {e}")
log.error(f"Failed to process images: {e}Stack trace: {traceback.format_exc()}")
media_handler.add_error_images(imageIds)
media_handler.remove_tagme_tags_from_images(imageIds)
finally:
Expand Down
2 changes: 1 addition & 1 deletion plugins/AITagger/ai_tagger.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: AI Tagger
description: Tag videos and Images with Locally hosted AI using Skier's Patreon AI models
version: 1.6
version: 1.7
url: https://github.com/stashapp/CommunityScripts/tree/main/plugins/AITagger
exec:
- python
Expand Down
4 changes: 2 additions & 2 deletions plugins/AITagger/ai_video_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ def __mutate_server_result_tags(cls, server_result, model_name, frame_interval):
tags = {}
for result in server_result:
frame_index = result["frame_index"]
actions = result["actions"]
for action in actions:
alltags = media_handler.get_all_tags_from_server_result(result)
for action in alltags:
tag_name, confidence = action
if tag_name not in tags:
tags[tag_name] = TagData(ai_model_name=model_name, time_frames=[TagTimeFrame(start=frame_index, end=None, confidence=confidence)])
Expand Down
9 changes: 9 additions & 0 deletions plugins/AITagger/media_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ def initialize(connection):

# ----------------- Tag Methods -----------------


tag_categories = ["actions", "bodyparts"]

def get_all_tags_from_server_result(result):
alltags = []
for category in tag_categories:
alltags.extend(result.get(category, []))
return alltags

def get_tag_ids(tag_names):
return [get_tag_id(tag_name) for tag_name in tag_names]

Expand Down
19 changes: 19 additions & 0 deletions plugins/AITagger/tag_mappings.csv
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,22 @@ Undressing,Undressing_AI,15,6,20s,0.5
Vaginal Penetration,Vaginal Penetration_AI,15,6,20s,0.5
Vaginal Fucking,Vaginal Fucking_AI,15,6,20s,0.5
Vibrating,Vibrating_AI,10,6,20s,0.5
Ass,Ass_AI,-1,6,20s,0.5
Asshole,Asshole_AI,-1,6,20s,0.5
Anal Gape,Anal Gape_AI,10,6,20s,0.5
Boobs,Boobs_AI,-1,6,20s,0.5
Cum,Cum_AI,10,6,20s,0.5
Dick,Dick_AI,-1,6,20s,0.5
Face,Face_AI,-1,6,20s,0.5
Feet,Feet_AI,-1,6,20s,0.5
Fingers,Fingers_AI,-1,6,20s,0.5
Belly Button,Belly Button_AI,-1,6,20s,0.5
Nipples,Nipples_AI,-1,6,20s,0.5
Thighs,Thighs_AI,-1,6,20s,0.5
Lower Legs,Lower Legs_AI,-1,6,20s,0.5
Tongue,Tongue_AI,10,6,20s,0.5
Pussy,Pussy_AI,-1,6,20s,0.5
Pussy Gape,Pussy Gape_AI,10,6,20s,0.5
Spit,Spit_AI,10,6,20s,0.5
Oiled,Oiled_AI,10,6,20s,0.5
Wet (Water),Wet (Water)_AI,10,6,20s,0.5
4 changes: 2 additions & 2 deletions plugins/PythonToolsInstaller/PythonToolsInstaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ def run(input, output):

def get_download_py_stashapp_tools(PLUGIN_DIR):

org_packagedir = sysconfig.get_paths()["purelib"] # /usr/lib/python3.11/site-packages/usr/lib/python3.11/site-packages
org_packagedir = sysconfig.get_paths()["purelib"] # /usr/lib/python3.12/site-packages

used_dir = f"{PLUGIN_DIR}"
create(f"{used_dir}/venv/", with_pip=True)

# where requirements.txt is in same dir as this script
subprocess.run([f"{used_dir}/venv/bin/pip", "install", "-r", abspath(f"{used_dir}/packages/stashtools.txt")],stdout=None)

# venv/lib/python3.11/site-packages/stashapp_tools-
# venv/lib/python3.12/site-packages/stashapp_tools-

src = f"{used_dir}/venv/lib/python3.11/site-packages"
destination = shutil.copytree(src, org_packagedir,ignore_func,None,shutil.copy2,False,True)
Expand Down
10 changes: 10 additions & 0 deletions plugins/VideoScrollWheel/VideoScrollWheel.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,21 @@
while (vjsPlayer.currentTime() < newTime) {
vjsPlayer.currentTime(newTime + extraDelta);
++extraDelta;

if (vjsPlayer.currentTime() + extraDelta >= vjsPlayer.duration()) {
vjsPlayer.currentTime(vjsPlayer.duration());
break;
}
}
} else {
while (vjsPlayer.currentTime() > newTime) {
vjsPlayer.currentTime(newTime - extraDelta);
++extraDelta;

if (vjsPlayer.currentTime() - extraDelta <= 0) {
vjsPlayer.currentTime(0);
break;
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/VideoScrollWheel/VideoScrollWheel.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: VideoScrollWheel
# requires: CommunityScriptsUILibrary
description: Adds functionality to change volume/time in scene video player by hovering over left/right side of player and scrolling with mouse scrollwheel. Scroll while hovering on left side to adjust volume, scroll on right side to skip forward/back.
version: 0.3
version: 0.4
settings:
allowVolumeChange:
displayName: Volume change via mouse wheel
Expand Down
19 changes: 19 additions & 0 deletions plugins/cjCardTweaks/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# CJ's Card Tweaks
This plugin contains the various tweaks I've made to my Stash cards for anyone who may be interested. Each tweak will be toggleable, so users have the option to subscribe to some without subscribing to all.

## Tweaks

### File Count on Cards
![Screenshot 2024-07-24 173921](https://github.com/user-attachments/assets/8eaf0dce-a6c2-4d92-aa78-7ddc2322392a)

Scenes, Galleries, or Images with a file count greater than one will have a badge similar to the badge present in the file count tab when more than one file is present. This badge will be located at the top right on the card where the studio logo used to live. ATM, the CSS that relocates the studio logo to the left of the title card, is not included as a toggleable tweak, but I plan to extract that out of my SCSS theme project and incorporate it here as a toggleable tweak. Until then, users who aren't using any other plugins that reposition the studio logo can tweak the CSS to reposition the file count to a new location.

### 3D rating banner
![Screenshot 2024-07-29 131937](https://github.com/user-attachments/assets/64d03cd7-6e31-4373-b831-e99a942216cf)

Adds an additional dimension to the rating banners.

### Performer profile cards
![unnamed_2](https://github.com/user-attachments/assets/f505417d-ed0c-40c4-9c78-647081a41307)

Modify the performer cards to use a traditional profile design
Loading

0 comments on commit fdea121

Please sign in to comment.