Browse Source

Fix booru tag parsing

pull/46/head
coomdev 2 years ago
parent
commit
9a10ee3a09
  1. 2
      main.meta.js
  2. 4
      main.user.js
  3. 4
      src/thirdeye.ts

2
main.meta.js

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name PNGExtraEmbed // @name PNGExtraEmbed
// @namespace https://coom.tech/ // @namespace https://coom.tech/
// @version 0.147 // @version 0.148
// @description uhh // @description uhh
// @author You // @author You
// @match https://boards.4channel.org/* // @match https://boards.4channel.org/*

4
main.user.js

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name PNGExtraEmbed // @name PNGExtraEmbed
// @namespace https://coom.tech/ // @namespace https://coom.tech/
// @version 0.147 // @version 0.148
// @description uhh // @description uhh
// @author You // @author You
// @match https://boards.4channel.org/* // @match https://boards.4channel.org/*
@ -12073,7 +12073,7 @@
source: e.source, source: e.source,
ext: e.file_ext || e.file_url.substr(e.file_url.lastIndexOf(".") + 1), ext: e.file_ext || e.file_url.substr(e.file_url.lastIndexOf(".") + 1),
page: `${prefix}${e.id || e.parent_id}`, page: `${prefix}${e.id || e.parent_id}`,
tags: (e.tag_string || e.tags && (typeof Array.isArray(e.tags) && typeof e.tags[0] == "string" ? e.tags.join(" ") : e.tags.map((e2) => e2.name_en).join(" ")) || "").split(" ") tags: (e.tag_string || (e.tags && (Array.isArray(e.tags) && (typeof e.tags[0] == "string" ? e.tags.join(" ") : e.tags.map((e2) => e2.name_en).join(" "))) || e.tags) || "").split(" ")
})) || []; })) || [];
var experimentalApi = false; var experimentalApi = false;
settings.subscribe((s) => { settings.subscribe((s) => {

4
src/thirdeye.ts

@ -44,7 +44,9 @@ const gelquirk: (s: string) => tran = prefix => (a =>
ext: e.file_ext || e.file_url.substr(e.file_url.lastIndexOf('.') + 1), ext: e.file_ext || e.file_url.substr(e.file_url.lastIndexOf('.') + 1),
page: `${prefix}${(e.id || e.parent_id)}`, page: `${prefix}${(e.id || e.parent_id)}`,
tags: (e.tag_string || (e.tags && (typeof Array.isArray(e.tags) && typeof e.tags[0] == "string" ? e.tags.join(' ') : e.tags.map((e: any) => e.name_en).join(' '))) || '').split(' ') tags: (e.tag_string || (e.tags
&& (Array.isArray(e.tags)
&& (typeof e.tags[0] == "string" ? e.tags.join(' ') : e.tags.map((e: any) => e.name_en).join(' '))) || e.tags) || '').split(' ')
} as BooruMatch)) || []); } as BooruMatch)) || []);
let experimentalApi = false; let experimentalApi = false;

Loading…
Cancel
Save