Skip to content

Commit aa06f6f

Browse files
speckofthecosmosclaudeDogmaDragon
authored
Add scene-to-imageclip plugin (#694)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: DogmaDragon <103123951+DogmaDragon@users.noreply.github.com>
1 parent e4182de commit aa06f6f

3 files changed

Lines changed: 635 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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Scene to ImageClip Converter
2+
description: Converts scenes tagged 'imageclip' into Stash image clips by normalizing tag variants and renaming files to use the .vclip extension.
3+
version: "1.1"
4+
url: ""
5+
exec:
6+
- python3
7+
- "{pluginDir}/scene_to_imageclip.py"
8+
interface: raw
9+
tasks:
10+
- name: Rename imageclip Scenes to .vclip
11+
description: >
12+
Adds .vclip to image_extensions, reconciles imageclip tag variants,
13+
and renames tagged scene files to filename.ext.vclip.
14+
Run a library scan afterward to reclassify as image clips.
15+
defaultArgs:
16+
mode: rename
17+
- name: Transfer metadata and clean up original scenes
18+
description: >
19+
For each .vclip image clip, copies metadata (tags, rating, performers,
20+
studio, title, details, date) from the original scene entry and removes
21+
the scene from the database. Run after renaming files and scanning.
22+
defaultArgs:
23+
mode: transfer

0 commit comments

Comments
 (0)