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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user