mirror of
https://github.com/DrizzleTime/Foxel.git
synced 2026-05-26 02:29:59 +08:00
fix: standardize upload request path and handle null storage path in URL generation
This commit is contained in:
@@ -122,7 +122,7 @@ public sealed class BackgroundTaskQueue : IBackgroundTaskQueue, IDisposable
|
||||
foreach (var picture in unfinishedPictures)
|
||||
{
|
||||
// 构建原始文件路径
|
||||
string relativePath = picture.Path.TrimStart('/').Replace("uploads", "Uploads");
|
||||
string relativePath = picture.Path.TrimStart('/');
|
||||
string originalFilePath = Path.Combine(Directory.GetCurrentDirectory(), relativePath);
|
||||
if (File.Exists(originalFilePath))
|
||||
{
|
||||
@@ -255,7 +255,7 @@ public sealed class BackgroundTaskQueue : IBackgroundTaskQueue, IDisposable
|
||||
{
|
||||
// 本地存储缩略图
|
||||
relativeThumbnailPath =
|
||||
$"/uploads/{Path.GetRelativePath("Uploads", Path.GetDirectoryName(thumbnailPath)!)}/{Path.GetFileName(thumbnailPath)}";
|
||||
$"/Uploads/{Path.GetRelativePath("Uploads", Path.GetDirectoryName(thumbnailPath)!)}/{Path.GetFileName(thumbnailPath)}";
|
||||
picture.ThumbnailPath = relativeThumbnailPath.Replace('\\', '/');
|
||||
}
|
||||
else if (picture.StorageType == StorageType.Telegram)
|
||||
|
||||
Reference in New Issue
Block a user