Updates scene info based on the file path.
Updates scene info whenever a new scene is added.
You can disable this hook by deleting the following section from pathParser.yml
:
hooks:
- name: Run Rules on scan
description: Updates scene info whenever a new scene is added.
triggeredBy:
- Scene.Create.Post
Adds the [Run] and [Test] tags (configurable from pathParser.yml).
You can remove this trigger by deleting the following section from pathParser.yml
:
- name: Create Tags
description: Create tags used by the path parser tasks.
defaultArgs:
task: createTags
runTag: '[Run]'
testTag: '[Test]'
Removes the [Run] and [Test] tags (configurable from pathParser.yml).
You can remove this trigger by deleting the following section from pathParser.yml
:
- name: Remove Tags
description: Remove tags used by the path parser tasks.
defaultArgs:
task: removeTags
runTag: '[Run]'
testTag: '[Test]'
Run rules for scenes containing the [Run] tag (configurable from pathParser.yml).
You can remove this trigger by deleting the following section from pathParser.yml
:
- name: Run Rules
description: Run rules for scenes containing the run tag.
defaultArgs:
task: runRules
runTag: '[Run]'
Test rules for scenes containing the [Test] tag (configurable from pathParser.yml).
You can remove this trigger by deleting the following section from pathParser.yml
:
- name: Test Rules
description: Test rules for scenes containing the test tag.
defaultArgs:
task: testRules
testTag: '[Test]'
A single rule must have a name, pattern, and fields:
{
name: 'Your Rule',
// This pattern would match a scene with the path: folder/folder/file.mp4
pattern: [
'folder',
'folder',
'file'
],
// The matched scene would update it's title and studio
fields: {
title: 'Scene Title',
studio: 'Studio'
}
}
Each entry in pattern will match a folder or the filename (without extension).
Patterns behave differently depending on the type:
Type | Format | Description |
---|---|---|
null | null |
Matches any value |
String | 'string' |
Matches a specific value exactly |
RegExp | /regex/ |
Match using a regex1 |
Array | ['string1', 'string2', /regex/] |
Match any one of the sub-patterns |
Function | function (path) { return path; } |
Match if function returns a non-null value |
- Parenthesis matches in the regex are able to be used in field replacements.
The first matching rule will update the scene with the fields indicated:
Field | Format |
---|---|
title | 'New Title' |
studio | 'Studio Name' |
movie_title | 'Movie Name' |
scene_index | '1' |
performers | 'Performer 1, Performer 2, ...' |
tags | 'Tag 1, Tag 2, ...' |
Matched patterns can be inserted into any field by referencing their indexed value (see examples below).
{
name: 'Studio/Scene',
pattern: [
['Specific Studio', 'Another Studio'], // A specific studio name
null // Any filename
],
fields: {
title: '#1', // 1 refers to the second pattern (filename)
studio: '#0' // 0 refers to the first pattern (folder)
}
}
Input: X:\DCE\Black Adam.mp4
Output:
- DCE
- Black Adam
{
name: 'Studio/Movie (YEAR)/Scene - Scene #',
pattern: [
null, // Any studio name
/(.+) \(\d{4}\)/, // A sub-folder with 'Movie Title (2022)'
/(.+) - \w+ ({d})/, // A filename with 'Scene Title - Scene 1'
],
fields: {
title: '#2',
studio: '#0',
movie_title: '#1',
scene_index: '#3'
}
}
Input: X:\HBO\House of the Dragon (2022)\House of the Dragon - Episode 1.mp4
Output:
- HBO
- House of the Dragon
- House of the Dragon
- 1
{
name: 'Studio/Scene.Performers.S##E##',
pattern: [
null, // Any studio name
function (path) {
var parts = path.split('.');
var performers = parts[1].split('&').map(function (performer) { return performer.trim() }).join(',');
var series = /S(\d{2})E(\d{2})/.exec(parts[2]);
return [parts[0], performers, parseInt(series[1]), parseInt(series[2])];
}
],
fields: {
title: '#1',
studio: '#0',
performers: '#2',
movie_title: '#1 - Season #3',
scene_index: '#4'
}
}
Input: X:\Prime\The Boys.Karl Urban & Jack Quaid.S06E09.mp4
Output:
- Prime
- The Boys
- Karl Urban,Jack Quaid
- 6
- 9