-
-
- {uploadState === "SUCCESS" && t("doneUploadingTrack")}
- {uploadState === "STARTED" && (
- <>
-
- {t("stillProcessing")}
- >
- )}
- {uploadState === "ERROR" && t("thereWasAnError")}
-
+
svg {
+ margin-right: 1rem;
+ }
+ `}
+ >
+ {!track.title &&
}
+
+
+
+ {t("originalFilename", {
+ filename: track.audio?.originalFilename,
+ })}
+
+ {uploadState === "SUCCESS" && t("doneUploadingTrack")}
+ {uploadState === "STARTED" && (
+ <>
+
+ {t("stillProcessing")}
+ >
+ )}
+ {uploadState === "ERROR" && t("thereWasAnError")}
+
+
+
{
- if (incomingFolder === trackGroupFormatBucket) {
- logger.info("cleaning up files in the trackgroup minio container");
- removeBucket(incomingFolder);
+ if (incomingFolder.startsWith(trackGroupFormatBucket)) {
+ const split = incomingFolder.split(/\/(.*)/);
+ const bucket = split[0];
+ const albumId = split[1];
+ logger.info(
+ `cleaning up ${albumId ?? "all files"} in the trackgroup minio container`
+ );
+
+ removeBucket(bucket, albumId);
return {
deleted: incomingFolder,
};
@@ -49,9 +55,9 @@ const cleanUpFiles = async (incomingFolder: string) => {
};
};
-const removeBucket = async (bucketName: string) => {
+const removeBucket = async (bucketName: string, prefix: string) => {
logger.info(`Removing all objects from ${bucketName}`);
- await removeObjectsFromBucket(bucketName, "");
+ await removeObjectsFromBucket(bucketName, prefix ?? "");
};
export default cleanUpFiles;
diff --git a/src/routers/v1/admin/tasks.ts b/src/routers/v1/admin/tasks.ts
index 86a614b6e..a810f8b23 100644
--- a/src/routers/v1/admin/tasks.ts
+++ b/src/routers/v1/admin/tasks.ts
@@ -1,6 +1,5 @@
import { NextFunction, Request, Response } from "express";
import { userAuthenticated, userHasPermission } from "../../../auth/passport";
-import prisma from "@mirlo/prisma";
import cleanUpFiles from "../../../jobs/tasks/clean-up-files";
import initiateUserNotifcations from "../../../jobs/tasks/initiate-user-notifications";
|