Added default for Github Assets

This commit is contained in:
PatrickSt1991
2026-01-23 16:12:14 +01:00
parent 14adc6e806
commit 867c7c2c6e
2 changed files with 10 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json.Serialization;
@@ -40,6 +41,10 @@ namespace Jellyfin2Samsung.Models
[JsonPropertyName("size")]
public long Size { get; set; }
[JsonIgnore]
public bool IsDefault => FileName.Equals("Jellyfin.wgt", StringComparison.OrdinalIgnoreCase);
[JsonIgnore]
public string DisplayText => $"{FileName} ({FormatFileSize(Size)})";

View File

@@ -170,10 +170,14 @@ namespace Jellyfin2Samsung.ViewModels
AvailableAssets = value != null
? new ObservableCollection<Asset>(value.Assets)
: new ObservableCollection<Asset>();
SelectedAsset = AvailableAssets.FirstOrDefault();
SelectedAsset =
AvailableAssets.FirstOrDefault(a => a.IsDefault)
?? AvailableAssets.FirstOrDefault();
RefreshCanExecuteChanged();
}
partial void OnSelectedAssetChanged(Asset? value)
{
RefreshCanExecuteChanged();