fix(furaffinity): duplicate tag-name if a artist uses their name as tag

some artists tag themselves, resulting in duplicate tags.

i have not yet found a consistency, but sometimes duplicate tags
cause szuruchrome to refuse uploading it (even for the same post
it often works by just re-trying).
pull/21/head
Shae 2025-10-11 03:56:59 +02:00
parent bc300601e0
commit 78266e647b
1 changed files with 6 additions and 5 deletions

View File

@ -46,16 +46,17 @@ export default class FurAffinity extends ScrapeEngineBase {
break; break;
} }
// Set tags
post.tags = Array.from(document.querySelectorAll("section.tags-row > span.tags a:not(.tag-block)"))
.map((x) => (x as HTMLSpanElement).innerText)
.map((x) => new ScrapedTag(x));
// Set user who submitted the art as the artist // Set user who submitted the art as the artist
const submissionUser = document.querySelector<HTMLElement>(".submission-id-sub-container a")?.innerText; const submissionUser = document.querySelector<HTMLElement>(".submission-id-sub-container a")?.innerText;
if (submissionUser) { if (submissionUser) {
post.tags.push(new ScrapedTag(submissionUser, "artist")); post.tags.push(new ScrapedTag(submissionUser, "artist"));
} }
// Set tags
post.tags = Array.from(document.querySelectorAll("section.tags-row > span.tags a:not(.tag-block)"))
.map((x) => (x as HTMLSpanElement).innerText)
.filter((x) => x !== submissionUser)
.map((x) => new ScrapedTag(x));
result.tryAddPost(post); result.tryAddPost(post);