Skip to content

Commit

Permalink
Merge https://github.com/stashapp/CommunityScripts into timestamp-trade2
Browse files Browse the repository at this point in the history
  • Loading branch information
Tweeticoats authored and Tweeticoats committed Dec 27, 2023
2 parents 593760e + adc642c commit aa520df
Show file tree
Hide file tree
Showing 47 changed files with 6,538 additions and 1,405 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Deploy repository to Github Pages

on:
push:
branches: [ main, stable ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

jobs:
build:
runs-on: ubuntu-22.04
steps:
- name: Checkout main
uses: actions/checkout@v2
with:
path: main
ref: main
fetch-depth: '0'
- run: |
cd main
./build_site.sh ../_site/stable
- name: Checkout dev
uses: actions/checkout@v2
with:
path: dev
# change this ref to whatever dev branch/tag we need when necessary
ref: main
fetch-depth: '0'
- run: |
cd dev
../main/build_site.sh ../_site/develop
- uses: actions/upload-pages-artifact@v2

deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-22.04
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/_site
47 changes: 26 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,35 +14,40 @@ When downloading directly click on the file you want and then make sure to click
# Plugin and Script Directory
This list keeps track of scripts and plugins in this repository. Please ensure the list is kept in alphabetical order.

## NOTE: BREAKING CHANGES
The upcoming v24 release (and the current development branch) have breaking changes to schema, and also plugin changes.
We're beginning to review plugins and the rest and patch them to work, but it's an ongoing process.
We'll update the table below as we do this, but we STRONGLY recommend you do not use the development branch unless you are prepared to help with the patching.
We will also be rearranging things a bit, and updating documentation (including this page)

## Plugins

Category|Triggers|Plugin Name|Description|Minimum Stash version
--------|-----------|-----------|-----------|---------------------
Scraper|Task|[GHScraper_Checker](plugins/GHScraper_Checker)|Compare local file against github file from the community scraper repo.|v0.8
Maintenance|Task<br />Scene.Update|[renamerOnUpdate](plugins/renamerOnUpdate)|Rename/Move your file based on Stash metadata.|v0.7
Maintenance|Set Scene Cover|[setSceneCoverFromFile](plugins/setSceneCoverFromFile)|Searchs Stash for Scenes with a cover image in the same folder and sets the cover image in stash to that image|v0.7
Scenes|SceneMarker.Create<br />SceneMarker.Update|[markerTagToScene](plugins/markerTagToScene)|Adds primary tag of Scene Marker to the Scene on marker create/update.|v0.8 ([46bbede](https://github.com/stashapp/stash/commit/46bbede9a07144797d6f26cf414205b390ca88f9))
Scanning|Scene.Create<br />Gallery.Create<br />Image.Create|[defaultDataForPath](plugins/defaultDataForPath)|Adds configured Tags, Performers and/or Studio to all newly scanned Scenes, Images and Galleries..|v0.8
Scanning|Scene.Create<br />Gallery.Create|[filenameParser](plugins/filenameParser)|Tries to parse filenames, primarily in {studio}.{year}.{month}.{day}.{performer1firstname}.{performer1lastname}.{performer2}.{title} format, into the respective fields|v0.10
Scanning|Scene.Create|[pathParser](plugins/pathParser)|Updates scene info based on the file path.|v0.17
Scanning|Scene.Create|[titleFromFilename](plugins/titleFromFilename)|Sets the scene title to its filename|v0.17
Reporting||[TagGraph](plugins/tagGraph)|Creates a visual of the Tag relations.|v0.7
Category|Triggers|Plugin Name|Description|Minimum Stash version|Updated for v24|
--------|-----------|-----------|-----------|---------------------|-----
Scraper|Task|[GHScraper_Checker](plugins/GHScraper_Checker)|Compare local file against github file from the community scraper repo.|v0.8|:x:
Maintenance|Task<br />Scene.Update|[renamerOnUpdate](plugins/renamerOnUpdate)|Rename/Move your file based on Stash metadata.|v0.7|:x:
Maintenance|Set Scene Cover|[setSceneCoverFromFile](plugins/setSceneCoverFromFile)|Searchs Stash for Scenes with a cover image in the same folder and sets the cover image in stash to that image|v0.7|:x:
Scenes|SceneMarker.Create<br />SceneMarker.Update|[markerTagToScene](plugins/markerTagToScene)|Adds primary tag of Scene Marker to the Scene on marker create/update.|v0.8 ([46bbede](https://github.com/stashapp/stash/commit/46bbede9a07144797d6f26cf414205b390ca88f9))|:x:
Scanning|Scene.Create<br />Gallery.Create<br />Image.Create|[defaultDataForPath](plugins/defaultDataForPath)|Adds configured Tags, Performers and/or Studio to all newly scanned Scenes, Images and Galleries..|v0.8|:x:
Scanning|Scene.Create<br />Gallery.Create|[filenameParser](plugins/filenameParser)|Tries to parse filenames, primarily in {studio}.{year}.{month}.{day}.{performer1firstname}.{performer1lastname}.{performer2}.{title} format, into the respective fields|v0.10|:x:
Scanning|Scene.Create|[pathParser](plugins/pathParser)|Updates scene info based on the file path.|v0.17|:x:
Scanning|Scene.Create|[titleFromFilename](plugins/titleFromFilename)|Sets the scene title to its filename|v0.17|:x:
Reporting||[TagGraph](plugins/tagGraph)|Creates a visual of the Tag relations.|v0.7|:x:

## Themes

Theme Name|Description |
----------|--------------------------------------------|
[Plex](themes/plex) |Theme inspired by the popular Plex Interface|
Theme Name|Description |Updated for v24|
----------|--------------------------------------------|----
[Plex](themes/plex) |Theme inspired by the popular Plex Interface|:x:

## Utility Scripts

|Category|Userscript Name|Description|
---------|---------------|-----------|
StashDB |[StashDB Submission Helper](/userscripts/StashDB_Submission_Helper)|Adds handy functions for StashDB submissions like buttons to add aliases in bulk to a performer|
|Category|Userscript Name|Description|Updated for v24|
---------|---------------|-----------|----
StashDB |[StashDB Submission Helper](/userscripts/StashDB_Submission_Helper)|Adds handy functions for StashDB submissions like buttons to add aliases in bulk to a performer|:x:

## Utility Scripts

Category|Plugin Name|Description|Minimum Stash version
--------|-----------|-----------|---------------------
Kodi|[Kodi Helper](scripts/kodi-helper)|Generates `nfo` and `strm` for use with Kodi.|v0.7
Maintenance|[Stash Sqlite Renamer](scripts/Sqlite_Renamer)|Renames your files using stash's metadata.|v0.7
Category|Plugin Name|Description|Minimum Stash version|Updated for v24|
--------|-----------|-----------|---------------------|----
Kodi|[Kodi Helper](scripts/kodi-helper)|Generates `nfo` and `strm` for use with Kodi.|v0.7|:x:
72 changes: 72 additions & 0 deletions build_site.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
#!/bin/bash

# builds a repository of scrapers
# outputs to _site with the following structure:
# index.yml
# <scraper_id>.zip
# Each zip file contains the scraper.yml file and any other files in the same directory

outdir="$1"
if [ -z "$outdir" ]; then
outdir="_site"
fi

rm -rf "$outdir"
mkdir -p "$outdir"

buildPlugin()
{
f=$1

if grep -q "^#pkgignore" "$f"; then
return
fi

# get the scraper id from the directory
dir=$(dirname "$f")
plugin_id=$(basename "$f" .yml)

echo "Processing $plugin_id"

# create a directory for the version
version=$(git log -n 1 --pretty=format:%h -- "$dir"/*)
updated=$(TZ=UTC0 git log -n 1 --date="format-local:%F %T" --pretty=format:%ad -- "$dir"/*)

# create the zip file
# copy other files
zipfile=$(realpath "$outdir/$plugin_id.zip")

pushd "$dir" > /dev/null
zip -r "$zipfile" . > /dev/null
popd > /dev/null

name=$(grep "^name:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
description=$(grep "^description:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
ymlVersion=$(grep "^version:" "$f" | head -n 1 | cut -d' ' -f2- | sed -e 's/\r//' -e 's/^"\(.*\)"$/\1/')
version="$ymlVersion-$version"
dep=$(grep "^# requires:" "$f" | cut -c 12- | sed -e 's/\r//')

# write to spec index
echo "- id: $plugin_id
name: $name
metadata:
description: $description
version: $version
date: $updated
path: $plugin_id.zip
sha256: $(sha256sum "$zipfile" | cut -d' ' -f1)" >> "$outdir"/index.yml

# handle dependencies
if [ ! -z "$dep" ]; then
echo " requires:" >> "$outdir"/index.yml
for d in ${dep//,/ }; do
echo " - $d" >> "$outdir"/index.yml
done
fi

echo "" >> "$outdir"/index.yml
}

find ./plugins -mindepth 1 -name *.yml | while read file; do
buildPlugin "$file"
done
11 changes: 11 additions & 0 deletions plugins/CropperJS/CropperJS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Cropper.JS
description: Exports cropper.js functionality for JS/Userscripts
version: 1.6.1
ui:
css:
- cropper.css
javascript:
- cropper.js

# note - not minimized for more transparency around updates & diffs against source code
# https://github.com/fengyuanchen/cropperjs/tree/main/dist
Loading

0 comments on commit aa520df

Please sign in to comment.