Rename ProofHintFlags to MediaMetadata
Also, introduce the MediaInterventionFlags class to not send all metadata across, just the info needed for showing the intervention flags.
This commit is contained in:
parent
5fcbcb77fb
commit
1aff02c7d4
13 changed files with 101 additions and 90 deletions
|
|
@ -1,16 +1,16 @@
|
|||
import { ProofHintFlags } from "../../models/proof";
|
||||
import { MediaInterventionFlags } from "../../models/proof";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export const interventionText = (t: any, f: ProofHintFlags): string | undefined => {
|
||||
export const interventionText = (t: any, f: MediaInterventionFlags): string | undefined => {
|
||||
let res = "";
|
||||
if (f.generator === "camera") {
|
||||
res += "<b>" + t("cc.captured_with_camera") + "</b> ";
|
||||
} else if (f.generator === "screenshot") {
|
||||
res += "<b>" + (f.generatorSource === "c2pa" ? t("cc.screenshot_probably") : t("cc.screenshot_probably")) + "</b> ";
|
||||
res += "<b>" + t("cc.screenshot_probably") + "</b> ";
|
||||
} else if (f.generator === "ai") {
|
||||
res += "<b>" + t("cc.generated_with_ai") + "</b> ";
|
||||
}
|
||||
if ((f.edits?.length ?? 0) > 0) {
|
||||
if (f.modified) {
|
||||
res += "<b>" + t("cc.modified") + "</b> ";
|
||||
}
|
||||
if (f.creationDate && dayjs().diff(f.creationDate, "month") >= 3) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue