thumbnail service wip

This commit is contained in:
2025-05-26 10:09:13 -04:00
parent 18312c9de7
commit d293a96379
11 changed files with 45 additions and 9 deletions

View File

@@ -1,4 +1,7 @@
global using MaybeError; global using MaybeError;
using AobaCore.Services;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using MongoDB.Driver; using MongoDB.Driver;

View File

@@ -0,0 +1,5 @@
namespace AobaCore.Models;
internal class MeidaThumbnail
{
}

View File

@@ -12,7 +12,7 @@ using System.Security.Cryptography;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace AobaCore; namespace AobaCore.Services;
public class AccountsService(IMongoDatabase db) public class AccountsService(IMongoDatabase db)
{ {
public readonly IMongoCollection<User> _users = db.GetCollection<User>("users"); public readonly IMongoCollection<User> _users = db.GetCollection<User>("users");

View File

@@ -4,7 +4,7 @@ using Microsoft.Extensions.Hosting;
using MongoDB.Driver; using MongoDB.Driver;
namespace AobaCore; namespace AobaCore.Services;
public class AobaIndexCreationService(IMongoDatabase db): BackgroundService public class AobaIndexCreationService(IMongoDatabase db): BackgroundService
{ {

View File

@@ -6,7 +6,7 @@ using MongoDB.Bson;
using MongoDB.Driver; using MongoDB.Driver;
using MongoDB.Driver.GridFS; using MongoDB.Driver.GridFS;
namespace AobaCore; namespace AobaCore.Services;
public class AobaService(IMongoDatabase db) public class AobaService(IMongoDatabase db)
{ {

View File

@@ -0,0 +1,28 @@
using AobaCore.Models;
using MongoDB.Bson;
using MongoDB.Driver;
using MongoDB.Driver.GridFS;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AobaCore.Services;
internal class ThumbnailService(IMongoDatabase db, AobaService aobaService)
{
private readonly GridFSBucket _gridfs = new GridFSBucket(db);
private readonly IMongoCollection<MeidaThumbnail> _thumbnails = db.GetCollection<MeidaThumbnail>("thumbs");
public async Task<MemoryStream> GetThumbnailAsync(ObjectId id)
{
}
public async Task GenerateThumbnailAsync(ObjectId id)
{
}
}

View File

@@ -1,5 +1,5 @@
using AobaCore; using AobaCore.Models;
using AobaCore.Models; using AobaCore.Services;
using AobaServer.Utils; using AobaServer.Utils;

View File

@@ -1,4 +1,4 @@
using AobaCore; using AobaCore.Services;
using AobaServer.Models; using AobaServer.Models;
using AobaServer.Utils; using AobaServer.Utils;

View File

@@ -1,4 +1,4 @@
using AobaCore; using AobaCore.Services;
using HeyRed.Mime; using HeyRed.Mime;

View File

@@ -1,7 +1,7 @@
using Aoba.RPC.Auth; using Aoba.RPC.Auth;
using AobaCore;
using AobaCore.Models; using AobaCore.Models;
using AobaCore.Services;
using AobaServer.Models; using AobaServer.Models;
using AobaServer.Utils; using AobaServer.Utils;

View File

@@ -1,6 +1,6 @@
using Aoba.RPC; using Aoba.RPC;
using AobaCore; using AobaCore.Services;
using AobaServer.Models; using AobaServer.Models;
using AobaServer.Utils; using AobaServer.Utils;