diff --git a/.idea/.idea.Abyss/.idea/workspace.xml b/.idea/.idea.Abyss/.idea/workspace.xml
index 1ad86c0..19883db 100644
--- a/.idea/.idea.Abyss/.idea/workspace.xml
+++ b/.idea/.idea.Abyss/.idea/workspace.xml
@@ -10,24 +10,21 @@
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
-
@@ -43,6 +40,7 @@
+
@@ -54,9 +52,10 @@
-
+
+
@@ -65,6 +64,7 @@
+
@@ -93,17 +93,17 @@
"RunOnceActivity.git.unshallow": "true",
"XThreadsFramesViewSplitterKey": "0.30266345",
"git-widget-placeholder": "dev-task",
- "last_opened_file_path": "/home/acite/embd/WebProjects/Abyss/.gitignore",
+ "last_opened_file_path": "/storage/Images/31/summary.json",
"node.js.detected.package.eslint": "true",
"node.js.detected.package.tslint": "true",
"node.js.selected.package.eslint": "(autodetect)",
"node.js.selected.package.tslint": "(autodetect)",
"nodejs_package_manager_path": "npm",
- "settings.editor.selected.configurable": "preferences.pluginManager",
+ "settings.editor.selected.configurable": "com.jetbrains.python.configuration.PyActiveSdkModuleConfigurable",
"vue.rearranger.settings.migration": "true"
}
}]]>
-
+
@@ -198,7 +198,19 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -218,7 +230,7 @@
-
+
@@ -248,19 +260,6 @@
-
- file://$PROJECT_DIR$/Abyss/Components/Services/TaskService.cs
- 60
-
-
-
-
-
-
-
-
-
-
diff --git a/Abyss.sln.DotSettings.user b/Abyss.sln.DotSettings.user
index 674a5bb..152a239 100644
--- a/Abyss.sln.DotSettings.user
+++ b/Abyss.sln.DotSettings.user
@@ -3,4 +3,5 @@
ForceIncluded
ForceIncluded
ForceIncluded
+ ForceIncluded
ForceIncluded
\ No newline at end of file
diff --git a/Abyss/Components/Controllers/Media/ImageController.cs b/Abyss/Components/Controllers/Media/ImageController.cs
index 969c42d..c5f94fc 100644
--- a/Abyss/Components/Controllers/Media/ImageController.cs
+++ b/Abyss/Components/Controllers/Media/ImageController.cs
@@ -1,6 +1,9 @@
using Abyss.Components.Services;
using Abyss.Components.Static;
+using Abyss.Components.Tools;
+using Abyss.Model;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Abyss.Components.Controllers.Media;
@@ -28,7 +31,7 @@ public class ImageController(ILogger logger, ResourceService rs
if(r == null)
return StatusCode(401, new { message = "Unauthorized" });
- return Ok(r);
+ return Ok(r.NaturalSort(x => x));
}
[HttpGet("{id}")]
@@ -42,6 +45,27 @@ public class ImageController(ILogger logger, ResourceService rs
return Ok(await System.IO.File.ReadAllTextAsync(d));
}
+
+ [HttpPost("{id}/bookmark")]
+ public async Task Bookmark(string id, string token, [FromBody] Bookmark bookmark)
+ {
+ var d = Helpers.SafePathCombine(ImageFolder, [id, "summary.json"]);
+ if (d == null) return StatusCode(403, new { message = "403 Denied" });
+
+ var r = await rs.Update(d, token, Ip);
+ if (!r) return StatusCode(403, new { message = "403 Denied" });
+
+ Comic c = JsonConvert.DeserializeObject(await System.IO.File.ReadAllTextAsync(d))!;
+
+ var bookmarkPage = Helpers.SafePathCombine(ImageFolder, [id, bookmark.Page]);
+ if(!System.IO.File.Exists(bookmarkPage))
+ return BadRequest();
+
+ c.Bookmarks.Add(bookmark);
+ var o = JsonConvert.SerializeObject(c);
+ await System.IO.File.WriteAllTextAsync(d, o);
+ return Ok();
+ }
[HttpGet("{id}/{file}")]
public async Task Get(string id, string file, string token)
diff --git a/Abyss/Components/Controllers/Media/VideoController.cs b/Abyss/Components/Controllers/Media/VideoController.cs
index c04968b..520a995 100644
--- a/Abyss/Components/Controllers/Media/VideoController.cs
+++ b/Abyss/Components/Controllers/Media/VideoController.cs
@@ -1,7 +1,10 @@
using System.Diagnostics;
using Abyss.Components.Services;
using Abyss.Components.Static;
+using Abyss.Components.Tools;
+using Abyss.Model;
using Microsoft.AspNetCore.Mvc;
+using Newtonsoft.Json;
namespace Abyss.Components.Controllers.Media;
@@ -38,10 +41,24 @@ public class VideoController(ILogger logger, ResourceService rs
var d = Helpers.SafePathCombine(VideoFolder, klass);
if (d == null) return StatusCode(403, new { message = "403 Denied" });
var r = await rs.Query(d, token, Ip);
-
if (r == null) return StatusCode(401, new { message = "Unauthorized" });
+
+ var rv = r.Select(x =>
+ {
+ return Helpers.SafePathCombine(VideoFolder, [klass, x, "summary.json"]);
+ }).ToArray();
+
+ for (int i = 0; i < rv.Length; i++)
+ {
+ if(rv[i] == null) continue;
+ rv[i] = await System.IO.File.ReadAllTextAsync(rv[i] ?? "");
+ }
+
+ var sv = rv.Where(x => x!=null).Select(x => x ?? "")
+ .Select(x => JsonConvert.DeserializeObject