import Chart from "../core.js";
import { name, schema } from "./entities/drive.js";
/**
 * ドライブに関するチャート
 */ export default class DriveChart extends Chart {
    constructor(){
        super(name, schema);
    }
    async tickMajor() {
        return {};
    }
    async tickMinor() {
        return {};
    }
    async update(file, isAdditional) {
        const fileSizeKb = file.size / 1000;
        await this.commit(file.userHost === null ? {
            "local.incCount": isAdditional ? 1 : 0,
            "local.incSize": isAdditional ? fileSizeKb : 0,
            "local.decCount": isAdditional ? 0 : 1,
            "local.decSize": isAdditional ? 0 : fileSizeKb
        } : {
            "remote.incCount": isAdditional ? 1 : 0,
            "remote.incSize": isAdditional ? fileSizeKb : 0,
            "remote.decCount": isAdditional ? 0 : 1,
            "remote.decSize": isAdditional ? 0 : fileSizeKb
        });
    }
}
