mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-04-28 08:59:52 -05:00
[plugins][defaultDataForPath] Fix small bug causing null assertions (#64)
This commit is contained in:
@@ -296,9 +296,15 @@ function addAllData(obj, lowerItemPath, defaultData, pTags, pPerformers, pStudio
|
||||
if(containsPath(paths, lowerItemPath)) {
|
||||
// inject data from parent if avail
|
||||
if(pTags) {
|
||||
if(!obj.tags) {
|
||||
obj.tags = [];
|
||||
}
|
||||
obj.tags = obj.tags.concat(pTags)
|
||||
}
|
||||
if(pPerformers) {
|
||||
if(!obj.performers) {
|
||||
obj.performers = [];
|
||||
}
|
||||
obj.performers = obj.performers.concat(pPerformers)
|
||||
}
|
||||
if(pStudio) {
|
||||
@@ -441,4 +447,4 @@ mutation galleryUpdate($input: GalleryUpdateInput!) {\
|
||||
gql.Do(mutation, variables);
|
||||
}
|
||||
|
||||
main();
|
||||
main();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
name: Default Data For Path
|
||||
description: Adds configured Tags, Performers and/or Studio to all newly scanned Scenes, Images and Galleries.
|
||||
url: https://github.com/stashapp/CommunityScripts
|
||||
version: 1.0
|
||||
version: 1.1
|
||||
exec:
|
||||
- defaultDataForPath.js
|
||||
interface: js
|
||||
@@ -12,4 +12,4 @@ hooks:
|
||||
triggeredBy:
|
||||
- Scene.Create.Post
|
||||
- Gallery.Create.Post
|
||||
- Image.Create.Post
|
||||
- Image.Create.Post
|
||||
|
||||
Reference in New Issue
Block a user