|
|
@ -1,6 +1,4 @@ |
|
|
|
using System; |
|
|
|
using System; |
|
|
|
using System.Reactive.Linq; |
|
|
|
|
|
|
|
using System.Threading; |
|
|
|
|
|
|
|
using System.Threading.Tasks; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Avalonia.Controls; |
|
|
|
using Avalonia.Controls; |
|
|
|
using DynamicData; |
|
|
|
using DynamicData; |
|
|
@ -27,12 +25,6 @@ public partial class ImageFolderCardViewModel : ViewModelBase |
|
|
|
private readonly SourceCache<LocalImageFile, string> localImagesSource = |
|
|
|
private readonly SourceCache<LocalImageFile, string> localImagesSource = |
|
|
|
new(imageFile => imageFile.RelativePath); |
|
|
|
new(imageFile => imageFile.RelativePath); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// Collection of image files to display |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
public IObservableCollection<LocalImageFile> LocalImages { get; } = |
|
|
|
|
|
|
|
new ObservableCollectionExtended<LocalImageFile>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// <summary> |
|
|
|
/// Collection of image items to display |
|
|
|
/// Collection of image items to display |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
@ -49,6 +41,8 @@ public partial class ImageFolderCardViewModel : ViewModelBase |
|
|
|
this.imageIndexService = imageIndexService; |
|
|
|
this.imageIndexService = imageIndexService; |
|
|
|
this.settingsManager = settingsManager; |
|
|
|
this.settingsManager = settingsManager; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var minDatetime = DateTimeOffset.FromUnixTimeMilliseconds(0); |
|
|
|
|
|
|
|
|
|
|
|
localImagesSource |
|
|
|
localImagesSource |
|
|
|
.Connect() |
|
|
|
.Connect() |
|
|
|
.DeferUntilLoaded() |
|
|
|
.DeferUntilLoaded() |
|
|
@ -62,6 +56,7 @@ public partial class ImageFolderCardViewModel : ViewModelBase |
|
|
|
: imageFile.GetFullPath(settingsManager.ImagesDirectory) |
|
|
|
: imageFile.GetFullPath(settingsManager.ImagesDirectory) |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
.SortBy(x => x.LocalImageFile?.LastModifiedAt ?? minDatetime, SortDirection.Descending) |
|
|
|
.Bind(Items) |
|
|
|
.Bind(Items) |
|
|
|
.Subscribe(); |
|
|
|
.Subscribe(); |
|
|
|
} |
|
|
|
} |
|
|
|