Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 21163b277d | |||
| 7a0d3b7f40 | |||
| 6d2b8c77b2 | |||
| 8bdd9edbb0 | |||
| 5e6b0b21a6 | |||
| 19274d444d |
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
@@ -10,7 +10,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkou code
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Build
|
||||
|
||||
1961
AobaClient/Cargo.lock
generated
1961
AobaClient/Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -6,7 +6,7 @@ edition = "2024"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
dioxus = { version = "0.6.0", features = ["router"] }
|
||||
dioxus = { version = "0.7.2", features = ["router"] }
|
||||
serde = "1.0.219"
|
||||
serde_repr = "0.1.20"
|
||||
tonic = { version = "*", default-features = false, features = [
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use dioxus::signals::{Signal, Writable};
|
||||
use dioxus::signals::{Signal, WritableExt};
|
||||
use web_sys::window;
|
||||
|
||||
use crate::rpc::{login, logout};
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace AobaServer.Controllers;
|
||||
public class MediaController(AobaService aobaService, ILogger<MediaController> logger) : Controller
|
||||
{
|
||||
[HttpGet("{id}")]
|
||||
[HttpGet("{id}/*")]
|
||||
[HttpGet("{id}/{*fn}")]
|
||||
[ResponseCache(Duration = int.MaxValue)]
|
||||
public async Task<IActionResult> MediaAsync(ObjectId id, [FromServices] MongoClient client, CancellationToken cancellationToken)
|
||||
{
|
||||
@@ -29,6 +29,22 @@ public class MediaController(AobaService aobaService, ILogger<MediaController> l
|
||||
return File(file, mime, true);
|
||||
}
|
||||
|
||||
[HttpGet("{id}/dl")]
|
||||
[HttpGet("{id}/dl/{*fn}")]
|
||||
[ResponseCache(Duration = int.MaxValue)]
|
||||
public async Task<IActionResult> DownloadMediaAsync(ObjectId id, [FromServices] MongoClient client, [FromQuery] string? fn = null, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var file = await aobaService.GetFileStreamAsync(id, seekable: true, cancellationToken: cancellationToken);
|
||||
if (file.HasError)
|
||||
{
|
||||
logger.LogError(file.Error.Exception, "Failed to load media stream");
|
||||
return NotFound();
|
||||
}
|
||||
var mime = MimeTypesMap.GetMimeType(file.Value.FileInfo.Filename);
|
||||
_ = aobaService.IncrementViewCountAsync(id, cancellationToken);
|
||||
return File(file, mime, fn ?? file.Value.FileInfo.Filename, true);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Redirect legacy media urls to the new url
|
||||
/// </summary>
|
||||
|
||||
@@ -22,12 +22,12 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg
|
||||
|
||||
# Install `dx`
|
||||
RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
|
||||
RUN cargo binstall dioxus-cli@0.6.3 --root /.cargo -y --force
|
||||
RUN cargo binstall dioxus-cli@0.7.2 --root /.cargo -y --force
|
||||
ENV PATH="/.cargo/bin:$PATH"
|
||||
ARG VERSION
|
||||
ENV APP_VERSION=$VERSION
|
||||
# Create the final bundle folder. Bundle always executes in release mode with optimizations enabled
|
||||
RUN dx bundle --platform web
|
||||
RUN dx bundle --release --platform web
|
||||
|
||||
# Server Build
|
||||
# This stage is used when running from VS in fast mode (Default for Debug configuration)
|
||||
|
||||
@@ -127,7 +127,7 @@ builder.Services.AddHostedService<DebugService>();
|
||||
builder.Services.Configure<FormOptions>(opt =>
|
||||
{
|
||||
opt.ValueLengthLimit = int.MaxValue;
|
||||
opt.MultipartBodyLengthLimit = int.MaxValue;
|
||||
opt.MultipartBodyLengthLimit = long.MaxValue;
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
|
||||
Reference in New Issue
Block a user