-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
56 lines (45 loc) · 2.45 KB
/
Copy pathProgram.cs
File metadata and controls
56 lines (45 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
// Publish single trimmed executable:
// dotnet publish -r win-x64 -c Release /p:PublishSingleFile=true /p:PublishTrimmed=true
namespace deepduplicates
{
class Program
{
// Accuracy tested to 99.99% with default settings - so check the report for false positives. On average there is aprox. 1 i every 10000 files.
static async Task Main(string[] args)
{
VideoInfoContext db = new VideoInfoContext();
db.Database.EnsureCreated();
FileHandler fileHandler = await FileHandler.CreateInstance();
if (fileHandler.firstRun) return;
ImageHandler imageHandler = new ImageHandler();
VideoHandler videoHandler = new VideoHandler(fileHandler, imageHandler);
List<VideoInfo> mediaList = await videoHandler.saveVideoMetadataAndScreenshots(db);
if (args.Length>0 && args[0].ToLower() == "clean") {
Console.WriteLine("Clean-mode enabled - DB entries and images are truncated based on current filesystem!");
CleanupHandler ch = new CleanupHandler(db, fileHandler);
await ch.runCleanup();
}
if (args.Length>0 && args[0].ToLower() == "index") {
Console.WriteLine("Indexing enabled - complete index of all files is created!");
fileHandler.generateIndexReport(mediaList);
}
RecommendationHandler recommendationHandler = new RecommendationHandler();
Console.WriteLine("Marking incomplete videos for removal...");
mediaList = recommendationHandler.removingIncompleteVideos(mediaList);
Console.WriteLine("Performing checksum validation...");
mediaList = recommendationHandler.checkChecksumOfAllSimilarVideos_Optimized(mediaList, fileHandler.settings);
Console.WriteLine("Generating batch-file...");
fileHandler.generateBatchFile(mediaList);
Console.WriteLine("Generating HTML report...");
fileHandler.generateReport(mediaList);
Console.WriteLine("Generating Encoding batch...");
fileHandler.generateEncoding(mediaList, fileHandler.settings.encodeSettings);
Console.WriteLine("Check ./output directory");
Console.WriteLine("Done!");
}
}
}