Giter Site home page Giter Site logo

stashapp / communityscripts Goto Github PK

View Code? Open in Web Editor NEW
174.0 15.0 130.0 1.66 MB

This is a public repository containing plugin and utility scripts created by the Stash Community.

Home Page: https://docs.stashapp.cc/add-ons/

License: GNU Affero General Public License v3.0

JavaScript 58.63% Python 10.80% CSS 30.47% Dockerfile 0.02% Shell 0.09%
hacktoberfest community-project css javascript python

communityscripts's Introduction

CommunityScripts Repository

This repository contains plugin and utility scripts created by the Stash community and hosted on the official GitHub repo.

There is also a list of third-party plugins in our documentation.

Please note: V24 now uses an installer

We recommend you use that to install (and update) plugins.

Manual installs are not recommended, and you shouldn't do so unless you otherwise know what you are doing.

How To Install

To download a plugin in Stash v24, the CommunityScripts repo source is automatically installed by default.

This default source is located at https://stashapp.github.io/CommunityScripts/stable/index.yml

Plugin, Themes, and Scripts Directory

We used to list all community supported plugins, themes, and scripts in this repository... but with the changes in v24, ANY items installable by the plugin installer will no longer listed here. Use the Plugin Installer built into Stash.

We will continue to list the items NOT otherwise installable in this way below.

NOTE: BREAKING CHANGES

The recent v24 release (and future development branches) had major breaking changes to old schema and 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... We will also be rearranging things a bit, and updating documentation (including this page)

Plugins will no longer be listed individually here...

Category Triggers Plugin Name Description Minimum Stash version Updated for v24
Maintenance Task
Scene.Update
renamerOnUpdate Rename/Move your file based on Stash metadata. v2.4 ✅ STOPGAP
Maintenance Set Scene Cover 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
SceneMarker.Update
markerTagToScene Adds primary tag of Scene Marker to the Scene on marker create/update. v0.8 (46bbede)
Scanning Scene.Create
Gallery.Create
Image.Create
defaultDataForPath Adds configured Tags, Performers and/or Studio to all newly scanned Scenes, Images and Galleries.. v0.8
Scanning Scene.Create
Gallery.Create
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 Updates scene info based on the file path. v0.17
Scanning Scene.Create titleFromFilename Sets the scene title to its filename v0.17
Reporting TagGraph Creates a visual of the Tag relations. v0.7

Themes

A Variety of Themes are now available to be one click installed via the Plugin Setting page in your Stash

We welcome new themes, as well as patches to existing themes.

Utility Scripts

Category Name Description Updated for v24
StashDB StashDB Submission Helper Adds handy functions for StashDB submissions like buttons to add aliases in bulk to a performer
Kodi Kodi Helper Generates nfo and strm for use with Kodi. v0.7

Contributing

Formatting

Formatting is enforced on all files. Follow this setup guide:

  1. Yarn and its dependencies must be installed to run the formatting tools.

    yarn install --frozen-lockfile
  2. Python dependencies must also be installed to format py files.

    pip install -r requirements.txt

Formatting non-py files

yarn run format

Formatting py files

py files are formatted using black.

yarn run format-py

communityscripts's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

communityscripts's Issues

[renamerOnUpdate] Option to prevent file renaming

Hi,
I am trying to figure out how to prevent a filename change if it belongs to a particular studio.

# Adjust the below if you want to use studio names instead of tags for the renaming templates
studio_templates = {
        "Adam & Eve": "$studio - $title",
        "Brazzers": None

}

# Change to True to use the default template if no specific tag/studio is found
use_default_template = True
# Default template, adjust as needed
default_template = "$studio - $title"

For example, my current understanding is:

  • Scenario1: The scene belongs to the "Adam & Eve" studio it would rename the file according to the fields.
  • Scenario2: If there is no explicit studio template defined it will use the default template.

Current Issue:

  • Scenario3: If the file belongs to the Brazzers studio, I do not want to rename it. I tried using None and ''. However it doesn't seem to work.
  • Scenario4: If the file doesn't belong to a studio, I do not want to rename it.

[renamer] Fix $studio_family tag

When using the $studio_family tag, "_family" is appended to the studio name instead of using data from $studio or $parent_studio.

renamerOnUpdate does not have the issue.

Recommend changing the order of the template fields to process $studio_family before $studio

Current:

