Don't treat attached videos as unused files

2a1d07c46adb1253c42048c5c0b37c112fc692d1

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +5 -1Showing whitespace changes
src/endpoints/data-maid.js+5 -1
@@ -62,6 +62,7 @@ const sha256 = str => crypto.createHash('sha256').update(str).digest('hex');
6262/**
6363 * @typedef {object} DataMaidMessageExtra - The extra data object.
6464 * @property {string} [image] - The link to the image, if any.
65+ * @property {string} [video] - The link to the video, if any.
6566 * @property {string[]} [image_swipes] - The links to the image swipes, if any.
6667 * @property {DataMaidFile} [file] - The file object, if any.
6768 */
@@ -161,12 +162,15 @@ export class DataMaidService {
161162 const result = [];
162163
163164 try {
164165 const messages = await this.#parseAllChats(x => !!x?.extra?.image || !!x?.extra?.video || Array.isArray(x?.extra?.image_swipes));
165166 const knownImages = new Set();
166167 for (const message of messages) {
167168 if (message?.extra?.image) {
168169 knownImages.add(message.extra.image);
169170 }
171+ if (message?.extra?.video) {
172+ knownImages.add(message.extra.video);
173+ }
170174 if (Array.isArray(message?.extra?.image_swipes)) {
171175 for (const swipe of message.extra.image_swipes) {
172176 knownImages.add(swipe);