Compare commits
5 Commits
v1.1.37
...
7a0d3b7f40
| Author | SHA1 | Date | |
|---|---|---|---|
| 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
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkou code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Build
|
- 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
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
dioxus = { version = "0.6.0", features = ["router"] }
|
dioxus = { version = "0.7.2", features = ["router"] }
|
||||||
serde = "1.0.219"
|
serde = "1.0.219"
|
||||||
serde_repr = "0.1.20"
|
serde_repr = "0.1.20"
|
||||||
tonic = { version = "*", default-features = false, features = [
|
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 web_sys::window;
|
||||||
|
|
||||||
use crate::rpc::{login, logout};
|
use crate::rpc::{login, logout};
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace AobaServer.Controllers;
|
|||||||
public class MediaController(AobaService aobaService, ILogger<MediaController> logger) : Controller
|
public class MediaController(AobaService aobaService, ILogger<MediaController> logger) : Controller
|
||||||
{
|
{
|
||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
[HttpGet("{id}/*")]
|
[HttpGet("{id}/{*fn}")]
|
||||||
[ResponseCache(Duration = int.MaxValue)]
|
[ResponseCache(Duration = int.MaxValue)]
|
||||||
public async Task<IActionResult> MediaAsync(ObjectId id, [FromServices] MongoClient client, CancellationToken cancellationToken)
|
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);
|
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>
|
/// <summary>
|
||||||
/// Redirect legacy media urls to the new url
|
/// Redirect legacy media urls to the new url
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg
|
|||||||
|
|
||||||
# Install `dx`
|
# 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 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"
|
ENV PATH="/.cargo/bin:$PATH"
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
ENV APP_VERSION=$VERSION
|
ENV APP_VERSION=$VERSION
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ builder.Services.AddHostedService<DebugService>();
|
|||||||
builder.Services.Configure<FormOptions>(opt =>
|
builder.Services.Configure<FormOptions>(opt =>
|
||||||
{
|
{
|
||||||
opt.ValueLengthLimit = int.MaxValue;
|
opt.ValueLengthLimit = int.MaxValue;
|
||||||
opt.MultipartBodyLengthLimit = int.MaxValue;
|
opt.MultipartBodyLengthLimit = long.MaxValue;
|
||||||
});
|
});
|
||||||
|
|
||||||
var app = builder.Build();
|
var app = builder.Build();
|
||||||
|
|||||||
Reference in New Issue
Block a user