Skip to content

Commit

Permalink
feat: QoL changes; better login & config page; responsive css;
Browse files Browse the repository at this point in the history
  • Loading branch information
hexxone committed May 7, 2024
1 parent c6698f0 commit fb50755
Show file tree
Hide file tree
Showing 33 changed files with 1,437 additions and 897 deletions.
157 changes: 157 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -192,3 +192,160 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true


# migrated jellyfin rules

# NOTE: Requires **VS2019 16.3** or later

# Rules for Jellyfin.Server
# Description: Code analysis rules for Jellyfin.Server.csproj

# Code files
[*.{cs,vb}]


# disable warning CA1014: Mark assemblies with CLSCompliantAttribute
dotnet_diagnostic.CA1014.severity = suggestion

# disable warning CA1024: Use properties where appropriate
dotnet_diagnostic.CA1024.severity = suggestion

# disable warning CA1031: Do not catch general exception types
dotnet_diagnostic.CA1031.severity = suggestion

# disable warning CA1032: Implement standard exception constructors
dotnet_diagnostic.CA1032.severity = suggestion

# disable warning CA1040: Avoid empty interfaces
dotnet_diagnostic.CA1040.severity = suggestion

# disable warning CA1054: Change the type of parameter url from string to System.Uri
dotnet_diagnostic.CA1054.severity = none

# disable warning CA1055: URI return values should not be strings
dotnet_diagnostic.CA1055.severity = none

# disable warning CA1056: URI properties should not be strings
dotnet_diagnostic.CA1056.severity = none

# disable warning CA1062: Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = suggestion

# disable warning CA1303: Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none

# error on CA1305: Specify IFormatProvider
dotnet_diagnostic.CA1305.severity = error

# disable warning CA1308: Normalize strings to uppercase
dotnet_diagnostic.CA1308.severity = none

# TODO: enable when false positives are fixed
# disable warning CA1508: Avoid dead conditional code
dotnet_diagnostic.CA1508.severity = suggestion

# disable warning CA1716: Identifiers should not match keywords
dotnet_diagnostic.CA1716.severity = suggestion

# disable warning CA1720: Identifiers should not contain type names
dotnet_diagnostic.CA1720.severity = suggestion

# disable warning CA1724: Type names should not match namespaces
dotnet_diagnostic.CA1724.severity = suggestion

# error on CA1725: Parameter names should match base declaration
dotnet_diagnostic.CA1725.severity = error

# error on CA1725: Call async methods when in an async method
dotnet_diagnostic.CA1727.severity = error

# disable warning CA1805: Do not initialize unnecessarily
dotnet_diagnostic.CA1805.severity = suggestion

# disable warning CA1812: internal class that is apparently never instantiated.
# If so, remove the code from the assembly.
# If this class is intended to contain only static members, make it static
dotnet_diagnostic.CA1812.severity = suggestion

# disable warning CA1822: Member does not access instance data and can be marked as static
dotnet_diagnostic.CA1822.severity = suggestion

# error on CA1843: Do not use 'WaitAll' with a single task
dotnet_diagnostic.CA1843.severity = error

# disable warning CA1848: Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = none

# disable warning CA2000: Dispose objects before losing scope
dotnet_diagnostic.CA2000.severity = suggestion

# error on CA2016: Forward the CancellationToken parameter to methods that take one
# or pass in 'CancellationToken.None' explicitly to indicate intentionally not propagating the token
dotnet_diagnostic.CA2016.severity = error

# disable warning CA2101: Specify marshaling for P/Invoke string arguments
dotnet_diagnostic.CA2101.severity = none

# disable warning CA2234: Pass System.Uri objects instead of strings
dotnet_diagnostic.CA2234.severity = none

# disable warning CA2253: Named placeholders should not be numeric values
dotnet_diagnostic.CA2253.severity = suggestion

# error on CA2254: Template should be a static expression
dotnet_diagnostic.CA2254.severity = error

# disable warning CA5394: Do not use insecure randomness
dotnet_diagnostic.CA5394.severity = suggestion

# disable warning SA1009: Closing parenthesis should be followed by a space.
dotnet_diagnostic.SA1009.severity = none

