mirror of
https://github.com/Jellyfin2Samsung/Samsung-Jellyfin-Installer.git
synced 2026-03-01 11:21:12 +03:00
Added default for Github Assets
This commit is contained in:
@@ -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)})";
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user