Don't treat attached videos as unused files
| @@ -62,6 +62,7 @@ const sha256 = str => crypto.createHash('sha256').update(str).digest('hex'); | ||
| 62 | 62 | /** |
| 63 | 63 | * @typedef {object} DataMaidMessageExtra - The extra data object. |
| 64 | 64 | * @property {string} [image] - The link to the image, if any. |
| 65 | + * @property {string} [video] - The link to the video, if any. | |
| 65 | 66 | * @property {string[]} [image_swipes] - The links to the image swipes, if any. |
| 66 | 67 | * @property {DataMaidFile} [file] - The file object, if any. |
| 67 | 68 | */ |
| @@ -161,12 +162,15 @@ export class DataMaidService { | ||
| 161 | 162 | const result = []; |
| 162 | 163 | |
| 163 | 164 | try { |
| 164 | 165 | const messages = await this.#parseAllChats(x => !!x?.extra?.image || !!x?.extra?.video || Array.isArray(x?.extra?.image_swipes)); |
| 165 | 166 | const knownImages = new Set(); |
| 166 | 167 | for (const message of messages) { |
| 167 | 168 | if (message?.extra?.image) { |
| 168 | 169 | knownImages.add(message.extra.image); |
| 169 | 170 | } |
| 171 | + if (message?.extra?.video) { | |
| 172 | + knownImages.add(message.extra.video); | |
| 173 | + } | |
| 170 | 174 | if (Array.isArray(message?.extra?.image_swipes)) { |
| 171 | 175 | for (const swipe of message.extra.image_swipes) { |
| 172 | 176 | knownImages.add(swipe); |