mirror of
https://github.com/wekan/wekan.git
synced 2025-12-17 07:50:12 +01:00
Removed "Orphaned Files" from Admin-Reports
- not necessary with Meteor-Files
This commit is contained in:
parent
dace63d4dc
commit
e75f423edd
4 changed files with 0 additions and 71 deletions
|
|
@ -20,35 +20,3 @@ Meteor.publish('attachmentsList', function() {
|
|||
).cursor;
|
||||
return ret;
|
||||
});
|
||||
|
||||
Meteor.publish('orphanedAttachments', function() {
|
||||
let keys = [];
|
||||
|
||||
if (Attachments.find({}, { fields: { copies: 1 } }) !== undefined) {
|
||||
Attachments.find({}, { fields: { copies: 1 } }).forEach(att => {
|
||||
keys.push(new ObjectID(att.copies.attachments.key));
|
||||
});
|
||||
keys.sort();
|
||||
keys = _.uniq(keys, true);
|
||||
|
||||
return AttachmentStorage.find(
|
||||
{ _id: { $nin: keys } },
|
||||
{
|
||||
fields: {
|
||||
_id: 1,
|
||||
filename: 1,
|
||||
md5: 1,
|
||||
length: 1,
|
||||
contentType: 1,
|
||||
metadata: 1,
|
||||
},
|
||||
sort: {
|
||||
filename: 1,
|
||||
},
|
||||
limit: 250,
|
||||
},
|
||||
);
|
||||
} else {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue