updated
This commit is contained in:
parent
a7289577d0
commit
53fb321c07
@ -10278,11 +10278,11 @@ namespace WinFormsApp1
|
|||||||
{
|
{
|
||||||
if (Directory.Exists(keepPath!.FullName))
|
if (Directory.Exists(keepPath!.FullName))
|
||||||
{
|
{
|
||||||
DirectoryInfo dir = new DirectoryInfo(keepPath.FullName);
|
DirectoryInfo keep_dir = new DirectoryInfo(keepPath.FullName);
|
||||||
if (dir.Exists)
|
if (keep_dir.Exists)
|
||||||
{
|
{
|
||||||
List<FileInfo> Files_Finished = GetVideoFiles(dir);
|
List<FileInfo> Files_Keep = GetVideoFiles(keep_dir);
|
||||||
foreach (FileInfo file in Files_Finished)
|
foreach (FileInfo file in Files_Keep)
|
||||||
{
|
{
|
||||||
string modelname = GetModelFromFilename(file.Name);
|
string modelname = GetModelFromFilename(file.Name);
|
||||||
string url = GetModelURL(modelname);
|
string url = GetModelURL(modelname);
|
||||||
@ -10301,30 +10301,33 @@ namespace WinFormsApp1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("Abgeschlossene Downloads auch sortieren?", "Warnung", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
DirectoryInfo finished_dir = new DirectoryInfo(finishedPath!.FullName);
|
||||||
if (dialogResult == DialogResult.Yes)
|
List<FileInfo> Files_Finished = GetVideoFiles(finished_dir);
|
||||||
|
if (Files_Finished.Count > 0)
|
||||||
{
|
{
|
||||||
if (Directory.Exists(finishedPath!.FullName))
|
DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("Abgeschlossene Downloads auch sortieren?", "Warnung", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
||||||
|
if (dialogResult == DialogResult.Yes)
|
||||||
{
|
{
|
||||||
DirectoryInfo dir = new DirectoryInfo(finishedPath.FullName);
|
if (Directory.Exists(finishedPath!.FullName))
|
||||||
if (dir.Exists)
|
|
||||||
{
|
{
|
||||||
List<FileInfo> Files_Finished = GetVideoFiles(dir);
|
if (finished_dir.Exists)
|
||||||
foreach (FileInfo file in Files_Finished)
|
|
||||||
{
|
{
|
||||||
string modelname = GetModelFromFilename(file.Name);
|
foreach (FileInfo file in Files_Finished)
|
||||||
string url = GetModelURL(modelname);
|
|
||||||
|
|
||||||
string model_folder = System.IO.Path.Combine(finishedPath.FullName, modelname);
|
|
||||||
|
|
||||||
if (!System.IO.Directory.Exists(model_folder))
|
|
||||||
{
|
{
|
||||||
System.IO.Directory.CreateDirectory(model_folder);
|
string modelname = GetModelFromFilename(file.Name);
|
||||||
}
|
string url = GetModelURL(modelname);
|
||||||
|
|
||||||
if (System.IO.File.Exists(file.FullName))
|
string model_folder = System.IO.Path.Combine(finishedPath.FullName, modelname);
|
||||||
{
|
|
||||||
Task.Run(() => moveFile(file.FullName, System.IO.Path.Combine(model_folder, file.Name)));
|
if (!System.IO.Directory.Exists(model_folder))
|
||||||
|
{
|
||||||
|
System.IO.Directory.CreateDirectory(model_folder);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (System.IO.File.Exists(file.FullName))
|
||||||
|
{
|
||||||
|
Task.Run(() => moveFile(file.FullName, System.IO.Path.Combine(model_folder, file.Name)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -13939,21 +13942,52 @@ namespace WinFormsApp1
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
double fileCount = Directory.GetFiles(temp_folder!.FullName).Length;
|
// Nur Frames für dieses Video berücksichtigen
|
||||||
double video_duration = System.TimeSpan.FromTicks(flyleafHost_Editor.Player.Duration).TotalSeconds;
|
string[] existingFramesForVideo = Directory.GetFiles(temp_folder!.FullName)
|
||||||
video_duration_editFile = Math.Round((video_duration), 0);
|
.Where(f => Path.GetFileName(f).StartsWith(video.Name + "-"))
|
||||||
|
.ToArray();
|
||||||
|
|
||||||
|
int frameCount = existingFramesForVideo.Length;
|
||||||
|
double video_duration = TimeSpan.FromTicks(flyleafHost_Editor.Player.Duration).TotalSeconds;
|
||||||
|
video_duration_editFile = Math.Round(video_duration, 0);
|
||||||
|
|
||||||
|
// Prüfen, ob vollständige AI-Results existieren
|
||||||
|
bool hasFullAnalysis =
|
||||||
|
analysedFilesAI.TryGetValue(video.Name, out var analysis) &&
|
||||||
|
analysis.ai != null &&
|
||||||
|
analysis.ai.Count == frameCount &&
|
||||||
|
allGeneratedImagesExists(analysis.ai) &&
|
||||||
|
analysedImagesNotNull(analysis.ai);
|
||||||
|
|
||||||
|
// Frames vorhanden?
|
||||||
|
bool hasAnyFrames = frameCount > 0;
|
||||||
|
|
||||||
|
// Frames vollständig?
|
||||||
|
bool framesMissing = hasAnyFrames && isMissingFrames(video);
|
||||||
|
|
||||||
if (scanAIisRunning)
|
if (scanAIisRunning)
|
||||||
{
|
{
|
||||||
if (Math.Round(fileCount, 0) == Math.Round((video_duration), 0) && generatedImagesMatchVideo(video))
|
// 1) Frames sicherstellen
|
||||||
{
|
if (!hasAnyFrames)
|
||||||
await Task.Run(() => scanAI(video));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
|
// Noch gar keine Frames -> einmal komplett extrahieren
|
||||||
await Task.Run(() => extractFrames(video));
|
await Task.Run(() => extractFrames(video));
|
||||||
await Task.Run(() => scanAI(video));
|
|
||||||
}
|
}
|
||||||
|
else if (framesMissing)
|
||||||
|
{
|
||||||
|
// Es fehlen einzelne Frames -> nur diese nachziehen
|
||||||
|
var missing = getMissingFrames(video);
|
||||||
|
if (missing.Count > 0)
|
||||||
|
await Task.Run(() => extractSingleFrames(video, missing));
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2) AI-Scan:
|
||||||
|
// scanAI prüft selbst via 'alreadyAnalysed',
|
||||||
|
// ob schon vollständige Ergebnisse da sind.
|
||||||
|
// -> Bei hasFullAnalysis werden die Bilder NICHT neu klassifiziert,
|
||||||
|
// es werden nur die vorhandenen Ergebnisse + Timestamps wiederverwendet.
|
||||||
|
await Task.Run(() => scanAI(video));
|
||||||
|
|
||||||
button_AddSplit.Enabled = true;
|
button_AddSplit.Enabled = true;
|
||||||
button_SplitFiles.Enabled = true;
|
button_SplitFiles.Enabled = true;
|
||||||
}
|
}
|
||||||
@ -14171,46 +14205,51 @@ namespace WinFormsApp1
|
|||||||
|
|
||||||
private bool isMissingFrames(FileInfo video)
|
private bool isMissingFrames(FileInfo video)
|
||||||
{
|
{
|
||||||
List<double> missingFrames = new List<double>();
|
// Dauer des Videos im Editor
|
||||||
FileInfo[] files = temp_folder!.GetFiles();
|
double video_duration = TimeSpan.FromTicks(flyleafHost_Editor.Player.Duration).TotalSeconds;
|
||||||
double video_duration = System.TimeSpan.FromTicks(flyleafHost_Editor.Player.Duration).TotalSeconds;
|
int secondsCount = (int)Math.Round(video_duration, 0);
|
||||||
double secondsCount = (double)Math.Floor(Math.Round(video_duration, 6));
|
|
||||||
bool result = false;
|
|
||||||
|
|
||||||
if (files.Length != secondsCount)
|
// Nur Dateien dieses Videos berücksichtigen
|
||||||
|
string pattern = video.Name + "-*.jpg";
|
||||||
|
var filesForVideo = Directory.GetFiles(temp_folder!.FullName, pattern);
|
||||||
|
|
||||||
|
// Wenn gar keine Frames vorhanden sind -> es "fehlen" natürlich welche
|
||||||
|
if (filesForVideo.Length == 0)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Wenn die Anzahl nicht passt -> irgendwas fehlt
|
||||||
|
if (filesForVideo.Length != secondsCount)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
// Sicherheitshalber jede Sekunde prüfen
|
||||||
|
for (int i = 1; i <= secondsCount; i++)
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= secondsCount; i++)
|
string fileName = Path.Combine(temp_folder.FullName, $"{video.Name}-{i}.jpg");
|
||||||
{
|
if (!File.Exists(fileName))
|
||||||
string fileName = System.IO.Path.Combine(temp_folder!.FullName, video.Name + "-" + i + ".jpg");
|
return true;
|
||||||
if (!System.IO.File.Exists(fileName))
|
|
||||||
{
|
|
||||||
result = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<double> getMissingFrames(FileInfo video)
|
private List<double> getMissingFrames(FileInfo video)
|
||||||
{
|
{
|
||||||
List<double> missingFrames = new List<double>();
|
var missingFrames = new List<double>();
|
||||||
FileInfo[] files = temp_folder!.GetFiles();
|
|
||||||
double secondsCount = Math.Round((System.TimeSpan.FromTicks(flyleafHost_Player.Player.Duration).TotalSeconds), 0);
|
|
||||||
|
|
||||||
if (files.Length != secondsCount)
|
double video_duration = TimeSpan.FromTicks(flyleafHost_Editor.Player.Duration).TotalSeconds;
|
||||||
|
int secondsCount = (int)Math.Round(video_duration, 0);
|
||||||
|
|
||||||
|
for (int i = 1; i <= secondsCount; i++)
|
||||||
{
|
{
|
||||||
for (int i = 1; i <= secondsCount; i++)
|
string fileName = Path.Combine(temp_folder!.FullName, $"{video.Name}-{i}.jpg");
|
||||||
{
|
if (!File.Exists(fileName))
|
||||||
string fileName = System.IO.Path.Combine(temp_folder!.FullName, video.Name + "-" + i + ".jpg");
|
missingFrames.Add(i);
|
||||||
if (!System.IO.File.Exists(fileName))
|
|
||||||
{
|
|
||||||
missingFrames.Add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return missingFrames;
|
return missingFrames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private async Task extractFrames(FileInfo video)
|
private async Task extractFrames(FileInfo video)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
<!-- https://go.microsoft.com/fwlink/?LinkID=208121. -->
|
||||||
<Project>
|
<Project>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<History>True|2025-11-17T09:09:19.4598326Z||;True|2025-11-17T10:01:39.8843258+01:00||;True|2025-11-17T09:40:23.3639389+01:00||;True|2025-11-13T14:18:25.1199192+01:00||;True|2025-11-10T09:34:59.9819614+01:00||;True|2025-11-10T09:31:52.9893994+01:00||;True|2025-11-07T07:27:09.2818809+01:00||;True|2025-10-28T07:54:43.4835993+01:00||;True|2025-10-28T07:49:48.9691140+01:00||;False|2025-10-28T07:48:40.9934972+01:00||;True|2025-10-28T07:41:40.9364570+01:00||;True|2025-10-28T07:34:30.3216200+01:00||;True|2025-10-27T07:38:02.5307378+01:00||;True|2025-10-24T12:49:33.3476720+02:00||;True|2025-10-24T12:45:56.3409114+02:00||;True|2025-10-24T12:37:06.7053780+02:00||;True|2025-10-24T12:21:52.0779529+02:00||;True|2025-10-24T11:39:34.0711190+02:00||;True|2025-10-24T11:32:06.8084304+02:00||;True|2025-10-24T10:49:19.8451151+02:00||;True|2025-10-24T10:35:58.7368296+02:00||;True|2025-09-22T09:12:21.1738434+02:00||;True|2025-09-22T08:41:28.2063145+02:00||;True|2025-09-11T09:25:26.7487573+02:00||;True|2025-09-05T10:35:16.3265491+02:00||;True|2025-08-13T07:12:45.6489499+02:00||;True|2025-08-08T07:25:38.8935816+02:00||;True|2025-08-08T07:19:07.3835648+02:00||;True|2025-08-06T07:38:46.3420158+02:00||;True|2025-07-16T07:41:34.3557961+02:00||;True|2025-07-15T11:01:48.5566218+02:00||;True|2025-07-07T14:59:37.1240379+02:00||;False|2025-07-07T14:57:39.0613209+02:00||;True|2025-07-07T06:29:53.8853096+02:00||;True|2025-07-06T23:39:21.1017631+02:00||;True|2025-07-06T23:24:37.7792733+02:00||;False|2025-07-06T23:19:52.7135594+02:00||;True|2025-07-06T05:55:51.5281444+02:00||;True|2025-07-06T05:14:26.6590895+02:00||;True|2025-07-06T05:07:43.4335057+02:00||;False|2025-07-06T05:06:42.5442365+02:00||;True|2025-06-27T09:56:34.6625992+02:00||;True|2025-06-27T09:55:33.6399545+02:00||;True|2025-06-27T09:35:44.7409289+02:00||;True|2025-06-27T09:35:11.7955472+02:00||;True|2025-06-27T09:23:44.1433728+02:00||;True|2025-06-27T09:10:34.1084041+02:00||;True|2025-06-27T09:06:49.8646149+02:00||;True|2025-06-27T08:55:00.3110860+02:00||;True|2025-06-27T08:47:18.4476580+02:00||;True|2025-06-11T14:42:56.1622930+02:00||;True|2025-06-11T12:33:26.7419370+02:00||;True|2025-06-11T07:48:58.3963584+02:00||;True|2025-06-11T07:42:53.0277862+02:00||;False|2025-06-11T07:39:31.7470335+02:00||;True|2025-06-03T19:58:59.1868907+02:00||;True|2025-06-03T14:33:55.4389500+02:00||;True|2025-06-03T14:16:34.6963918+02:00||;True|2025-06-03T13:26:58.4834917+02:00||;True|2025-06-02T19:01:22.1305699+02:00||;True|2025-06-02T18:27:48.1629252+02:00||;True|2025-06-02T18:12:01.0339452+02:00||;True|2025-04-25T14:02:07.8958669+02:00||;True|2025-04-24T07:32:32.3215936+02:00||;True|2025-04-23T14:24:27.8051379+02:00||;True|2025-04-22T07:23:33.4961515+02:00||;True|2025-04-22T07:16:30.0019927+02:00||;True|2025-04-17T07:35:19.5003910+02:00||;True|2025-04-16T07:51:44.2105982+02:00||;True|2025-04-15T17:39:22.9354819+02:00||;True|2025-04-15T13:59:38.1491035+02:00||;True|2025-04-15T13:26:09.1911007+02:00||;False|2025-04-15T13:24:05.8283613+02:00||;True|2025-04-15T12:05:53.7928484+02:00||;True|2025-04-14T11:46:19.0213400+02:00||;True|2025-04-14T11:19:57.9110025+02:00||;False|2025-04-14T11:18:49.2970157+02:00||;True|2025-04-14T10:56:19.4313583+02:00||;True|2025-04-14T10:09:57.0472222+02:00||;True|2025-04-11T09:36:58.9281719+02:00||;True|2025-04-11T07:56:15.1143584+02:00||;True|2025-04-10T08:08:20.7849097+02:00||;True|2025-04-09T12:56:06.8510589+02:00||;True|2025-04-09T12:39:21.5101756+02:00||;True|2025-04-09T12:35:02.6306664+02:00||;True|2025-04-09T07:53:00.7307516+02:00||;True|2025-04-07T15:17:24.3233000+02:00||;True|2025-04-04T18:09:18.8844877+02:00||;True|2025-04-03T12:27:18.9922316+02:00||;True|2025-04-03T09:48:50.2518754+02:00||;True|2025-03-31T13:53:07.3910797+02:00||;True|2025-03-31T12:46:18.3638787+02:00||;True|2025-03-31T11:01:06.0182900+02:00||;True|2025-03-31T10:55:30.7399322+02:00||;True|2025-03-31T10:41:08.8975919+02:00||;True|2025-03-31T10:15:29.6315309+02:00||;True|2025-03-31T08:53:20.4511304+02:00||;True|2025-03-29T14:23:34.4407251+01:00||;True|2025-03-29T13:42:06.7348581+01:00||;True|2025-03-28T18:06:37.5932036+01:00||;</History>
|
<History>True|2025-11-24T12:27:08.9306938Z||;True|2025-11-24T12:11:16.9389361+01:00||;True|2025-11-24T08:50:56.2419082+01:00||;True|2025-11-17T10:09:19.4598326+01:00||;True|2025-11-17T10:01:39.8843258+01:00||;True|2025-11-17T09:40:23.3639389+01:00||;True|2025-11-13T14:18:25.1199192+01:00||;True|2025-11-10T09:34:59.9819614+01:00||;True|2025-11-10T09:31:52.9893994+01:00||;True|2025-11-07T07:27:09.2818809+01:00||;True|2025-10-28T07:54:43.4835993+01:00||;True|2025-10-28T07:49:48.9691140+01:00||;False|2025-10-28T07:48:40.9934972+01:00||;True|2025-10-28T07:41:40.9364570+01:00||;True|2025-10-28T07:34:30.3216200+01:00||;True|2025-10-27T07:38:02.5307378+01:00||;True|2025-10-24T12:49:33.3476720+02:00||;True|2025-10-24T12:45:56.3409114+02:00||;True|2025-10-24T12:37:06.7053780+02:00||;True|2025-10-24T12:21:52.0779529+02:00||;True|2025-10-24T11:39:34.0711190+02:00||;True|2025-10-24T11:32:06.8084304+02:00||;True|2025-10-24T10:49:19.8451151+02:00||;True|2025-10-24T10:35:58.7368296+02:00||;True|2025-09-22T09:12:21.1738434+02:00||;True|2025-09-22T08:41:28.2063145+02:00||;True|2025-09-11T09:25:26.7487573+02:00||;True|2025-09-05T10:35:16.3265491+02:00||;True|2025-08-13T07:12:45.6489499+02:00||;True|2025-08-08T07:25:38.8935816+02:00||;True|2025-08-08T07:19:07.3835648+02:00||;True|2025-08-06T07:38:46.3420158+02:00||;True|2025-07-16T07:41:34.3557961+02:00||;True|2025-07-15T11:01:48.5566218+02:00||;True|2025-07-07T14:59:37.1240379+02:00||;False|2025-07-07T14:57:39.0613209+02:00||;True|2025-07-07T06:29:53.8853096+02:00||;True|2025-07-06T23:39:21.1017631+02:00||;True|2025-07-06T23:24:37.7792733+02:00||;False|2025-07-06T23:19:52.7135594+02:00||;True|2025-07-06T05:55:51.5281444+02:00||;True|2025-07-06T05:14:26.6590895+02:00||;True|2025-07-06T05:07:43.4335057+02:00||;False|2025-07-06T05:06:42.5442365+02:00||;True|2025-06-27T09:56:34.6625992+02:00||;True|2025-06-27T09:55:33.6399545+02:00||;True|2025-06-27T09:35:44.7409289+02:00||;True|2025-06-27T09:35:11.7955472+02:00||;True|2025-06-27T09:23:44.1433728+02:00||;True|2025-06-27T09:10:34.1084041+02:00||;True|2025-06-27T09:06:49.8646149+02:00||;True|2025-06-27T08:55:00.3110860+02:00||;True|2025-06-27T08:47:18.4476580+02:00||;True|2025-06-11T14:42:56.1622930+02:00||;True|2025-06-11T12:33:26.7419370+02:00||;True|2025-06-11T07:48:58.3963584+02:00||;True|2025-06-11T07:42:53.0277862+02:00||;False|2025-06-11T07:39:31.7470335+02:00||;True|2025-06-03T19:58:59.1868907+02:00||;True|2025-06-03T14:33:55.4389500+02:00||;True|2025-06-03T14:16:34.6963918+02:00||;True|2025-06-03T13:26:58.4834917+02:00||;True|2025-06-02T19:01:22.1305699+02:00||;True|2025-06-02T18:27:48.1629252+02:00||;True|2025-06-02T18:12:01.0339452+02:00||;True|2025-04-25T14:02:07.8958669+02:00||;True|2025-04-24T07:32:32.3215936+02:00||;True|2025-04-23T14:24:27.8051379+02:00||;True|2025-04-22T07:23:33.4961515+02:00||;True|2025-04-22T07:16:30.0019927+02:00||;True|2025-04-17T07:35:19.5003910+02:00||;True|2025-04-16T07:51:44.2105982+02:00||;True|2025-04-15T17:39:22.9354819+02:00||;True|2025-04-15T13:59:38.1491035+02:00||;True|2025-04-15T13:26:09.1911007+02:00||;False|2025-04-15T13:24:05.8283613+02:00||;True|2025-04-15T12:05:53.7928484+02:00||;True|2025-04-14T11:46:19.0213400+02:00||;True|2025-04-14T11:19:57.9110025+02:00||;False|2025-04-14T11:18:49.2970157+02:00||;True|2025-04-14T10:56:19.4313583+02:00||;True|2025-04-14T10:09:57.0472222+02:00||;True|2025-04-11T09:36:58.9281719+02:00||;True|2025-04-11T07:56:15.1143584+02:00||;True|2025-04-10T08:08:20.7849097+02:00||;True|2025-04-09T12:56:06.8510589+02:00||;True|2025-04-09T12:39:21.5101756+02:00||;True|2025-04-09T12:35:02.6306664+02:00||;True|2025-04-09T07:53:00.7307516+02:00||;True|2025-04-07T15:17:24.3233000+02:00||;True|2025-04-04T18:09:18.8844877+02:00||;True|2025-04-03T12:27:18.9922316+02:00||;True|2025-04-03T09:48:50.2518754+02:00||;True|2025-03-31T13:53:07.3910797+02:00||;True|2025-03-31T12:46:18.3638787+02:00||;True|2025-03-31T11:01:06.0182900+02:00||;True|2025-03-31T10:55:30.7399322+02:00||;True|2025-03-31T10:41:08.8975919+02:00||;True|2025-03-31T10:15:29.6315309+02:00||;True|2025-03-31T08:53:20.4511304+02:00||;</History>
|
||||||
<LastFailureDetails />
|
<LastFailureDetails />
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
</Project>
|
</Project>
|
||||||
Loading…
x
Reference in New Issue
Block a user