mirror of
https://github.com/rosenbjerg/FFMpegCore.git
synced 2025-02-18 11:02:31 +00:00
format cleanup to avoid lint error
This commit is contained in:
parent
7be5496305
commit
8e32d68877
8 changed files with 31 additions and 35 deletions
|
@ -6,24 +6,34 @@ public enum FFMpegVersions : ushort
|
|||
{
|
||||
[Description("https://ffbinaries.com/api/v1/version/latest")]
|
||||
Latest,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/6.1")]
|
||||
V6_1,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/5.1")]
|
||||
V5_1,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/4.4.1")]
|
||||
V4_4_1,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/4.2.1")]
|
||||
V4_2_1,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/4.2")]
|
||||
V4_2,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/4.1")]
|
||||
V4_1,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/4.0")]
|
||||
V4_0,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/3.4")]
|
||||
V3_4,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/3.3")]
|
||||
V3_3,
|
||||
|
||||
[Description("https://ffbinaries.com/api/v1/version/3.2")]
|
||||
V3_2
|
||||
}
|
||||
|
|
|
@ -8,9 +8,10 @@ internal static class EnumExtensions
|
|||
{
|
||||
var field = enumValue.GetType().GetField(enumValue.ToString());
|
||||
if (field == null)
|
||||
{
|
||||
return enumValue.ToString();
|
||||
}
|
||||
|
||||
var attributes = field.GetCustomAttributes(typeof(DescriptionAttribute), false);
|
||||
if (Attribute.GetCustomAttribute(field, typeof(DescriptionAttribute)) is DescriptionAttribute attribute)
|
||||
{
|
||||
return attribute.Description;
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
<PackageTags>ffmpeg ffprobe convert video audio mediafile resize analyze download</PackageTags>
|
||||
<Authors>Malte Rosenbjerg, Vlad Jerca, Max Bagryantsev, Kerry Cao</Authors>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\FFMpegCore\FFMpegCore.csproj"/>
|
||||
</ItemGroup>
|
||||
|
|
|
@ -20,13 +20,13 @@ public class FFMpegDownloader
|
|||
{
|
||||
// get all available versions
|
||||
var versionInfo = await FFbinariesService.GetVersionInfo(version);
|
||||
|
||||
|
||||
// get the download info for the current platform
|
||||
var downloadInfo = versionInfo.BinaryInfo?.GetCompatibleDownloadInfo(platformOverride) ??
|
||||
throw new FFMpegDownloaderException("Failed to get compatible download info");
|
||||
|
||||
|
||||
var successList = new List<string>();
|
||||
|
||||
|
||||
// download ffmpeg if selected
|
||||
if (binaries.HasFlag(FFMpegBinaries.FFMpeg) && downloadInfo.FFMpeg is not null)
|
||||
{
|
||||
|
@ -51,4 +51,3 @@ public class FFMpegDownloader
|
|||
return successList;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -6,29 +6,21 @@ namespace FFMpegCore.Extensions.Downloader.Models;
|
|||
|
||||
internal record BinaryInfo
|
||||
{
|
||||
[JsonPropertyName("windows-64")]
|
||||
public DownloadInfo? Windows64 { get; set; }
|
||||
[JsonPropertyName("windows-64")] public DownloadInfo? Windows64 { get; set; }
|
||||
|
||||
[JsonPropertyName("windows-32")]
|
||||
public DownloadInfo? Windows32 { get; set; }
|
||||
[JsonPropertyName("windows-32")] public DownloadInfo? Windows32 { get; set; }
|
||||
|
||||
[JsonPropertyName("linux-32")]
|
||||
public DownloadInfo? Linux32 { get; set; }
|
||||
[JsonPropertyName("linux-32")] public DownloadInfo? Linux32 { get; set; }
|
||||
|
||||
[JsonPropertyName("linux-64")]
|
||||
public DownloadInfo? Linux64 { get; set; }
|
||||
[JsonPropertyName("linux-64")] public DownloadInfo? Linux64 { get; set; }
|
||||
|
||||
[JsonPropertyName("linux-armhf")]
|
||||
public DownloadInfo? LinuxArmhf { get; set; }
|
||||
[JsonPropertyName("linux-armhf")] public DownloadInfo? LinuxArmhf { get; set; }
|
||||
|
||||
[JsonPropertyName("linux-armel")]
|
||||
public DownloadInfo? LinuxArmel { get; set; }
|
||||
[JsonPropertyName("linux-armel")] public DownloadInfo? LinuxArmel { get; set; }
|
||||
|
||||
[JsonPropertyName("linux-arm64")]
|
||||
public DownloadInfo? LinuxArm64 { get; set; }
|
||||
[JsonPropertyName("linux-arm64")] public DownloadInfo? LinuxArm64 { get; set; }
|
||||
|
||||
[JsonPropertyName("osx-64")]
|
||||
public DownloadInfo? Osx64 { get; set; }
|
||||
[JsonPropertyName("osx-64")] public DownloadInfo? Osx64 { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Automatically get the compatible download info for current os and architecture
|
||||
|
|
|
@ -4,12 +4,9 @@ namespace FFMpegCore.Extensions.Downloader.Models;
|
|||
|
||||
internal record DownloadInfo
|
||||
{
|
||||
[JsonPropertyName("ffmpeg")]
|
||||
public string? FFMpeg { get; set; }
|
||||
[JsonPropertyName("ffmpeg")] public string? FFMpeg { get; set; }
|
||||
|
||||
[JsonPropertyName("ffprobe")]
|
||||
public string? FFProbe { get; set; }
|
||||
[JsonPropertyName("ffprobe")] public string? FFProbe { get; set; }
|
||||
|
||||
[JsonPropertyName("ffplay")]
|
||||
public string? FFPlay { get; set; }
|
||||
[JsonPropertyName("ffplay")] public string? FFPlay { get; set; }
|
||||
}
|
||||
|
|
|
@ -4,12 +4,9 @@ namespace FFMpegCore.Extensions.Downloader.Models;
|
|||
|
||||
internal record VersionInfo
|
||||
{
|
||||
[JsonPropertyName("version")]
|
||||
public string? Version { get; set; }
|
||||
[JsonPropertyName("version")] public string? Version { get; set; }
|
||||
|
||||
[JsonPropertyName("permalink")]
|
||||
public string? Permalink { get; set; }
|
||||
[JsonPropertyName("permalink")] public string? Permalink { get; set; }
|
||||
|
||||
[JsonPropertyName("bin")]
|
||||
public BinaryInfo? BinaryInfo { get; set; }
|
||||
[JsonPropertyName("bin")] public BinaryInfo? BinaryInfo { get; set; }
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ internal class FFbinariesService
|
|||
return versionInfo ??
|
||||
throw new FFMpegDownloaderException($"Failed to deserialize version info from {versionUri}", jsonString);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Download file from uri
|
||||
/// </summary>
|
||||
|
|
Loading…
Add table
Reference in a new issue