mirror of
https://github.com/azaion/annotations.git
synced 2026-04-22 17:36:30 +00:00
add MediaHash. Step1
This commit is contained in:
@@ -4,6 +4,7 @@ using System.IO;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using Azaion.Common;
|
||||
using Azaion.Common.Database;
|
||||
using Azaion.Common.DTO;
|
||||
using Azaion.Common.DTO.Config;
|
||||
@@ -18,7 +19,7 @@ namespace Azaion.Annotator.Controls;
|
||||
public partial class MapMatcher : UserControl
|
||||
{
|
||||
private AppConfig _appConfig = null!;
|
||||
List<MediaFileInfo> _allMediaFiles = new();
|
||||
List<MediaFile> _allMediaFiles = new();
|
||||
public Dictionary<int, Annotation> Annotations = new();
|
||||
private string _currentDir = null!;
|
||||
private IGpsMatcherService _gpsMatcherService = null!;
|
||||
@@ -63,11 +64,11 @@ public partial class MapMatcher : UserControl
|
||||
|
||||
private void OpenContainingFolder(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var mediaFileInfo = (sender as MenuItem)?.DataContext as MediaFileInfo;
|
||||
var mediaFileInfo = (sender as MenuItem)?.DataContext as MediaFile;
|
||||
if (mediaFileInfo == null)
|
||||
return;
|
||||
|
||||
Process.Start("explorer.exe", "/select,\"" + mediaFileInfo.Path +"\"");
|
||||
Process.Start("explorer.exe", "/select,\"" + mediaFileInfo.MediaUrl +"\"");
|
||||
}
|
||||
|
||||
private async void OpenGpsTilesFolderClick(object sender, RoutedEventArgs e)
|
||||
@@ -86,16 +87,16 @@ public partial class MapMatcher : UserControl
|
||||
TbGpsMapFolder.Text = dlg.FileName;
|
||||
_currentDir = dlg.FileName;
|
||||
var dir = new DirectoryInfo(dlg.FileName);
|
||||
var mediaFiles = dir.GetFiles(_appConfig.AnnotationConfig.ImageFormats.ToArray())
|
||||
.Select(x => new MediaFileInfo
|
||||
var mediaFiles = dir.GetFiles(Constants.DefaultImageFormats.ToArray())
|
||||
.Select(x => new MediaFile
|
||||
{
|
||||
Name = x.Name,
|
||||
Path = x.FullName,
|
||||
MediaUrl = x.FullName,
|
||||
MediaType = MediaTypes.Image
|
||||
}).ToList();
|
||||
|
||||
_allMediaFiles = mediaFiles;
|
||||
GpsFiles.ItemsSource = new ObservableCollection<MediaFileInfo>(_allMediaFiles);
|
||||
GpsFiles.ItemsSource = new ObservableCollection<MediaFile>(_allMediaFiles);
|
||||
|
||||
Annotations = mediaFiles.Select((x, i) => (i, new Annotation
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user