forked from tdjsnelling/sqtracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtorrent.js
More file actions
30 lines (27 loc) · 670 Bytes
/
Copy pathtorrent.js
File metadata and controls
30 lines (27 loc) · 670 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import mongoose from "mongoose";
import fuzzySearch from "mongoose-fuzzy-searching";
const Torrent = new mongoose.Schema({
infoHash: String,
binary: String,
poster: String,
uploadedBy: mongoose.Schema.ObjectId,
name: String,
description: String,
type: String,
source: String,
image: String,
downloads: Number,
anonymous: Boolean,
size: Number,
files: Array,
created: Number,
upvotes: Array,
downvotes: Array,
freeleech: Boolean,
tags: Array,
group: mongoose.Schema.ObjectId,
confidenceScore: Number,
mediaInfo: String,
});
Torrent.plugin(fuzzySearch, { fields: ["name"] });
export default mongoose.model("torrent", Torrent);