TEMPLATE_FIELD = "$date $year $performer $title $height $resolution $studio $parent_studio $studio_family $video_codec $audio_codec".split(" ")

Recommendation: ( from renamerOnUpdate )

TEMPLATE_FIELD = "$date $year $performer $title $height $resolution $parent_studio $studio_family $studio $rating $tags $video_codec $audio_codec".split(" ")

Normally, I would do a pull request and submit the change - however, I am remote and an issue is easier.

Thanks,

Sashizu

Feature request: Add folder/directory renaming, name scheme

I may eventually look into this, putting this here to track progress.

Should be able to organize media around the base library folder and create directories based on a predefined name scheme.

E.g., /BaseFolder/Studio/Year/Scene-with-formatted-fields.mp4

We could have a template like:
$studio/$year/$title

Where "/" would denote a folder directory scheme relative to the base library folder.

One thing to consider would be any external files that are associated to media, potentially transferring them too (e.g., a folder.jpg alongside a single scene)

[renamerOnUpdate] Renaming fails after upgrading to 17.0

As part of the refactor, the database schema has changed and this plugin no longer works. The script still pulls the correct information via the APi but fails when it tries to update the database. This is due to the removal of the "path" column. I believe we'll have to link tables to update the correct column.

�[37mDEBU�[0m[2022-10-19 15:54:14] [Plugin / renamerOnUpdate] Python successfully connected to SQLite �[31mERRO�[0m[2022-10-19 15:54:14] [Plugin / renamerOnUpdate] Error during database operation (no such column: path) �[37mDEBU�[0m[2022-10-19 15:54:14] [Plugin / renamerOnUpdate] [SQLITE] Database closed

[renamerOnUpdate] Studio Rename Not Working Properly

Not sure what I'm doing wrong, but I just updated to the most recent version and now my studio rename configuration is no longer working.

Here's my config:

####################################################################
#           TEMPLATE FILENAME (Rename your files)

# Priority : Tags > Studios > Default

# Templates to use for given tags
# Add or remove as needed or leave it empty/comment out
# you can specific group with {}. exemple: [$studio] {$date -} $title, the '-' will be removed if no date
tag_templates = {
    "renameMovie": "$title ($year) [$height]",
}

# Adjust the below if you want to use studio names instead of tags for the renaming templates
studio_templates = {
        "Tonight's Girlfriend": "tonightsgirlfriend - $date - $performer [$height]",
        "Tushy": "$studio - $date - $performer [$height]",
        "Vixen": "$studio - $date - $performer [$height]",
}

# Change to True to use the default template if no specific tag/studio is found
use_default_template = True
# Default template, adjust as needed
default_template = "$performer - $date - $title [$studio][$height]"

I have a file from Tonight's Girlfriend which is tagged with the studio, but it's renaming based on the default template instead.

Expected Filename Created: tonightsgirlfriend - 2022-10-28 - lauren phillips [1080p].mp4
Actual Filename Created: lauren phillips - 2022-10-28 - busty redhead lauren phillips rides her fans big cock [tonightsgirlfriend][1080p].mp4

Is there any way to tell why it's not picking up the studio properly? I've removed it and added it back in and still no luck. This is the exact config that was working until the update.

[renamerOnUpdate] Deletes characters that are in the template

Deletes characters that are in the template if one of the values is empty.
e.g.

filename_template = "[$studio] $date _ $title"
scene_information["studio"] = "studio1"
scene_information["date"] = ""
scene_information["title"] = "title1"

In this case we get

[studio1] title1

instead of

[studio1] - title1

This applies to characters

- and _

new_filename = re.sub('\${}[-\s_]*'.format(field_name), '', new_filename)

renamertask issue

Hi, i try the renamer, and when i do a dry run, he find the one with the tag i want, dry rename it good (according to the txt files generated), and when i try to run on the dry ones, i have this issue.

Can you help me? @Belleyy

022-01-18 23:27:24
Error
Plugin returned error: exit status 1
2022-01-18 23:27:24
Error
[Plugin / renamerTask] TypeError: string indices must be integers
2022-01-18 23:27:24
Error
[Plugin / renamerTask] msg = renamer(scene["id"])
2022-01-18 23:27:24
Error
[Plugin / renamerTask] File "/root/.stash/plugins/renamer/renamerTask.py", line 619, in
2022-01-18 23:27:24
Error
[Plugin / renamerTask] Traceback (most recent call last):
2022-01-18 23:26:21
Info
[Plugin / renamerTask] Took 0 seconds
2022-01-18 23:26:21
Info
[Plugin / renamerTask] [DRY-RUN] There wil be 7 file(s) changed. Check /root/.stash/plugins/renamer/renamer_scan.txt for more details

[renamerOnUpdate] Element feature requests

Four element field feature requests for renamerOnUpdate:

  1. $filename - The incumbent filename of the file.
    Example use-case: To keep the existing file name as-is, but change file path location only.
  2. $stashid_scene - StashID of the scene
  3. $stashid_performer - StashID of the performer(s)
  4. $studio_code - The new scene studio code added in recent develop versions

Latest renamerOnUpdate

Hello,

Just updated all my pip stuff this morning and now getting the following message from the plugin.

ERRO[2022-06-27 12:05:05] [Plugin / renamerOnUpdate] /usr/local/lib/python3.10/site-packages/requests/__init__.py:109: RequestsDependencyWarning: urllib3 (1.26.9) or chardet (5.0.0)/charset_normalizer (2.1.0) doesn't match a supported version!
ERRO[2022-06-27 12:05:05] [Plugin / renamerOnUpdate]   warnings.warn(

I don't like to downgrade/pin versions if I can get away with it.

Cheers.

[renamerOnUpdate] Path is too long

If I understood it correctly from the config file, the tool should be able to adjust the filename in case the path violates the windows maximum path length constraint. However, this doesn't work for me.

I would like to have my files named <studio> - <title> - <performes sorted by gender> (<Date>)

In case the path would be too long, first the performers shall be removed, then studio and finally the date. I have attached my config file, maxbe I have configured something wrong, but it doesn't work for me.

If you check the logs the following error is thrown:
022-12-10 12:28:50Error [Plugin / renamerOnUpdate] The path is too long (431 > 240)

For testing purposes I used scene SZ2788 from Legal P#rn#

Stash Version is v0.17.2
renamerOnUpdate Version is 2.4.0

config.zip

[renamerOnUpdate] Differentiate `splitchar` in path and file?

Not sure if this can be done somehow in the config as things stand, but I haven't been able to figure out how, in that case... Say I want to avoid spaces in my filenames, but I'm fine with spaces in my folders. Assume p_default_template is /data/$studio and my default_template is $studio.$date.$performer.$title, I would want the output to be something like: /data/Dad Crush/dadcrush.2021-11-27.madison.summers.one.thankful.daddy.mp4 - but since I can't set different splitchars based on paths vs. files, that's not happening.

On a similar note, could the squeeze_studio_names option be split in two? One for squeezing studio names when used in the path, and one for squeezing studio names when used in the file?

[Fix] setSceneCoverFromFile fails to run with SSL and self-signed certificate

I'm running Stash over SSL with a self-signed certificate, tried to use this plugin, which failed, as it obviously was unable to verify the certificate. So I change Line:64 in stash_interface.py from:

response = requests.post(self.url, json=json, headers=self.headers, cookies=self.cookies)

to

response = requests.post(self.url, json=json, headers=self.headers, cookies=self.cookies, verify=False)

While far from being optimal, it might be worth considering to apply this change to the repo.
I guess, considering the context in which this is being used, it shouldn't be a a major security threat.

[renamerOnUpdate] Don't work with Stash 0.17.1 anymore

Getting the following errors in the Stash Log while trying to update a title:

2022-10-21 07:57:52 Info [Plugin / renamerOnUpdate] The filename will be changed
2022-10-21 07:57:52 Error [Plugin / renamerOnUpdate] Error during database operation (no such column: path)

renamerOnUpdate is on the newest version that is available

[renamerOnUpdate] renamed files differ from configured template

Hi @Belleyy,

First, let me congratulate you for the very polished and feature rich plugin!

I use the following default_template config: $studio -=- $date -=- $performer -=- $title

The renamed file are actually studio =- date =- performer =- title.mp4 (missing the first dash in my separator). Probably a regex trick somewhere in the code...

I guess I use an uncommon separator, but I would really appreciate if you can fix it when you have the time.

Thanks!

[renamerOnUpdate] Bug with performer_ignoreGender

performer_ignoreGender skips performers that have an undefined/null gender value, thus there is no way to handle them and they foricbly are written to the filename. Perhaps there should be an additional array value named UNDEFINED or NULL to handle these performers with no gender value assigned to them.

[renamerOnUpdate] field_whitespaceSeperator prevents files with whitespace from being found.

If field_whitespaceSeperator in renamerOnUpdate_config.py is set to a non-space character, it will replace spaces in the current file path, preventing files from being found.

For example, /data/foo bar/baz.01.02.03.foo.bar.mp4 results in the following error when being renamed:

[Plugin / renamerOnUpdate] [OS] File doesn't exist in your Disk/Drive (/data/foo.bar/baz.01.02.03.foo.bar.mp4)

In renamerOnUpdate.py, the current file path is stored in scene_information['current_path']:
scene_information['current_path'] = str(scene['path'])

However, the logic for replacing whitespace overwrites characters in current_path, causing the issue:

    if FIELD_WHITESPACE_SEP:
        for key, value in scene_information.items():
            if type(value) is str:
                scene_information[key] = value.replace(" ", FIELD_WHITESPACE_SEP)
            elif type(value) is list:
                scene_information[key] = [x.replace(" ", FIELD_WHITESPACE_SEP) for x in value]
    return scene_information

[renamerOnUpdate] Performer Count Includes Males When Male Performers are Disabled

Not sure if this is a bug or an enhancement, but I noticed that when you set the performer limit at a specific number (say 3), but you also set it to ignore male performers, it still drops the performers if there are a total of 3 or more performers.

Wondering if the logic could be changed to check whether to include male performers and if not, then only count female.

As an example, it would be nice to have the name include Riley Reed even though there are more than 4 performers in this scene: https://www.blackedraw.com/videos/girlfriend-gangbang-at-the-after-party

Kodi-helper script doesn't run correctly... for me

I can't seem to get this script to run. is there perhaps a more detailed explanation for a noob trying to generate strm files?

When i run this script i get an error stating
"line 3, in
import requests
modulenotfounderror: no module named 'requests' "

i'm currently running stash in docker on dsm7.
stash itself runs great. i've tried to tinker with the script to get it to work, but im not an expert with python, so i'm stuck. please let me know what i'm doing wrong.

[renamerOnUpdate] Studio Rename Not Working Properly

Stash v0.18.0
Plugin: renamerOnUpdate (2.3.5)

Expected Behavior:
When saving changes on a file, the file renames.

Actual Behavior:
Nothing happens.

Log Output:
[Plugin / Update_Hook] No template for this file.

Config.py

#               TEMPLATE             #

# Priority : Tags > Studios > Default

# Templates to use for given tags
# Add or remove as needed or leave it empty/comment out
tag_templates = "$title - $performer"

# Adjust the below if you want to use studio names instead of tags for the renaming templates
studio_templates =  "[$studio]  $title - $performer"

# Change to True to use the default template if no specific tag/studio is found
use_default_template = True
# Default template, adjust as needed
default_template =  "$performer - $title_$height"  

######################################
#               Logging              #

# File to save what is renamed, can be useful if you need to revert changes.
# Will look like: IDSCENE|OLD_PATH|NEW_PATH
# Leave Blank ("") or use None if you don't want to use a log file, or a working path like: C:\Users\USERNAME\.stash\plugins\Hooks\rename_log.txt
log_file = r"./renamerLog.txt"

######################################
#               Settings             #

# Character which replaces every space in the filename
# Common values are "." and "_"
# e. g.:
# "."
# 2016-12-29.Eva.Lovia.-.Her.Fantasy.Ball
filename_splitchar = " "

# Character to use as a performer separator.
performer_splitchar = " "
# Maximum number of performer names in the filename. If there are more than that in a scene the filename will not include any performer name!
performer_limit = 3
# Ignore male performers.
performer_ignore_male = True

# If $performer is before $title, prevent having duplicate text. 
# e.g.:
# Template used: $year $performer - $title
# 2016 Dani Daniels - Dani Daniels in ***.mp4 --> 2016 Dani Daniels in ***.mp4
prevent_title_performer = True

# Squeeze studio names removes all spaces in studio, parent studio and studio family name
# e. g.:
# Reality Kings --> RealityKings
# Team Skeet Extras --> TeamSkeetExtras
squeeze_studio_names = True

# Rating indicator option to identify the number correctly in your OS file search
# Separated from the template handling above to avoid having only "RTG" in the filename for scenes without ratings
# e. g.:
# "{}" with scene rating of 5       == 5
# "RTG{}" with scene rating of 5    == RTG5
# "{}-stars" with scene rating 3    == 3-stars
rating_format = "{}"

# Character to use as a tag separator.
tags_splitchar = " "
# Include and exclude tags
# 	Tags will be compared strictly. "pantyhose" != "Pantyhose" and "panty hose" != "pantyhose"
# Option 1: If you're using whitelist, every other tag which is not listed there will be ignored in the filename
# Option 2: All tags in the tags_blacklist array will be ignored in the filename. Every other tag will be used.
# Option 3: Leave both arrays empty if you're looking for every tag which is linked to the scene. 
# 			Attention: Only recommended if the scene linked tags number is not that big due to maxiumum filename length
tags_whitelist = [
    # "Brunette", "Blowjob"
]

tags_blacklist = [
	# ignored tags...
]

# Only rename 'Organized' scenes.
only_organized = False

# If the new path is over 240 characters, the plugin will try to reduce it. Set to True to ignore that.
ignore_path_length = False
# Field to remove if the path is too long. First in list will be removed then second then ... if length is still too long.

order_field = ["$video_codec", "$audio_codec", "$resolution", "tags", "rating", "$height", "$studio_family", "$studio", "$parent_studio", "$performer"]

# Alternate way to show diff. Not useful at all.
alt_diff_display = False

######################################
#            Module Related          #

# ! OPTIONAL module settings. Not needed for basic operation !

# = psutil module (https://pypi.org/project/psutil/) =
# Gets a list of all processes instead of stopping after the first one. Enabling it slows down the plugin
process_getall = False
# If the file is used by a process, the plugin will kill it. IT CAN MAKE STASH CRASH TOO. 
process_kill_attach = False
# =========================

# = Unidecode module (https://pypi.org/project/Unidecode/) =
# Check site mentioned for more details. 
# TL;DR: Prevent having non common characters by replacing them.
# Warning: If you have non-latin characters (Cyrillic, Kanji, Arabic, ...), the result will be extremely different.
use_ascii = False 
# =========================

[renamerOnUpdate] Ignore genders only if above performer_limit

I want to do the following. I have the performer_limit = 3. When there are two females and one male I want them all to appear but if there are three females and one male I want the three females to appear. So I want to sort them based on gender. Instead of ignoring all but female as I can do right now with

performer_ignoreGender = ["MALE", "TRANSGENDER_MALE", "TRANSGENDER_FEMALE", "INTERSEX", "NON_BINARY"]

[renamerOnUpdate] More nuance in date-related elements?

I find $date and $year to be somewhat unflexible. Wouldn't it be better to have something like $yyyy, $yy, $mm and $dd instead? That way, one could make templates like $studio.$yy.$mm.$dd.$performer.$title, for example.

Funscripts update

Hello,
I have found, that on rename, the funscripts linked to the files are not renamed.
Since the naming of funscripts is crucial in order funscripts to work, is it possible to add this into the code and take them into the account too?

[renamerOnUpdate] Error -> Cannot query field "code " on type "Scene"

I updated the plugin with the changes from 2 days ago and am now getting this error:

2022-11-26 11:43:30
Error   
Plugin returned error: exit status 1
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate] ConnectionError: GraphQL query failed: 422 - b'{"errors":[{"message":"Cannot query field \\"code\\" on type \\"Scene\\".","locations":[{"line":23,"column":13}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}},{"message":"Cannot query field \\"code\\" on type \\"Scene\\".","locations":[{"line":23,"column":13}],"extensions":{"code":"GRAPHQL_VALIDATION_FAILED"}}],"data":null}'
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate]     raise ConnectionError(f"GraphQL query failed: {response.status_code} - {response.content}")
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate]   File "/root/.stash/plugins/renamerOnUpdate.py", line 93, in callGraphQL
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate]     result = callGraphQL(query, variables)
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate]   File "/root/.stash/plugins/renamerOnUpdate.py", line 212, in graphql_findScene
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate]     scenes = graphql_findScene(config.batch_number_scene, "ASC")
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate]   File "/root/.stash/plugins/renamerOnUpdate.py", line 1318, in <module>
2022-11-26 11:43:30
Error   
[Plugin / renamerOnUpdate] Traceback (most recent call last):