# disable warning SA1011: Closing square bracket should be followed by a space.
dotnet_diagnostic.SA1011.severity = none

# disable warning SA1101: Prefix local calls with 'this.'
dotnet_diagnostic.SA1101.severity = none

# disable warning SA1108: Block statements should not contain embedded comments
dotnet_diagnostic.SA1108.severity = none

# disable warning SA1118: Parameter must not span multiple lines.
dotnet_diagnostic.SA1118.severity = none

# disable warning SA1128:: Put constructor initializers on their own line
dotnet_diagnostic.SA1128.severity = none

# disable warning SA1130: Use lambda syntax
dotnet_diagnostic.SA1130.severity = none

# disable warning SA1200: 'using' directive must appear within a namespace declaration
dotnet_diagnostic.SA1200.severity = none

# disable warning SA1202: 'public' members must come before 'private' members
dotnet_diagnostic.SA1202.severity = none

# disable warning SA1204: Static members must appear before non-static members
dotnet_diagnostic.SA1204.severity = none

# disable warning SA1309: Fields must not begin with an underscore
dotnet_diagnostic.SA1309.severity = none

# disable warning SA1413: Use trailing comma in multi-line initializers
dotnet_diagnostic.SA1413.severity = none

# disable warning SA1512: Single-line comments must not be followed by blank line
dotnet_diagnostic.SA1512.severity = none

# disable warning SA1515: Single-line comment should be preceded by blank line
dotnet_diagnostic.SA1515.severity = none

# disable warning SA1600: Elements should be documented
dotnet_diagnostic.SA1600.severity = none

# disable warning SA1602: Enumeration items should be documented
dotnet_diagnostic.SA1602.severity = none

# disable warning SA1633: The file header is missing or not located at the top of the file
dotnet_diagnostic.SA1633.severity = none
7 changes: 0 additions & 7 deletions Directory.Build.props

This file was deleted.

7 changes: 7 additions & 0 deletions JellyfinPluginHelper/JellyfinPluginHelper.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MinVer" Version="5.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>

</Project>
13 changes: 9 additions & 4 deletions JellyfinPluginHelper/Program.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#region

using System.Globalization;
using System.IO.Compression;
using System.Security.Cryptography;
using System.Text.Json;
Expand Down Expand Up @@ -47,6 +48,8 @@
return;
}

// TODO make nuget package with automatic build target??
// TODO use MinVer.Lib instead: https://github.com/adamralph/minver/issues/1006

var version = args[0];
var solutionDir = args[1];
Expand All @@ -65,7 +68,7 @@ static async Task Main(string version, string solutionDir, string dllPath)
Console.WriteLine("JPH - Using dll path: " + dllPath);
Console.WriteLine("JPH - Using meta path: " + metaPath);

var timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ");
var timestamp = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ssZ", CultureInfo.InvariantCulture);

UpdateMeta(metaPath, version, timestamp);

Expand Down Expand Up @@ -103,7 +106,7 @@ static string FixVersionString(string versionStr)

versionStr = versionStr.Replace("-alpha.0", "");
var parts = versionStr.Split('.');
parts[2] = (int.Parse(parts[2]) - 1).ToString();
parts[2] = (int.Parse(parts[2], CultureInfo.InvariantCulture) - 1).ToString(CultureInfo.InvariantCulture);
return string.Join(".", parts);
}

Expand All @@ -126,12 +129,14 @@ static async Task AddManifestVersion(string manifestUrl, string manifestTargetPa

using var webClient = new HttpClient();
var manifestJson = await webClient.GetStringAsync(manifestUrl);
var manifest = JsonSerializer.Deserialize<List<Dictionary<string, object>>>(manifestJson);

var manifest = JsonSerializer.Deserialize<List<Dictionary<string, object>>>(manifestJson)
?? throw new Exception("Failed to deserialize manifest.");

manifest[0]["versions"] = new List<Dictionary<string, object>> { manifestVersion };

var json = JsonSerializer.Serialize(manifest, new JsonSerializerOptions { WriteIndented = true });
File.WriteAllText(manifestTargetPath, json);

Console.WriteLine("JPH - Successfully updated manifest.json.");
}

Expand Down
Loading

0 comments on commit fb50755

Please sign in to comment.