Skip to content

Commit 25dbbf1

Browse files
Add scene-to-imageclip plugin
Task plugin that converts scenes tagged 'imageclip' into native Stash image clips by renaming files to .vclip and migrating metadata. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 898a4bd commit 25dbbf1

3 files changed

Lines changed: 642 additions & 0 deletions

File tree

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Scene to ImageClip Converter
2+
3+
Turn tagged scenes into Stash image clips — the looping, zoomable kind — by renaming their files to `.vclip` and migrating metadata automatically.
4+
5+
## How it works
6+
7+
Stash has a built-in image clip feature: if a video file has a `.vclip` extension and `create_image_clip_from_videos` is enabled, Stash treats it as a looping image instead of a scene. This plugin handles the conversion for you in two steps:
8+
9+
1. **Rename** — finds all scenes tagged `imageclip`, renames their files on disk (`video.mp4``video.mp4.vclip`), and sorts out any tag name variants (`image clip`, `image_clip`, `Image Clip`, etc.) into one canonical tag.
10+
2. **Transfer** — after you rescan, copies metadata (title, rating, performers, studio, tags, etc.) from the old scene entries to the new image clip entries, then removes the now-redundant scene records from the database.
11+
12+
No files are ever deleted. The rename just appends `.vclip`; the cleanup only removes database records.
13+
14+
## Setup
15+
16+
You need two things configured in Stash before this plugin will work:
17+
18+
1. **Enable image clip creation** — add this to your `config.yml` (or toggle it in Settings → System):
19+
```yaml
20+
create_image_clip_from_videos: true
21+
```
22+
23+
2. **Enable image scanning** on any library paths that contain your clips — in Settings → Libraries, make sure *Images* is checked (i.e. `excludeimage: false`). Otherwise Stash won't pick up the renamed files.
24+
25+
The plugin checks both of these and warns you if something's missing.
26+
27+
## Installation
28+
29+
Copy the `scene-to-imageclip` folder into your Stash plugins directory:
30+
31+
```
32+
<stash config dir>/plugins/scene-to-imageclip/
33+
```
34+
35+
Go to **Settings → Plugins → Reload Plugins**.
36+
37+
Requires Python 3 (included in the official Stash Docker image). No pip packages needed — stdlib only.
38+
39+
## Workflow
40+
41+
```
42+
1. Tag scenes with "imageclip" in Stash
43+
2. Settings → Tasks → Plugins → "Rename imageclip Scenes to .vclip" → Run
44+
3. Run a library scan (Settings → Tasks → Scan)
45+
4. Settings → Tasks → Plugins → "Transfer metadata and clean up" → Run
46+
```
47+
48+
The scan between steps 2 and 4 is important — Stash needs to discover the renamed files as image clips before the metadata transfer can find them.
49+
50+
## Good to know
51+
52+
- **Safe to re-run** — files already ending in `.vclip` are skipped.
53+
- **Multi-file scenes** — all files attached to a scene get renamed, not just the first.
54+
- **Leftover variant tags** — tag variants like `Image Clip` are emptied of scenes but not deleted. You can clean those up manually if you want.
55+
- **What doesn't transfer** — scene markers and cover images. Markers are timestamp-based and don't make sense on image clips.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Scene to ImageClip Converter
2+
description: >
3+
Converts scenes tagged 'imageclip' into Stash image-clip entities.
4+
Automatically adds .vclip to image_extensions, reconciles tag name variants
5+
(imageclip / image clip / image_clip / image-clip / Image Clip / ImageClip)
6+
into a single canonical tag with aliases, then renames each scene file from
7+
video.mp4 to video.mp4.vclip. Run a library scan after to reclassify.
8+
Requires: create_image_clip_from_videos: true in config.yml, and
9+
excludeimage: false on any library paths containing the files.
10+
version: "1.1"
11+
url: ""
12+
exec:
13+
- python3
14+
- "{pluginDir}/scene_to_imageclip.py"
15+
interface: raw
16+
tasks:
17+
- name: Rename imageclip Scenes to .vclip
18+
description: >
19+
Adds .vclip to image_extensions, reconciles imageclip tag variants,
20+
and renames tagged scene files to filename.ext.vclip.
21+
Run a library scan afterward to reclassify as image clips.
22+
defaultArgs:
23+
mode: rename
24+
- name: Transfer metadata and clean up original scenes
25+
description: >
26+
For each .vclip image clip, copies metadata (tags, rating, performers,
27+
studio, title, details, date) from the original scene entry and removes
28+
the scene from the database. Run after renaming files and scanning.
29+
defaultArgs:
30+
mode: transfer

0 commit comments

Comments
 (0)