Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/2.4.2 - cleanup in prep for v2.5.0 #3

Merged
merged 16 commits into from
Nov 28, 2024
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 5 additions & 7 deletions src/ChatTailorAI.DataAccess/Repositories/AssistantRepository.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using ChatTailorAI.DataAccess.Database;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Assistants;
using ChatTailorAI.Shared.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Assistants;
using ChatTailorAI.Shared.Repositories;

namespace ChatTailorAI.DataAccess.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
using ChatTailorAI.DataAccess.Database;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Assistants;
using ChatTailorAI.Shared.Models.Conversations;
using ChatTailorAI.Shared.Repositories;
using ChatTailorAI.Shared.Services.Database.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChatTailorAI.DataAccess.Repositories
{
Expand Down
13 changes: 5 additions & 8 deletions src/ChatTailorAI.DataAccess/Repositories/ImageRepository.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using ChatTailorAI.DataAccess.Database;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Chat;
using ChatTailorAI.Shared.Models.Image.OpenAI;
using ChatTailorAI.Shared.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Chat;
using ChatTailorAI.Shared.Repositories;

namespace ChatTailorAI.DataAccess.Repositories
{
Expand Down
13 changes: 5 additions & 8 deletions src/ChatTailorAI.DataAccess/Repositories/MessageRepository.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
using ChatTailorAI.DataAccess.Database;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Assistants;
using ChatTailorAI.Shared.Models.Chat;
using ChatTailorAI.Shared.Services.Database.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Chat;
using ChatTailorAI.Shared.Services.Database.Repositories;

namespace ChatTailorAI.DataAccess.Repositories
{
Expand Down
11 changes: 4 additions & 7 deletions src/ChatTailorAI.DataAccess/Repositories/PromptRepository.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using ChatTailorAI.DataAccess.Database;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using ChatTailorAI.DataAccess.Database.Providers.SQLite;
using ChatTailorAI.Shared.Models.Assistants;
using ChatTailorAI.Shared.Models.Prompts;
using ChatTailorAI.Shared.Repositories;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace ChatTailorAI.DataAccess.Repositories
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
using ChatTailorAI.Shared.Services.Common;
using System;
using System.Collections.Generic;
using System;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.Media.Core;
using Windows.Media.Playback;
using Windows.Storage.Streams;
using ChatTailorAI.Shared.Services.Audio;

namespace ChatTailorAI.Services.Uwp.Audio
{
Expand Down
7 changes: 2 additions & 5 deletions src/ChatTailorAI.Services.Uwp/Audio/AudioRecorderService.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ChatTailorAI.Shared.Services.Common;
using Windows.Devices.Enumeration;
using Windows.Media.Capture;
using Windows.Media.Devices;
using Windows.Media.MediaProperties;
using Windows.Storage.Streams;
using ChatTailorAI.Shared.Services.Audio;

namespace ChatTailorAI.Services.Uwp.Audio
{
Expand Down Expand Up @@ -86,4 +83,4 @@ public async Task<Stream> StopRecordingAudio()
return audioStream.AsStream();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,8 @@
<Compile Include="Files\FileDownloadService.cs" />
<Compile Include="Files\FileService.cs" />
<Compile Include="Files\FolderService.cs" />
<Compile Include="Files\IFolderService.cs" />
<Compile Include="Files\ImageFileService.cs" />
<Compile Include="Logger\NLogService.cs" />
<Compile Include="Logging\NLogService.cs" />
<Compile Include="Notification\AppNotificationService.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Settings\AppSettingsService.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
using ChatTailorAI.Shared.Services.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.Threading.Tasks;
using Windows.ApplicationModel.Core;
using Windows.UI.Core;
using ChatTailorAI.Shared.Services.Common;

namespace ChatTailorAI.Services.Uwp.Dispatching
{
Expand Down
23 changes: 15 additions & 8 deletions src/ChatTailorAI.Services.Uwp/Files/FileDownloadService.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
using System;
using ChatTailorAI;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Storage;
using ChatTailorAI.Shared.Services.Files;
using System.Runtime.InteropServices.WindowsRuntime;

namespace ChatTailorAI.Services.Uwp.FileManagement
{
Expand All @@ -17,10 +15,10 @@ namespace ChatTailorAI.Services.Uwp.FileManagement
/// </summary>
public class FileDownloadService : IFileDownloadService
{
private HttpClient _httpClient;
private IFolderService _folderService;
private readonly HttpClient _httpClient;
private readonly IFolderService<StorageFolder> _folderService;

public FileDownloadService(HttpClient client, IFolderService folderService)
public FileDownloadService(HttpClient client, IFolderService<StorageFolder> folderService)
{
_folderService = folderService;
_httpClient = client;
Expand Down Expand Up @@ -99,15 +97,24 @@ private async Task WriteToFile(StorageFolder photoFolder, byte[] buffer)
}
}


/// <summary>
/// Downloads a file asynchronously from a given url
/// </summary>
/// <param name="url"></param>
/// <returns></returns>
public async Task<byte[]> DownloadFileAsync(string url)
{
return await _httpClient.GetByteArrayAsync(url);
}

/// <summary>
/// Downloads multiple files asynchronously from given urls
/// </summary>
/// <param name="urls"></param>
/// <returns></returns>
public async Task<IEnumerable<byte[]>> DownloadFilesAsync(string[] urls)
{
return await Task.WhenAll(urls.Select(DownloadFileAsync));
}
}
}
}
Loading
Loading