Added automatic disambiguation of tags vs tag lists in model info.

- If there are any tag lists as a single tag, each tag will be separated by a newline instead of a comma.
This commit is contained in:
Christian Bastian
2024-08-17 03:45:45 -04:00
parent 7ef238e8f3
commit f08963d41d

View File

@@ -3155,10 +3155,16 @@ async function getModelInfos(urlText) {
const type = civitaiInfo["type"];
civitaiInfo["versions"].forEach((version) => {
const images = version["images"];
const tags = version["tags"];
const tags = version["tags"]?.map((tag) => {
tag = tag.trim();
if (tag.slice(-1) === ",") {
return tag.slice(0, -1);
}
return tag;
});
const description = [
tags !== undefined ? "# Trigger Words" : undefined,
tags?.join(", "),
tags?.join(tags.some((tag) => { return tag.includes(","); }) ? "\n" : ", "),
version["description"] !== undefined ? "# About this version " : undefined,
version["description"],
civitaiInfo["description"] !== undefined ? "# " + name : undefined,