[plugins][defaultDataForPath] Fix small bug causing null assertions (#64)

This commit is contained in:
TheSinfulKing
2022-07-25 14:22:02 -07:00
committed by GitHub
parent bda9757ee2
commit 61295f7e2c
2 changed files with 9 additions and 3 deletions

View File

@@ -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();

View File

@@ -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