瀏覽代碼

MK2: poc+

HOME 7 月之前
父節點
當前提交
c7e4bf0f11

+ 1 - 1
FNZCM2/FNZCM2.Abstractions/ideas/ScanExistedFolder/ExistedAlbumFolder.md

@@ -1,4 +1,4 @@
-# ExistedAlbumFolder
+# Existed Album Folder Structure
 
 ## Type-A Mix-in bound disc
 

+ 25 - 14
FNZCM2/FNZCM2.Abstractions/ideas/ScanExistedFolder/ExistedLibraryFolder.md

@@ -1,12 +1,11 @@
-# ExistedLibrary
+# Existed Library Folder Structure
 
-## Type-A A4U FSN1/DS4
+## Type-A A4U:FSN1
 
 ```
 📁LibraryRoot
-├─📁A
-│  ├─PlayList.fpl
-│  ├─PlayList.m3u8
+├─📁ArtistA
+│  ├─📝PlayList.fpl
 │  ├─📁Albums
 │  │  ├─📁Album1
 │  │  ├─📁Album2 
@@ -26,7 +25,7 @@
 │      ├─🎼Track.Flac
 │      └─🎼...
-└─📁B
+└─📁ArtistB
     ├─📁Albums
     ├─📁Brrr
     └─📁Single tracks
@@ -34,10 +33,25 @@
         └─🎼...
 ```
 
-## Type-B A4UJC13
+## Type-C TLMC/T
 
 ```
 📁LibraryRoot
+├─📁Grpup1
+│  ├─📁Album1
+│  ├─📁Album2
+│  └─📁...
+│
+├─📁Grpup2
+└─📁...
+```
+
+
+## Type-B A4U:JC13
+
+```
+📁LibraryRoot
+├─📝PlayList.m3u8
 ├─📁!bonus
 │  ├─🎼Track.Flac
 │  └─🎼...
@@ -47,15 +61,12 @@
 └─📁...
 ```
 
-## Type-C TLMC/T
+## Type-D A4U:DS4
 
 ```
 📁LibraryRoot
-├─📁Grpup1
-│  ├─📁Album1
-│  ├─📁Album2
-│  └─📁...
-│
-├─📁Grpup2
+├─📝PlayList.m3u8
+├─📁Album1
+├─📁Album2
 └─📁...
 ```

+ 1 - 1
FNZCM2/FNZCM2.Abstractions/ideas/ScanExistedFolder/IOAPI.md

@@ -1,4 +1,4 @@
-# API
+# IOAPI
 
 ## System.IO.Enumeration.FileSystemEnumerable
 

+ 41 - 0
FNZCM2/FNZCM2.ProofOfConcept/PocScanFolder.cs

@@ -0,0 +1,41 @@
+using System.IO.Enumeration;
+using FSE = (bool isDir, string path, long size, System.DateTimeOffset lastWrited);
+
+namespace FNZCM2.ProofOfConcept;
+
+internal static class PocScanFolder
+{
+    public static void RunPoc()
+    {
+        var fse = new FileSystemEnumerable<FSE>(
+            "library",
+            (ref FileSystemEntry p) => new(
+                p.IsDirectory,
+                p.ToFullPath(),
+                p.Length,
+                p.LastWriteTimeUtc
+            ),
+            new()
+            {
+                RecurseSubdirectories = true,
+            });
+
+        var lst = new List<FSE>();
+
+        foreach (var entry in fse)
+        {
+            if (entry.isDir) continue;
+
+            lst.Add(entry);
+
+            int bp = 0;
+            // by file type
+            // - read tags
+            // - make cache model
+        }
+
+        var allSize = lst.Sum(p => p.size);
+        var fmt = allSize.ToString("N0");
+        //SUCCESS
+    }
+}

+ 2 - 1
FNZCM2/FNZCM2.ProofOfConcept/TickAsUUID.cs

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
 
 namespace FNZCM2.ProofOfConcept;
 
-internal static class TickAsUUID
+internal static class PocTickAsUUID
 {
     public static void RunPoc()
     {
@@ -22,5 +22,6 @@ internal static class TickAsUUID
         {
             int bp = 0;
         }
+        //SUCCESS
     }
 }

+ 2 - 1
FNZCM2/FNZCM2.ProofOfConcept/Program.cs

@@ -4,6 +4,7 @@ using FNZCM2.ProofOfConcept;
 
 Console.WriteLine("Hello, World!");
 
-TickAsUUID.RunPoc();
+//PocTickAsUUID.RunPoc();
+PocScanFolder.RunPoc();
 
 Console.WriteLine("Goodbye, World!");