diff --git a/.gitignore b/.gitignore
index 8903637..c101bb0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -13,6 +13,8 @@ fotospiel-tenant-app
/storage/*.key
/storage/pail
/vendor
+/clients/photobooth-uploader/**/bin
+/clients/photobooth-uploader/**/obj
.env
.env.backup
.env.production
diff --git a/clients/photobooth-uploader/PhotoboothUploader.sln b/clients/photobooth-uploader/PhotoboothUploader.sln
deleted file mode 100644
index fa1a0eb..0000000
--- a/clients/photobooth-uploader/PhotoboothUploader.sln
+++ /dev/null
@@ -1,18 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.10.35013.3
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PhotoboothUploader", "PhotoboothUploader\PhotoboothUploader.csproj", "{CDF88A75-8B20-4F54-96FC-A640B0D19A10}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {CDF88A75-8B20-4F54-96FC-A640B0D19A10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {CDF88A75-8B20-4F54-96FC-A640B0D19A10}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {CDF88A75-8B20-4F54-96FC-A640B0D19A10}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {CDF88A75-8B20-4F54-96FC-A640B0D19A10}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
diff --git a/clients/photobooth-uploader/PhotoboothUploader/App.axaml b/clients/photobooth-uploader/PhotoboothUploader/App.axaml
new file mode 100644
index 0000000..0947b43
--- /dev/null
+++ b/clients/photobooth-uploader/PhotoboothUploader/App.axaml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/clients/photobooth-uploader/PhotoboothUploader/App.axaml.cs b/clients/photobooth-uploader/PhotoboothUploader/App.axaml.cs
new file mode 100644
index 0000000..d546bf9
--- /dev/null
+++ b/clients/photobooth-uploader/PhotoboothUploader/App.axaml.cs
@@ -0,0 +1,23 @@
+using Avalonia;
+using Avalonia.Controls.ApplicationLifetimes;
+using Avalonia.Markup.Xaml;
+
+namespace PhotoboothUploader;
+
+public partial class App : Application
+{
+ public override void Initialize()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ public override void OnFrameworkInitializationCompleted()
+ {
+ if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
+ {
+ desktop.MainWindow = new MainWindow();
+ }
+
+ base.OnFrameworkInitializationCompleted();
+ }
+}
\ No newline at end of file
diff --git a/clients/photobooth-uploader/PhotoboothUploader/App.xaml b/clients/photobooth-uploader/PhotoboothUploader/App.xaml
deleted file mode 100644
index 8c2cbd7..0000000
--- a/clients/photobooth-uploader/PhotoboothUploader/App.xaml
+++ /dev/null
@@ -1,7 +0,0 @@
-
-
-
-
diff --git a/clients/photobooth-uploader/PhotoboothUploader/App.xaml.cs b/clients/photobooth-uploader/PhotoboothUploader/App.xaml.cs
deleted file mode 100644
index aa92a62..0000000
--- a/clients/photobooth-uploader/PhotoboothUploader/App.xaml.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-using Microsoft.UI.Xaml;
-
-namespace PhotoboothUploader;
-
-public partial class App : Application
-{
- public App()
- {
- InitializeComponent();
- }
-
- protected override void OnLaunched(LaunchActivatedEventArgs args)
- {
- var window = new MainWindow();
- window.Activate();
- }
-}
diff --git a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml
new file mode 100644
index 0000000..3464ddd
--- /dev/null
+++ b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml
@@ -0,0 +1,23 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.xaml.cs b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs
similarity index 83%
rename from clients/photobooth-uploader/PhotoboothUploader/MainWindow.xaml.cs
rename to clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs
index b9d92b1..16fa6a8 100644
--- a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.xaml.cs
+++ b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.axaml.cs
@@ -1,15 +1,16 @@
-using Microsoft.UI.Xaml;
+using System;
+using System.IO;
+using System.Linq;
+using Avalonia.Controls;
+using Avalonia.Interactivity;
+using Avalonia.Platform.Storage;
+using Avalonia.Threading;
using PhotoboothUploader.Models;
using PhotoboothUploader.Services;
-using System.Linq;
-using System.IO;
-using Windows.Storage;
-using Windows.Storage.Pickers;
-using WinRT.Interop;
namespace PhotoboothUploader;
-public sealed partial class MainWindow : Window
+public partial class MainWindow : Window
{
private const string DefaultBaseUrl = "https://fotospiel.app";
private PhotoboothConnectClient _client;
@@ -28,7 +29,7 @@ public sealed partial class MainWindow : Window
ApplySettings();
}
- private async void ConnectButton_Click(object sender, RoutedEventArgs e)
+ private async void ConnectButton_Click(object? sender, RoutedEventArgs e)
{
var code = (CodeBox.Text ?? string.Empty).Trim();
@@ -62,27 +63,27 @@ public sealed partial class MainWindow : Window
ConnectButton.IsEnabled = true;
}
- private async void PickFolderButton_Click(object sender, RoutedEventArgs e)
+ private async void PickFolderButton_Click(object? sender, RoutedEventArgs e)
{
- var picker = new FolderPicker
+ var options = new FolderPickerOpenOptions
{
- SuggestedStartLocation = PickerLocationId.PicturesLibrary,
+ Title = "Upload-Ordner auswählen",
+ AllowMultiple = false,
};
- picker.FileTypeFilter.Add("*");
- InitializeWithWindow.Initialize(picker, WindowNative.GetWindowHandle(this));
+ var folders = await StorageProvider.OpenFolderPickerAsync(options);
+ var folder = folders.FirstOrDefault();
+ var localPath = folder?.TryGetLocalPath();
- StorageFolder? folder = await picker.PickSingleFolderAsync();
-
- if (folder is null)
+ if (string.IsNullOrWhiteSpace(localPath))
{
return;
}
- _settings.WatchFolder = folder.Path;
+ _settings.WatchFolder = localPath;
_settingsStore.Save(_settings);
- FolderText.Text = folder.Path;
+ FolderText.Text = localPath;
StartUploadPipelineIfReady();
}
@@ -156,7 +157,7 @@ public sealed partial class MainWindow : Window
private void UpdateStatus(string message)
{
- DispatcherQueue.TryEnqueue(() => StatusText.Text = message);
+ Dispatcher.UIThread.Post(() => StatusText.Text = message);
}
private string? ResolveUploadUrl(string? uploadUrl)
diff --git a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.xaml b/clients/photobooth-uploader/PhotoboothUploader/MainWindow.xaml
deleted file mode 100644
index 046f0b2..0000000
--- a/clients/photobooth-uploader/PhotoboothUploader/MainWindow.xaml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/clients/photobooth-uploader/PhotoboothUploader/PhotoboothUploader.csproj b/clients/photobooth-uploader/PhotoboothUploader/PhotoboothUploader.csproj
index ba52229..6cfa712 100644
--- a/clients/photobooth-uploader/PhotoboothUploader/PhotoboothUploader.csproj
+++ b/clients/photobooth-uploader/PhotoboothUploader/PhotoboothUploader.csproj
@@ -1,19 +1,21 @@
-
+
WinExe
- net8.0-windows10.0.19041.0
- true
- true
- true
- win-x64
- win-x64
- win-x64
+ net9.0
enable
- enable
+ app.manifest
+ true
-
+
+
+
+
+
+
+ None
+ All
+
-
diff --git a/clients/photobooth-uploader/PhotoboothUploader/Program.cs b/clients/photobooth-uploader/PhotoboothUploader/Program.cs
new file mode 100644
index 0000000..6e243f9
--- /dev/null
+++ b/clients/photobooth-uploader/PhotoboothUploader/Program.cs
@@ -0,0 +1,21 @@
+using Avalonia;
+using System;
+
+namespace PhotoboothUploader;
+
+class Program
+{
+ // Initialization code. Don't use any Avalonia, third-party APIs or any
+ // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
+ // yet and stuff might break.
+ [STAThread]
+ public static void Main(string[] args) => BuildAvaloniaApp()
+ .StartWithClassicDesktopLifetime(args);
+
+ // Avalonia configuration, don't remove; also used by visual designer.
+ public static AppBuilder BuildAvaloniaApp()
+ => AppBuilder.Configure()
+ .UsePlatformDetect()
+ .WithInterFont()
+ .LogToTrace();
+}
diff --git a/clients/photobooth-uploader/PhotoboothUploader/Services/PhotoboothConnectClient.cs b/clients/photobooth-uploader/PhotoboothUploader/Services/PhotoboothConnectClient.cs
index 187c412..2f839dd 100644
--- a/clients/photobooth-uploader/PhotoboothUploader/Services/PhotoboothConnectClient.cs
+++ b/clients/photobooth-uploader/PhotoboothUploader/Services/PhotoboothConnectClient.cs
@@ -1,5 +1,9 @@
+using System;
+using System.Net.Http;
using System.Net.Http.Json;
using System.Text.Json;
+using System.Threading;
+using System.Threading.Tasks;
using PhotoboothUploader.Models;
namespace PhotoboothUploader.Services;
diff --git a/clients/photobooth-uploader/PhotoboothUploader/Services/SettingsStore.cs b/clients/photobooth-uploader/PhotoboothUploader/Services/SettingsStore.cs
index a5fcb3c..a74b5cd 100644
--- a/clients/photobooth-uploader/PhotoboothUploader/Services/SettingsStore.cs
+++ b/clients/photobooth-uploader/PhotoboothUploader/Services/SettingsStore.cs
@@ -1,3 +1,5 @@
+using System;
+using System.IO;
using System.Text.Json;
using PhotoboothUploader.Models;
diff --git a/clients/photobooth-uploader/PhotoboothUploader/Services/UploadService.cs b/clients/photobooth-uploader/PhotoboothUploader/Services/UploadService.cs
index 8628813..4a36be7 100644
--- a/clients/photobooth-uploader/PhotoboothUploader/Services/UploadService.cs
+++ b/clients/photobooth-uploader/PhotoboothUploader/Services/UploadService.cs
@@ -1,6 +1,11 @@
+using System;
using System.Collections.Concurrent;
+using System.IO;
+using System.Net.Http;
using System.Net.Http.Headers;
+using System.Threading;
using System.Threading.Channels;
+using System.Threading.Tasks;
using PhotoboothUploader.Models;
namespace PhotoboothUploader.Services;
diff --git a/clients/photobooth-uploader/PhotoboothUploader/app.manifest b/clients/photobooth-uploader/PhotoboothUploader/app.manifest
new file mode 100644
index 0000000..e91d42b
--- /dev/null
+++ b/clients/photobooth-uploader/PhotoboothUploader/app.manifest
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+