code clean up and testin github action

This commit is contained in:
PatrickSt1991
2026-01-18 12:53:22 +01:00
parent 196fe4e89b
commit 750f571cf4
23 changed files with 46 additions and 63 deletions

View File

@@ -3,7 +3,6 @@ using Jellyfin2Samsung.Models;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.Json;

View File

@@ -1,6 +1,5 @@
using Avalonia.Platform.Storage;
using Jellyfin2Samsung.Models;
using SkiaSharp;
using System;
using System.Collections.Generic;
using System.IO;
@@ -24,7 +23,7 @@ namespace Jellyfin2Samsung.Helpers.Core
{
new("WGT Files")
{
Patterns = wgtItem
Patterns = wgtItem
},
new("TPK Files")
{
@@ -32,7 +31,7 @@ namespace Jellyfin2Samsung.Helpers.Core
},
new("All Supported Files")
{
Patterns = allItem
Patterns = allItem
}
};

View File

@@ -5,7 +5,6 @@ using Jellyfin2Samsung.Models;
using Jellyfin2Samsung.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Threading;
@@ -47,8 +46,8 @@ namespace Jellyfin2Samsung.Helpers.Core
bool ipMismatch = !localIps.Contains(selectedDevice.DeveloperIP) && !string.IsNullOrEmpty(selectedDevice.DeveloperIP);
if (!string.IsNullOrEmpty(AppSettings.Default.LocalIp)
&& !string.IsNullOrEmpty(selectedDevice.DeveloperIP)
if (!string.IsNullOrEmpty(AppSettings.Default.LocalIp)
&& !string.IsNullOrEmpty(selectedDevice.DeveloperIP)
&& _networkService.IsDifferentSubnet(AppSettings.Default.LocalIp, selectedDevice.DeveloperIP))
{
bool continueExecution =
@@ -95,7 +94,7 @@ namespace Jellyfin2Samsung.Helpers.Core
if (ipMismatch)
{
bool continueExecution = await _dialogService.ShowConfirmationAsync("IP Mismatch","DeveloperIPMismatch".Localized(), "keyContinue".Localized(), "keyStop".Localized());
bool continueExecution = await _dialogService.ShowConfirmationAsync("IP Mismatch", "DeveloperIPMismatch".Localized(), "keyContinue".Localized(), "keyStop".Localized());
if (!continueExecution)
return false;
}

View File

@@ -1,6 +1,5 @@
using Jellyfin2Samsung.Models;
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;

View File

@@ -1,7 +1,6 @@
using Jellyfin2Samsung.Helpers.API;
using Jellyfin2Samsung.Helpers.Core;
using Jellyfin2Samsung.Helpers.Jellyfin.Plugins;
using System;
using System.Diagnostics;
using System.IO;
using System.Linq;
@@ -9,7 +8,6 @@ using System.Net.Http;
using System.Text;
using System.Text.Json.Nodes;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Jellyfin2Samsung.Helpers.Jellyfin.Patches
{

View File

@@ -1,6 +1,4 @@
using System;
namespace Jellyfin2Samsung.Helpers.Jellyfin.Plugins.EditorsChoice
namespace Jellyfin2Samsung.Helpers.Jellyfin.Plugins.EditorsChoice
{
public class PatchEditorsChoice
{

View File

@@ -1,5 +1,4 @@
using Jellyfin2Samsung.Helpers.Core;
using Jellyfin2Samsung.Helpers.Jellyfin.Plugins;
using Jellyfin2Samsung.Interfaces;
using System;
using System.Collections.Generic;

View File

@@ -130,7 +130,7 @@ namespace Jellyfin2Samsung.Helpers.Jellyfin.Plugins
return null;
}
}
public async Task<byte[]?> DownloadBytesAsync(string url)
{
try

View File

@@ -85,7 +85,7 @@ namespace Jellyfin2Samsung.Helpers.Jellyfin.Plugins
UseBabel = true
}
];
public static readonly List<ServerAssetRule> ServerAssetRules =
public static readonly List<ServerAssetRule> ServerAssetRules =
[
new ServerAssetRule(
pluginName: "GenericPluginAsset",

View File

@@ -5,7 +5,6 @@ using Jellyfin2Samsung.Models;
using System;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
namespace Jellyfin2Samsung.Helpers.Jellyfin.Plugins

View File

@@ -31,25 +31,25 @@ namespace Jellyfin2Samsung.Helpers.Tizen.Certificate
if (!Directory.Exists(certificateFolders))
return certificates;
var p12Files = Directory.GetFiles(
certificateFolders,
"author.p12",
SearchOption.AllDirectories);
foreach(var p12Path in p12Files)
{
var directory = Path.GetDirectoryName(p12Path);
if (directory == null)
continue;
var p12Files = Directory.GetFiles(
certificateFolders,
"author.p12",
SearchOption.AllDirectories);
var passwordPath = Path.Combine(directory, "password.txt");
if (!File.Exists(passwordPath))
continue;
foreach (var p12Path in p12Files)
{
var directory = Path.GetDirectoryName(p12Path);
if (directory == null)
continue;
var password = File.ReadAllText(passwordPath).Trim();
if (string.IsNullOrWhiteSpace(password))
continue;
var passwordPath = Path.Combine(directory, "password.txt");
if (!File.Exists(passwordPath))
continue;
var password = File.ReadAllText(passwordPath).Trim();
if (string.IsNullOrWhiteSpace(password))
continue;
try
{
var cert = new X509Certificate2(

View File

@@ -21,7 +21,7 @@ namespace Jellyfin2Samsung.Helpers.Tizen.Devices
_tizenApiClient = tizenApiClient;
}
public async Task<List<NetworkDevice>> ScanForDevicesAsync(CancellationToken cancellationToken = default, bool virtualScan = false)
{

View File

@@ -1,14 +1,13 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Layout;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Media;
using Avalonia.Styling;
using Avalonia.Markup.Xaml.Styling;
using System.Threading.Tasks;
using System;
using Jellyfin2Samsung.Interfaces;
using Jellyfin2Samsung;
using Jellyfin2Samsung.Helpers;
using Jellyfin2Samsung.Interfaces;
using System;
using System.Threading.Tasks;
namespace Jellyfin2Samsung.Services
{

View File

@@ -10,7 +10,6 @@ using System.Net;
using System.Net.Http;
using System.Net.NetworkInformation;
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;

View File

@@ -27,7 +27,7 @@ namespace Jellyfin2Samsung.Services
private readonly IDialogService _dialogService;
public TizenCertificateService(
HttpClient httpClient,
HttpClient httpClient,
IDialogService dialogService)
{
_httpClient = httpClient;
@@ -146,7 +146,7 @@ namespace Jellyfin2Samsung.Services
// Simplified Http Post for Author CSR
private async Task<byte[]> PostAuthorCsrAsync(byte[] csrData, string accessToken, string userId)
{
{
var request = new HttpRequestMessage(HttpMethod.Post, AppSettings.Default.AuthorEndpoint_V3);
var content = new MultipartFormDataContent
{
@@ -198,7 +198,7 @@ namespace Jellyfin2Samsung.Services
};
var v3Request = new HttpRequestMessage(HttpMethod.Post, AppSettings.Default.DistributorsEndpoint_V3);
v3Request.Content = v3Content;
v3Request.Content = v3Content;
var v3Response = await _httpClient.SendAsync(v3Request);
if (!v3Response.IsSuccessStatusCode)

View File

@@ -1,7 +1,7 @@
using System;
using Avalonia.Controls;
using Avalonia.Controls.Templates;
using Jellyfin2Samsung.ViewModels;
using System;
namespace Jellyfin2Samsung
{

View File

@@ -1,14 +1,13 @@
using System;
using CommunityToolkit.Mvvm.Input;
using Jellyfin2Samsung.Helpers;
using Jellyfin2Samsung.Helpers.Core;
using Jellyfin2Samsung.Models;
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Net.Http;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Jellyfin2Samsung.Helpers;
using Jellyfin2Samsung.Helpers.Core;
using Jellyfin2Samsung.Models;
namespace Jellyfin2Samsung.ViewModels
{

View File

@@ -1,6 +1,4 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using Jellyfin2Samsung.Interfaces;
using System;

View File

@@ -31,6 +31,6 @@ namespace Jellyfin2Samsung.ViewModels
private void OnOk() => _close(true);
private void OnCancel() => _close(false);
private void OnCancel() => _close(false);
}
}

View File

@@ -43,7 +43,7 @@ namespace Jellyfin2Samsung.ViewModels
[ObservableProperty]
private JellyTheme? selectedJellyTheme;
[ObservableProperty]
private Bitmap? selectedJellyThemePreview;

View File

@@ -78,7 +78,7 @@ namespace Jellyfin2Samsung.ViewModels
private string L(string key) => _localizationService.GetString(key);
public bool EnableDevicesInput => !IsLoadingDevices;
public string LblRelease => _localizationService.GetString("lblRelease");
public string LblRelease => _localizationService.GetString("lblRelease");
public string LblVersion => _localizationService.GetString("lblVersion");
public string LblSelectTv => _localizationService.GetString("lblSelectTv");
public string DownloadAndInstall => _localizationService.GetString("DownloadAndInstall");
@@ -225,7 +225,7 @@ namespace Jellyfin2Samsung.ViewModels
SetStatus("FailedTizenSdb");
return;
}
ProcessHelper.KillSdbServers();
await LoadReleasesAsync();
@@ -328,7 +328,7 @@ namespace Jellyfin2Samsung.ViewModels
_samsungLoginCts = null;
}
if(!AppSettings.Default.KeepWGTFile)
if (!AppSettings.Default.KeepWGTFile)
_packageHelper.CleanupDownloadedPackage(downloadPath);
}
}
@@ -552,8 +552,8 @@ namespace Jellyfin2Samsung.ViewModels
return;
var dialog = new IpInputDialog();
string? ip = await dialog.ShowDialogAsync(desktop.MainWindow);
if (string.IsNullOrWhiteSpace(ip))

View File

@@ -1,5 +1,4 @@
using Avalonia.Controls;
using Jellyfin2Samsung;
using Jellyfin2Samsung.Interfaces;
using Jellyfin2Samsung.ViewModels;
using Microsoft.Extensions.DependencyInjection;

View File

@@ -1,4 +1,3 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Threading;
using Jellyfin2Samsung.ViewModels;