|
|
@@ -1,11 +1,12 @@
|
|
|
|
|
|
const DatabaseModel = require("./DatabaseModel.js").DatabaseModel;
|
|
|
|
|
|
-function MediaFileTagModel(md5sum, tag, fromMeta) {
|
|
|
+function MediaFileTagModel(md5sum, tag, fromMeta, fromAutotag) {
|
|
|
DatabaseModel.call(this);
|
|
|
this.md5sum = md5sum || "";
|
|
|
this.tag = tag || "";
|
|
|
this.fromMeta = fromMeta;
|
|
|
+ this.fromAutotag = !!fromAutotag;
|
|
|
}
|
|
|
|
|
|
MediaFileTagModel.prototype = Object.create(DatabaseModel.prototype);
|
|
|
@@ -19,6 +20,7 @@ MediaFileTagModel.prototype.createOrUpdateBase = async function(dbHelper) {
|
|
|
md5sum STRING NOT NULL,
|
|
|
tag varchar(32) NOT NULL,
|
|
|
fromMeta BOOLEAN NOT NULL,
|
|
|
+ fromAutotag BOOLEAN NOT NULL,
|
|
|
PRIMARY KEY (md5sum, tag))`);
|
|
|
}
|
|
|
|
|
|
@@ -26,7 +28,8 @@ MediaFileTagModel.prototype.describe = function() {
|
|
|
return {
|
|
|
"md5sum": this.md5sum,
|
|
|
"tag": this.tag,
|
|
|
- "fromMeta": this.fromMeta
|
|
|
+ "fromMeta": this.fromMeta,
|
|
|
+ "fromAutotag": this.fromAutotag
|
|
|
};
|
|
|
}
|
|
|
|
|
|
@@ -36,6 +39,7 @@ MediaFileTagModel.prototype.fromDb = function(dbObj) {
|
|
|
this.md5sum = dbObj["md5sum"];
|
|
|
this.tag = dbObj["tag"];
|
|
|
this.fromMeta = dbObj["fromMeta"];
|
|
|
+ this.fromAutotag = dbObj["fromAutotag"];
|
|
|
}
|
|
|
|
|
|
module.exports.MediaFileTagModel = MediaFileTagModel;
|