hurl file over http file
AddControllers Formatting
This commit is contained in:
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,4 +1,11 @@
|
|||||||
{
|
{
|
||||||
|
"files.associations": {
|
||||||
|
"*.ffs_gui": "xml",
|
||||||
|
"*.hurl": "http",
|
||||||
|
"*.org": "ini",
|
||||||
|
"*.net": "ini",
|
||||||
|
"default": "ini"
|
||||||
|
},
|
||||||
"[markdown]": {
|
"[markdown]": {
|
||||||
"editor.wordWrap": "off"
|
"editor.wordWrap": "off"
|
||||||
},
|
},
|
||||||
|
@ -1,46 +0,0 @@
|
|||||||
@host = http://0.0.0.0:5001
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/columns/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/owner-ids/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}/random-paths/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}/save-random-paths/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}/sync-immich/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}/set-archive-immich/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}/set-digi-kam-4-archive-immich/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
GET {{host}}/api/v1/assets/{{ownerId}}/archived-tag/
|
|
||||||
Accept: application/json
|
|
||||||
|
|
||||||
###
|
|
80
requests/ImmichToSlideshow.hurl
Normal file
80
requests/ImmichToSlideshow.hurl
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
GET http://127.0.0.1:5001/api/v1/assets/columns/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/owner-ids/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/random-paths/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/save-random-paths/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/sync-immich/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/set-archive-immich/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/set-digi-kam-4-archive-immich/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
||||||
|
|
||||||
|
GET http://127.0.0.1:5001/api/v1/assets/5f0b1052-466d-44de-a554-226d7256850d/archived-tag/
|
||||||
|
Accept: application/json
|
||||||
|
|
||||||
|
HTTP 200
|
||||||
|
[Asserts]
|
||||||
|
header "Content-Type" == "application/json"
|
||||||
|
|
||||||
|
###
|
@ -6,6 +6,7 @@ namespace ImmichToSlideshow.DependencyInjection;
|
|||||||
public static class ServiceCollectionExtensions {
|
public static class ServiceCollectionExtensions {
|
||||||
|
|
||||||
public static IServiceCollection AddServices(this IServiceCollection services, AppSettings appSettings) {
|
public static IServiceCollection AddServices(this IServiceCollection services, AppSettings appSettings) {
|
||||||
|
_ = services.AddControllers();
|
||||||
_ = services.AddScoped<AssetService>();
|
_ = services.AddScoped<AssetService>();
|
||||||
_ = services.AddSingleton(_ => appSettings);
|
_ = services.AddSingleton(_ => appSettings);
|
||||||
return services;
|
return services;
|
||||||
|
@ -11,29 +11,40 @@ public record AppSettings(string Company, Settings Settings, string URLs, string
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void Verify(AppSettings appSettings) {
|
private static void Verify(AppSettings appSettings) {
|
||||||
if (appSettings?.Company is null)
|
if (appSettings?.Company is null) {
|
||||||
throw new NullReferenceException(nameof(Company));
|
throw new NullReferenceException(nameof(Company));
|
||||||
if (appSettings?.URLs is null)
|
}
|
||||||
|
if (appSettings?.URLs is null) {
|
||||||
throw new NullReferenceException(nameof(URLs));
|
throw new NullReferenceException(nameof(URLs));
|
||||||
if (appSettings?.WithOrigins is null)
|
}
|
||||||
|
if (appSettings?.WithOrigins is null) {
|
||||||
throw new NullReferenceException(nameof(WithOrigins));
|
throw new NullReferenceException(nameof(WithOrigins));
|
||||||
if (appSettings?.Settings?.AddDays is null)
|
}
|
||||||
|
if (appSettings?.Settings?.AddDays is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.AddDays));
|
throw new NullReferenceException(nameof(Settings.AddDays));
|
||||||
if (appSettings?.Settings?.ArchivedTag is null)
|
}
|
||||||
|
if (appSettings?.Settings?.ArchivedTag is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.ArchivedTag));
|
throw new NullReferenceException(nameof(Settings.ArchivedTag));
|
||||||
if (appSettings?.Settings?.ConnectionString is null)
|
}
|
||||||
|
if (appSettings?.Settings?.ConnectionString is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.ConnectionString));
|
throw new NullReferenceException(nameof(Settings.ConnectionString));
|
||||||
if (appSettings?.Settings?.DigiKam4 is null)
|
}
|
||||||
|
if (appSettings?.Settings?.DigiKam4 is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.DigiKam4));
|
throw new NullReferenceException(nameof(Settings.DigiKam4));
|
||||||
if (appSettings?.Settings?.FilterTags is null)
|
}
|
||||||
|
if (appSettings?.Settings?.FilterTags is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.FilterTags));
|
throw new NullReferenceException(nameof(Settings.FilterTags));
|
||||||
if (appSettings?.Settings?.ImmichUploadDirectory is null)
|
}
|
||||||
|
if (appSettings?.Settings?.ImmichUploadDirectory is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.ImmichUploadDirectory));
|
throw new NullReferenceException(nameof(Settings.ImmichUploadDirectory));
|
||||||
if (appSettings?.Settings?.RandomResultsDirectory is null)
|
}
|
||||||
|
if (appSettings?.Settings?.RandomResultsDirectory is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.RandomResultsDirectory));
|
throw new NullReferenceException(nameof(Settings.RandomResultsDirectory));
|
||||||
if (appSettings?.Settings?.SyncDirectory is null)
|
}
|
||||||
|
if (appSettings?.Settings?.SyncDirectory is null) {
|
||||||
throw new NullReferenceException(nameof(Settings.SyncDirectory));
|
throw new NullReferenceException(nameof(Settings.SyncDirectory));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static AppSettings Get(IConfigurationRoot configurationRoot) {
|
public static AppSettings Get(IConfigurationRoot configurationRoot) {
|
||||||
AppSettings result;
|
AppSettings result;
|
||||||
@ -46,10 +57,12 @@ public record AppSettings(string Company, Settings Settings, string URLs, string
|
|||||||
if (company is null || settings is null || urls is null || withOrigins is null) {
|
if (company is null || settings is null || urls is null || withOrigins is null) {
|
||||||
List<string> paths = [];
|
List<string> paths = [];
|
||||||
foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers) {
|
foreach (IConfigurationProvider configurationProvider in configurationRoot.Providers) {
|
||||||
if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider)
|
if (configurationProvider is not Microsoft.Extensions.Configuration.Json.JsonConfigurationProvider jsonConfigurationProvider) {
|
||||||
continue;
|
continue;
|
||||||
if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider)
|
}
|
||||||
|
if (jsonConfigurationProvider.Source.FileProvider is not Microsoft.Extensions.FileProviders.PhysicalFileProvider physicalFileProvider) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
paths.Add(physicalFileProvider.Root);
|
paths.Add(physicalFileProvider.Root);
|
||||||
}
|
}
|
||||||
throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}");
|
throw new NotSupportedException($"Not found!{Environment.NewLine}{string.Join(Environment.NewLine, paths.Distinct())}");
|
||||||
|
@ -10,7 +10,6 @@ public class Program {
|
|||||||
WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args);
|
WebApplicationBuilder webApplicationBuilder = WebApplication.CreateBuilder(args);
|
||||||
_ = webApplicationBuilder.Configuration.AddUserSecrets<Program>();
|
_ = webApplicationBuilder.Configuration.AddUserSecrets<Program>();
|
||||||
AppSettings appSettings = AppSettings.Get(webApplicationBuilder.Configuration);
|
AppSettings appSettings = AppSettings.Get(webApplicationBuilder.Configuration);
|
||||||
_ = webApplicationBuilder.Services.AddControllers();
|
|
||||||
_ = webApplicationBuilder.Services.AddServices(appSettings);
|
_ = webApplicationBuilder.Services.AddServices(appSettings);
|
||||||
WebApplication webApplication = webApplicationBuilder.Build();
|
WebApplication webApplication = webApplicationBuilder.Build();
|
||||||
ILogger<Program>? logger = webApplication.Services.GetRequiredService<ILogger<Program>>();
|
ILogger<Program>? logger = webApplication.Services.GetRequiredService<ILogger<Program>>();
|
||||||
|
@ -79,7 +79,7 @@ internal static class CommandText {
|
|||||||
} else {
|
} else {
|
||||||
results.Add(" FROM public.asset a ");
|
results.Add(" FROM public.asset a ");
|
||||||
}
|
}
|
||||||
results.AddRange(" INNER ");
|
results.Add(" INNER ");
|
||||||
if (lowestVersionHistory <= 1.129) {
|
if (lowestVersionHistory <= 1.129) {
|
||||||
results.Add(" JOIN asset_files f ");
|
results.Add(" JOIN asset_files f ");
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user