Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ name: Build and Publish Cross-Platform

on:
push:
branches:
- main
workflow_dispatch: {} # Allows manual triggering of the workflow

permissions:
Expand All @@ -28,12 +26,12 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6.0.2

- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: '9.0.x'
dotnet-version: '10.0.x'

- name: Restore Dependencies
run: dotnet restore
Expand All @@ -43,6 +41,10 @@ jobs:
shell: bash
run: |
VERSION_NUMBER="${{ vars.MAJOR_VERSION }}.${{ vars.MINOR_VERSION }}.${{ github.run_number }}"
# Check if the current branch is NOT 'main'
if [ "${{ github.ref_name }}" != "main" ]; then
VERSION_NUMBER="${VERSION_NUMBER}-dev" # All other branches than main get -dev suffix
fi
echo "Generated version: $VERSION_NUMBER"
echo "generated_version=$VERSION_NUMBER" >> "$GITHUB_OUTPUT"

Expand All @@ -67,7 +69,7 @@ jobs:
echo "archive_name=$ARCHIVE_NAME" >> "$GITHUB_ENV"

- name: Upload Archived Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ env.archive_name }}
path: ./${{ env.archive_name }}
Expand All @@ -82,15 +84,15 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v4
uses: actions/checkout@v6.0.2

- name: Download all build artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8.0.1
with:
path: ./release_assets

- name: Create Release
uses: softprops/action-gh-release@v2 # Action to create a GitHub Release
uses: softprops/action-gh-release@v3.0.0 # Action to create a GitHub Release
with:
tag_name: v${{ needs.build.outputs.app_version }}
name: Release v${{ needs.build.outputs.app_version }}
Expand Down
13 changes: 5 additions & 8 deletions FileItem.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
using System.Linq;
using MetadataExtractor;
using MetadataExtractor.Formats.Exif;
using SkiaSharp;

namespace SelectSight;

using System;
Expand All @@ -13,10 +8,11 @@ namespace SelectSight;
using System.Threading.Tasks;
using Avalonia.Media.Imaging;

public class FileItem(string fullPath) : INotifyPropertyChanged
public class FileItem(FileInfo fileInfo) : INotifyPropertyChanged
{
public string FullPath { get; } = fullPath;
public string Name { get; } = Path.GetFileName(fullPath);
public string FullPath { get; } = fileInfo.FullName;
public string Name { get; } = fileInfo.Name;
public DateTime ModifiedDate { get; } = fileInfo.LastWriteTime;

private Bitmap? _thumbnail;
public Bitmap? Thumbnail
Expand All @@ -27,6 +23,7 @@ public Bitmap? Thumbnail

public async Task LoadThumbnailAsync()
{
if (Thumbnail is not null) return;
try
{
var extension = Path.GetExtension(FullPath).ToLowerInvariant();
Expand Down
18 changes: 15 additions & 3 deletions MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,20 @@
Title="SelectSight"
Icon="avares://SelectSight/Assets/icon.ico">

<Grid RowDefinitions="*,Auto" Background="WhiteSmoke">
<Grid x:Name="FilesGrid" Grid.Row="0" ColumnDefinitions="8*,1*">
<Grid RowDefinitions="Auto,*,Auto" Background="WhiteSmoke">
<Border Grid.Row="0" BorderBrush="LightGray" BorderThickness="0,0,0,1"
Background="Transparent" Padding="10">
<Grid ColumnDefinitions="Auto,*" HorizontalAlignment="Stretch">
<TextBlock Grid.Column="0" Text="Sort by:" HorizontalAlignment="Left" VerticalAlignment="Center" Padding="2, 0,5, 0" />
<ComboBox Grid.Column="1" SelectedIndex="0" PlaceholderText="Select an item..." Width="250" Name="SortByComboBox">
<ComboBoxItem Tag="DateOldestFirst">Date Modified (oldest first)</ComboBoxItem>
<ComboBoxItem Tag="DateNewestFirst">Date Modified (newest first)</ComboBoxItem>
<ComboBoxItem Tag="NameAsc">Name (A-Z)</ComboBoxItem>
<ComboBoxItem Tag="NameDesc">Name (Z-A)</ComboBoxItem>
</ComboBox>
</Grid>
</Border>
<Grid x:Name="FilesGrid" Grid.Row="1" ColumnDefinitions="8*,1*">
<Border Grid.Column="0" BorderBrush="LightGray" BorderThickness="0,0,1,0" Background="Transparent">
<Grid RowDefinitions="Auto,*">
<ListBox Grid.Row="1"
Expand Down Expand Up @@ -71,7 +83,7 @@
</Border>
</Grid>

<Border Grid.Row="1" BorderBrush="LightGray" BorderThickness="0,1,0,0"
<Border Grid.Row="2" BorderBrush="LightGray" BorderThickness="0,1,0,0"
Background="Transparent" Padding="10">
<Grid ColumnDefinitions="*,*">
<Grid Grid.Column="0" ColumnDefinitions="Auto,*" HorizontalAlignment="Stretch">
Expand Down
Loading
Loading