【return note】の検索結果
とりあえず投稿フォーム上での追跡クエリを削除するプラグインできた
nyayzeみたいにノートするときに勝手に削除してくれるようにしたいが方法がわからん
/// @ 0.12.4
### {
name: "YouTube Link Cleaner"
version: "0.1.0"
author: "@jj1guj"
description: "投稿時に YouTube URL の追跡クエリ (?si など) を削除します"
}
@is_youtube(u) {
(u.index_of("youtu.be") != -1) || (u.index_of("youtube.com") != -1) // true/false
}
@cleanUrl(u) {
if (is_youtube(u)) {
u.split("?")[0] // 「?」より前だけ残す
} else {
u
}
}
Plugin:register_post_form_action('YouTube Link Cleaner', @(note, rewrite) {
if (note.text == null) {
return note
}
let parts = note.text.split(" ")
var out = ""
// 公式構文: for (let 変数, 回数)
for (let i, parts.len) {
parts[i] = cleanUrl(parts[i])
out = `{out} {cleanUrl(parts[i])}`
}
rewrite('text', out)
})
CREATE OR REPLACE FUNCTION public.timestamp_to_aid(t timestamptz) RETURNS text AS $$
DECLARE
time_part text;
num bigint;
BEGIN
num := extract(epoch from t) * 1000 + mod(extract(millisecond from t),1000)::integer - 946684800000;
time_part := '00';
FOR i IN 1..8 LOOP
time_part := substring('0123456789abcdefghijklmnopqrstuvwxyz', (1 + mod(num, 36))::integer, 1) || time_part;
num := num / 36;
END LOOP;
RETURN time_part;
END;
$$ LANGUAGE plpgsql;
select n.* from "note" n
where
not exists (select 1 from note reply where reply."replyId" = n.id)
and not exists (select 1 from note renote where renote."renoteId" = n.id)
and not exists (select 1 from note_favorite nf where nf."noteId" = n.id )
and n."clippedCount" =0
and id < timestamp_to_aid(current_date - 56)
order by id desc;
timestamp_to_aid 関数は、かなりまっちゃてぃーさんの書いた式を参考にしてその逆関数にしてるhttps://nanasi-apps.xyz/Misskey-oldremotenote
[Auto Note]:Updated
Fetch URL: https://github.com/misskey-dev/misskey
Commit: 752606fe to f25fc521
fix(backend): Inboxのエラーをthrowせずreturnしている問題を修正 (#15022)
ci: reset prerelease number on release (#15024)
#みーくりあ!UpdateLog