diff --git a/back/pom.xml b/back/pom.xml
index ff0b08d..3deeb76 100644
--- a/back/pom.xml
+++ b/back/pom.xml
@@ -20,7 +20,7 @@
kangaroo-and-rabbit
archidata
- 0.7.0
+ 0.7.1
org.slf4j
diff --git a/back/src/org/kar/karusic/WebLauncherLocal.java b/back/src/org/kar/karusic/WebLauncherLocal.java
index 1384a7d..546bec6 100755
--- a/back/src/org/kar/karusic/WebLauncherLocal.java
+++ b/back/src/org/kar/karusic/WebLauncherLocal.java
@@ -18,7 +18,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class WebLauncherLocal extends WebLauncher {
- final Logger logger = LoggerFactory.getLogger(WebLauncherLocal.class);
+ private static final Logger LOGGER = LoggerFactory.getLogger(WebLauncherLocal.class);
private WebLauncherLocal() {}
@@ -36,9 +36,9 @@ public class WebLauncherLocal extends WebLauncher {
Initialization.CLASSES_BASE, "../front/src/app/back-api/");
final WebLauncherLocal launcher = new WebLauncherLocal();
launcher.process();
- launcher.logger.info("end-configure the server & wait finish process:");
+ launcher.LOGGER.info("end-configure the server & wait finish process:");
Thread.currentThread().join();
- launcher.logger.info("STOP the REST server:");
+ launcher.LOGGER.info("STOP the REST server:");
}
@Override
diff --git a/back/src/org/kar/karusic/migration/Migration20240226.java b/back/src/org/kar/karusic/migration/Migration20240226.java
index db4c50b..73d52ee 100644
--- a/back/src/org/kar/karusic/migration/Migration20240226.java
+++ b/back/src/org/kar/karusic/migration/Migration20240226.java
@@ -1,6 +1,22 @@
package org.kar.karusic.migration;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.nio.file.StandardCopyOption;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.UUID;
+
+import org.kar.archidata.api.DataResource;
+import org.kar.archidata.dataAccess.DataAccess;
+import org.kar.archidata.dataAccess.addOn.model.LinkTable;
+import org.kar.archidata.dataAccess.options.AccessDeletedItems;
+import org.kar.archidata.dataAccess.options.OverrideTableName;
import org.kar.archidata.migration.MigrationSqlStep;
+import org.kar.archidata.tools.UuidUtils;
+import org.kar.karusic.migration.model.CoverConversion;
+import org.kar.karusic.migration.model.MediaConversion;
+import org.kar.karusic.migration.model.UUIDConversion;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -20,15 +36,13 @@ public class Migration20240226 extends MigrationSqlStep {
@Override
public void generateStep() throws Exception {
- /*
addAction("""
ALTER TABLE `data` ADD `uuid` binary(16) AFTER `id`;
""");
addAction(() -> {
final List datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
for (final UUIDConversion elem: datas) {
- elem.uuid = UUID.randomUUID();
- //elem.uuid = new UUID(elem.id * (long)Math.pow(2, 32), 0);
+ elem.uuid = UuidUtils.nextUUID();
}
for (final UUIDConversion elem: datas) {
DataAccess.update(elem, elem.id, List.of("uuid"), new OverrideTableName("data"));
@@ -93,10 +107,20 @@ public class Migration20240226 extends MigrationSqlStep {
addAction("""
ALTER TABLE `track` DROP `dataId`;
""");
- */
addAction("""
ALTER TABLE `track` CHANGE `dataUUID` `dataId` binary(16) NOT NULL;
""");
+ // Move the files...
+ addAction(() -> {
+ final List datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
+ for (final UUIDConversion data: datas) {
+ final String origin = DataResource.getFileDataOld(data.id);
+ final String destination = DataResource.getFileData(data.uuid);
+ LOGGER.info("move file = {}", origin);
+ LOGGER.info(" ==> {}", destination);
+ Files.move(Paths.get(origin), Paths.get(destination), StandardCopyOption.ATOMIC_MOVE);
+ }
+ });
addAction("""
ALTER TABLE `data` DROP `id`;
""");
@@ -106,17 +130,6 @@ public class Migration20240226 extends MigrationSqlStep {
addAction("""
ALTER TABLE `data` ADD PRIMARY KEY `id` (`id`);
""");
- /*
- // Move the files...
- addAction(() -> {
- final List datas = DataAccess.gets(UUIDConversion.class, new AccessDeletedItems(), new OverrideTableName("data"));
- for (final UUIDConversion data: datas) {
-
- final String origin = DataResource.getFileData(data.id);
- final String destination = DataResource.getFileData(data.uuid);
- }
- });
- */
}
}
diff --git a/front/src/app/back-api/track-resource.ts b/front/src/app/back-api/track-resource.ts
index bf7dd40..07f08ff 100644
--- a/front/src/app/back-api/track-resource.ts
+++ b/front/src/app/back-api/track-resource.ts
@@ -72,29 +72,6 @@ export namespace TrackResource {
data,
}, isTrack);
};
- export function uploadTrack({ restConfig, data, }: {
- restConfig: RESTConfig,
- data: {
- fileName: string,
- file: File,
- gender: string,
- artist: string,
- album: string,
- trackId: Long,
- title: string,
- },
- }): Promise