Movie Template: remove the "min" from the Duration using {{VALUE:Runtime}}? #316
-
The plugin itself works flawlessly, but when I use it to add a movie the {{VALUE:Runtime}} returns a duration with "min" after it, which is understandable. However, somehow my appears to read the "min" as millions, I think, I messes with a chart I make using that data. I'm not sure how to address that exactly, but would it somehow be possible to get the data without the "min"? Not sure if this is the case, but thought I'd ask. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Sure! You can add QuickAdd.variables = {
...selectedShow,
+ Runtime: selectedShow.Runtime.replace(" min", ""),
actorLinks: linkifyList(selectedShow.Actors.split(",")),
genreLinks: linkifyList(selectedShow.Genre.split(",")),
directorLink:
selectedShow.Director === "N/A"
? " "
: linkifyList(selectedShow.Director.split(",")),
fileName: replaceIllegalFileNameCharactersInString(selectedShow.Title),
typeLink: `[[${selectedShow.Type === "movie" ? "Movies" : "Series"}]]`,
}; |
Beta Was this translation helpful? Give feedback.
Sure! You can add
Runtime: selectedShow.Runtime.replace(" min", ""),
to theQuickAdd.variables
assignment in the script. Like this:QuickAdd.variables = { ...selectedShow, + Runtime: selectedShow.Runtime.replace(" min", ""), actorLinks: linkifyList(selectedShow.Actors.split(",")), genreLinks: linkifyList(selectedShow.Genre.split(",")), directorLink: selectedShow.Director === "N/A" ? " " : linkifyList(selectedShow.Director.split(",")), fileName: replaceIllegalFileNameCharactersInString(selectedShow.Title), typeLink: `[[${selectedShow.Type === "movie" ? "Movies" : "Series"}]]`, };