mirror of
https://github.com/zkldi/Tachi.git
synced 2026-09-28 01:48:11 +03:00
29 lines
700 B
TypeScript
29 lines
700 B
TypeScript
import db from "../../src/db/db";
|
|
import { FolderDocument } from "tachi-common";
|
|
|
|
(async () => {
|
|
const folders = (await db.folders.find({})) as any[];
|
|
|
|
for (const fl of folders) {
|
|
const f: FolderDocument = {
|
|
folderID: fl.folderID,
|
|
game: fl.game,
|
|
playtype: fl.playtype,
|
|
table: fl.table,
|
|
tableIndex: fl.tableIndex,
|
|
title: fl.title,
|
|
type: fl.query.collection === "charts" ? "charts" : "songs",
|
|
data: fl.query.body,
|
|
};
|
|
|
|
await db.folders.update(
|
|
{
|
|
_id: fl._id,
|
|
},
|
|
{ $set: f }
|
|
);
|
|
}
|
|
|
|
console.log("done");
|
|
})();
|