renamerOnUpdate doesn't work with Files refractor release

hi,
im testing the new files refractor release (https://github.com/stashapp/stash/releases/tag/files-refactor-release)
renamerOnUpdate throws many errors and doesn't work anymore, maybe someone can look into it?

22-08-22 21:54:37 Error Scene.Update.Post [renamerOnUpdate]: returned error: exit status 1 2022-08-22 21:54:37 Error [Plugin / renamerOnUpdate] cursor.execute("SELECT id FROM scenes WHERE path LIKE ? AND NOT id=?;", ["%" + folder_name + "_" + new_filename, FRAGMENT_SCENE_ID]) 2022-08-22 21:54:37 Error [Plugin / renamerOnUpdate] File "/root/stash-sortieren/plugins/renamerOnUpdate/renamerOnUpdate.py", line 512, in <module> 2022-08-22 21:54:37 Error [Plugin / renamerOnUpdate] Traceback (most recent call last): 2022-08-22 21:54:37 Error [Plugin / renamerOnUpdate] sqlite3.OperationalError: no such column: path 2022-08-22 21:54:37 Debug [Plugin / renamerOnUpdate] Python successfully connected to SQLite 2022-08-22 21:54:37 Debug [Plugin / renamerOnUpdate] [NEW] Filename: /storage/xxx/000-studio/MagmaFilm/MagmaFilm - 2002-09-15 - Hotel Fickmichgut - Scene 1 - Sibel Kekilli.avi 2022-08-22 21:54:37 Debug [Plugin / renamerOnUpdate] [OLD] Filename: /storage/xxx/Darsteller-umwandeln/Sibel_Kekilli/03_Hotel Fickmichgut - Scene 1.avi

[Plugin / Update_Hook] No template for this file.

Stash v0.11.0
Plugin: renamerOnUpdate

Expected Behavior:
When saving changes on a file, the file renames.

Actual Behavior:
Nothing happens.

Log Output:
[Plugin / Update_Hook] No template for this file.

Config.py

###################################################################
#
# -----------------------------------------------------------------
# Available: $date $year $performer $title $height $resolution $studio $parent_studio $studio_family $video_codec $audio_codec
# -note:
# $studio_family: If parent studio exist use it, else use the studio name.
# $performer: If more than * performers, this field will be ignored. Limit to fix at Settings section below (default: 3)
# $resolution: SD/HD/UHD/VERTICAL (for phone) | $height: 720p 1080p 4k 8k
# -----------------------------------------------------------------
# e.g.:
# $title                                    == Her Fantasy Ball
# $date $title                              == 2016-12-29 Her Fantasy Ball
# $year $title $height                      == 2016 Her Fantasy Ball 1080p
# $date $performer - $title [$studio]       == 2016-12-29 Eva Lovia - Her Fantasy Ball [Sneaky Sex]
# $parent_studio $date $performer - $title  == Reality Kings 2016-12-29 Eva Lovia - Her Fantasy Ball
#
####################################################################
#               TEMPLATE             #

# Priority : Tags > Studios > Default

# templates to use for given tags
# add or remove as needed
tag_templates = {
}

# adjust the below if you want to use studio names instead of tags for the renaming templates
studio_templates = {
}

# change to True to use the default template if no specific tag/studio is found
use_default_template = True
# default template, adjust as needed
default_template = "$performer - $studio - $date - $title [$height]"

######################################
#               Logging              #

# File to save what is renamed, can be useful if you need to revert changes.
# Will look like: IDSCENE|OLD_PATH|NEW_PATH
# Leave Blank ("") or use None if you don't want to use a log file, or a working path like: C:\Users\USERNAME\.stash\plugins\Hooks\rename_log.txt
log_file = ""

######################################
#               Settings             #

# Character to use as a performer separator.
performer_splitchar = " "
# Maximum number of performer names in the filename. If there are more than that in a scene the filename will not include any performer names!
performer_limit = 3
# ignore male performers.
performer_ignore_male = True

# If $performer is before $title, prevent having duplicate text. 
# e.g.:
# Template used: $year $performer - $title
# 2016 Dani Daniels - Dani Daniels in ***.mp4 --> 2016 Dani Daniels in ***.mp4
prevent_title_performer = False

# Only rename 'Organized' scenes.
only_organized = False
# Field to remove if the path is too long. First in list will be removed then second then ... if length is still too long.
order_field = ["$video_codec", "$audio_codec", "$resolution", "$height", "$studio_family", "$studio", "$parent_studio","$performer"]
# Alternate way to show diff. Not useful at all.
alt_diff_display = False

######################################
#            Module Related          #

# ! OPTIONAL module settings. Not needed for basic operation !

# = psutil module (https://pypi.org/project/psutil/) =
# Gets a list of all processes instead of stopping after the first one. Enabling it slows down the plugin
process_getall = False
# If the file is used by a process, the plugin will kill it. IT CAN MAKE STASH CRASH TOO. 
process_kill_attach = False
# =========================

# = Unidecode module (https://pypi.org/project/Unidecode/) =
# Check site mentioned for more details. 
# TL;DR: Prevent having non common characters by replacing them.
# Warning: If you have non-latin characters (Cyrillic, Kanji, Arabic, ...), the result will be extremely different.
use_ascii = False 
# =========================

Not updating filename

Whenever I update a scene the plugin doesn't work and I get this message in the log:

"error executing post hooks: Error running plugin: exec: "C:\Users\_____\.stash\plugins\renamer\python": file does not exist"

Thanks for any help.

More detail for the use of SQLITE Renamer for Stash

Hi,

it is possible to have more detail, screenshot or example to know how to do it?

For exemple, i would like to have something like
Main folder/parent_studio/Studio/[Studio]-the title-date-performer1.performer2...

And at which moment it will be rename? when scrape? edit and save?

Thanks for your help!

[renamerOnUpdate] $studio_code not working

Because studio_code is placed farther in the TEMPLATE_FIELD than studio, $studio will always win
causing %title [%studio_code] to be resolved to mytitle [mystudio_code]

[renamerOnUpdate] Add support for renaming images

Feature request to add support for image handling in the same way scenes are handled.

Element fields

There don't seem to be any unique fields for images that don't exist for scenes. However, there are elements unique to scenes that do not exist for images. These unique fields should just output a null value if the user incorporates them into an image template.

Galleries

A dedicated template for galleries, that is, the zip file. I'm not asking for the renaming of the images within zip files, just the renaming of the zip container itself, if possible.

[Sqlite_Renamer] sqlite3.OperationalError: no such column: path

The script fails on my Line 137
query = "SELECT id,path,title,date,studio_id,height from scenes {};".format(optionnal_query)

When viewed in DB Browser, there does not seem to be a column named 'path' in the 'scenes' table.

Possibly this now out of date through updates?

[renameOnUpdate] Favorite or Stared actresses files cannot be renamed

Stash is v0.17.2-45-g420c6fa9 (Latest dev)
renameOnUpdate is version: 2.3.3
When I try to rename file which contains favorite or stared actress I get...

2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] KeyError: '80'
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] perf_rating[str(perf['rating'])].append(perf['name'])
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] File "D:\Media\Scrapers\Stash\plugins\renamerOnUpdate/renamerOnUpdate.py", line 506, in extract_info
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] scene_information = extract_info(stash_scene, template)
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] File "D:\Media\Scrapers\Stash\plugins\renamerOnUpdate/renamerOnUpdate.py", line 1054, in renamer
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] renamer(FRAGMENT_SCENE_ID)
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] File "D:\Media\Scrapers\Stash\plugins\renamerOnUpdate/renamerOnUpdate.py", line 1296, in
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] Traceback (most recent call last):
2022-11-19 15:33:52 Error [Plugin / renamerOnUpdate] main function error: '80'

When I remove stars and favorite flags, plugin works
Uploaded Config file
renamerOnUpdate_config.zip

[Bug] renamerOnUpdate: default_template weird behaviour inside groups

Another bug involving the period, ., character.

Where the default_template is defined as default_template = "$studio.$date.$title{.$performer}", if a group contains a null element it should be outputting nothing in the group, but if there is a period before the element, it will output the period.

In the table below lets say the following elements contain these values unless specified as null.

$studio = Google
$date = 1970-01-01
$title = Hello
$performer = null

template null elements output
default_template = "$studio.$date.$title{.$performer}" performer Google.1970-01-01.Hello..mp4
default_template = "$studio.$date.$title{$performer.}" performer Google.1970-01-01.Hello.mp4
default_template = "$studio.$date.$title{_$performer}" performer Google.1970-01-01.Hello.mp4
default_template = "$studio{.$date}.$title{.$performer}" date; performer Google..Hello..mp4

I have included my config.py file for troubleshooting.

config.zip

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.