pull/12348/merge
ItsAllAboutTheCode 3 weeks ago committed by GitHub
commit dc6d4c48ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,6 +7,12 @@
"commands": [
"dotnet-ef"
]
},
"swashbuckle.aspnetcore.cli": {
"version": "6.7.0",
"commands": [
"swagger"
]
}
}
}

@ -5,7 +5,7 @@
"name": ".NET Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"preLaunchTask": "build debug",
"program": "${workspaceFolder}/Jellyfin.Server/bin/Debug/net9.0/jellyfin.dll",
"args": [],
"cwd": "${workspaceFolder}/Jellyfin.Server",
@ -21,7 +21,7 @@
"name": ".NET Launch (nowebclient)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"preLaunchTask": "build debug",
"program": "${workspaceFolder}/Jellyfin.Server/bin/Debug/net9.0/jellyfin.dll",
"args": ["--nowebclient"],
"cwd": "${workspaceFolder}/Jellyfin.Server",
@ -33,7 +33,7 @@
"name": "ghcs .NET Launch (nowebclient, ffmpeg)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"preLaunchTask": "build debug",
"program": "${workspaceFolder}/Jellyfin.Server/bin/Debug/net9.0/jellyfin.dll",
"args": ["--nowebclient", "--ffmpeg", "/usr/lib/jellyfin-ffmpeg/ffmpeg"],
"cwd": "${workspaceFolder}/Jellyfin.Server",

113
.vscode/tasks.json vendored

@ -1,16 +1,108 @@
{
"version": "2.0.0",
"inputs": [
{
"id": "buildConfig",
"type": "pickString",
"options": ["Debug", "Release"],
"default": "Release",
"description": "Build Config to use (Debug or Release)."
},
{
"id": "jellyfinWebDir",
"type": "promptString",
"default": "${env:JELLYFIN_WEB_DIR}",
"description": "Web Client content directory to use with server"
},
{
"id": "openapiJsonOutputDir",
"type": "promptString",
"default": "${workspaceFolder}",
"description": "Output Directory to output generated openapi.json file."
}
],
"tasks": [
{
"label": "build debug",
"command": "dotnet",
"type": "process",
"hide": true,
"args": [
"build",
"${workspaceFolder}/Jellyfin.Server/Jellyfin.Server.csproj",
"-c",
"Debug"
],
"problemMatcher": "$msCompile"
},
{
"label": "build release",
"command": "dotnet",
"type": "process",
"hide": true,
"args": [
"build",
"${workspaceFolder}/Jellyfin.Server/Jellyfin.Server.csproj",
"-c",
"Release"
],
"problemMatcher": "$msCompile"
},
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/Jellyfin.Server/Jellyfin.Server.csproj"
"${workspaceFolder}/Jellyfin.Server/Jellyfin.Server.csproj",
"-c",
"${input:buildConfig}"
],
"problemMatcher": "$msCompile"
},
{
"label": "launch (console)",
"command": "dotnet",
"type": "process",
"args": [
"run",
"--project", "Jellyfin.Server",
"-c",
"${input:buildConfig}"
],
"options": {" cwd": "${workspaceFolder}/Jellyfin.Server"},
"dependsOn": ["build"]
},
{
"label": "launch (console + pick webdir)",
"command": "dotnet",
"type": "process",
"args": [
"run",
"--project", "Jellyfin.Server",
"-c",
"${input:buildConfig}",
"--webdir",
"${input:jellyfinWebDir}"
],
"options": {" cwd": "${workspaceFolder}/Jellyfin.Server"},
"dependsOn": ["build"]
},
{
"label": "launch (nowebclient)",
"command": "dotnet",
"type": "process",
"args": [
"run",
"--project", "Jellyfin.Server",
"-c",
"${input:buildConfig}",
"--nowebclient"
],
"options": {" cwd": "${workspaceFolder}/Jellyfin.Server"},
"dependsOn": ["build"]
},
{
"label": "api tests",
"command": "dotnet",
@ -20,7 +112,24 @@
"${workspaceFolder}/tests/Jellyfin.Api.Tests/Jellyfin.Api.Tests.csproj"
],
"problemMatcher": "$msCompile"
}
},
{
"label": "openapi generate",
"command": "dotnet",
"type": "process",
"args": [
"swagger",
"tofile",
"--host",
"http://localhost",
"--output",
"${input:openapiJsonOutputDir}/openapi.json",
"${workspaceFolder}/Jellyfin.Server/bin/Release/net9.0/jellyfin.dll",
"api-docs",
],
"problemMatcher":"$eslint-compact",
"dependsOn": ["build release"]
},
],
"options": {
"env": {

@ -74,6 +74,7 @@
<PackageVersion Include="Svg.Skia" Version="2.0.0.4" />
<PackageVersion Include="Swashbuckle.AspNetCore.ReDoc" Version="6.5.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.2.3" />
<PackageVersion Include="Swashbuckle.AspNetCore.Swagger" Version="6.7.0" />
<PackageVersion Include="System.Globalization" Version="4.3.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Text.Encoding.CodePages" Version="9.0.3" />

@ -15,6 +15,7 @@
<PackageReference Include="Microsoft.Extensions.Http" />
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" />
<PackageReference Include="Swashbuckle.AspNetCore.Swagger" />
</ItemGroup>
<ItemGroup>

@ -66,6 +66,18 @@ namespace Jellyfin.Server
return Task.CompletedTask;
}
// The dotnet swagger tool passes in an --applicationName that isn't allowed by the CLI parser
// Skip over it and add the "nowebclient" option to the server to allow it to start successfully
// Swagger is used to generate the OpenAPI document using the startup assembly and then exit the app
if (Assembly.GetEntryAssembly()?.GetName().Name == "dotnet-swagger")
{
var startupOptions = new StartupOptions
{
NoWebClient = true
};
return StartApp(startupOptions);
}
// Parse the command line arguments and either start the app or exit indicating error
return Parser.Default.ParseArguments<StartupOptions>(args)
.MapResult(StartApp, ErrorParsingArguments);

Loading…
Cancel
Save