Ragware.QnapPhotoApi
0.2.2
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Ragware.QnapPhotoApi --version 0.2.2
NuGet\Install-Package Ragware.QnapPhotoApi -Version 0.2.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Ragware.QnapPhotoApi" Version="0.2.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Ragware.QnapPhotoApi --version 0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Ragware.QnapPhotoApi, 0.2.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Ragware.QnapPhotoApi as a Cake Addin #addin nuget:?package=Ragware.QnapPhotoApi&version=0.2.2 // Install Ragware.QnapPhotoApi as a Cake Tool #tool nuget:?package=Ragware.QnapPhotoApi&version=0.2.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
QnapPhotoApi.NET
This is a .NET Web API wrapper around the QNap Photo Station api.
Provides the following capabilities.
- An Api which calls Qnap Photo Station's /list.phtp endpoint to retrieve
- all photos or videos (
ListAsync
) - all albums, smart or otherwise (
ListAlbumsAsync
) - all photos within an album (
ListAlbumPhotosAsync
)
- all photos or videos (
- Single images - This is middleware, acting as a proxy to PhotoStation on your NAS. It just forwards the response stream.
/image/{imageId}
- Full size image/thumb/{imageId}
- Thumbnail of the supplied image. The size of this thumbnail depends on how thumbnails are processed in your NAS.
Configuration
- Get the nuget package
- Add configuration to your
appsettings.json
. Username and Password are the credentials you use to login to your nas.
"QnapApi": {
"BaseUrl": "http://nas",
"Username": "Rob",
"Password": "Y0UrP455w0rd!"
}
- Install in your web app/api (see below)
// This will register CSharp API client to make the /list calls.
builder.Services.AddQnapPhotoApi(builder.Configuration);
var app = builder.Build();
// This is important to get the /image and /thumb endpoints.
app.UseQnapImageMiddleware();
Usage
app.MapGet("/list/{page:int}", async (int page, [FromServices] IPhotoStationClient qnapClient, CancellationToken cancellationToken) =>
{
var request = new ListRequest
{
MediaType = MediaType.Photos,
SortDirection = SortDirection.Descending,
PageNumber = page,
PageSize = 100,
};
return await qnapClient.ListAsync(request, cancellationToken);
})
.WithName("ListPhotos")
.WithTags("QnapPhotos")
.WithOpenApi();
app.MapGet("/list-album-photos/{albumId}/{page:int}", async (string albumId, int page, [FromServices] IPhotoStationClient qnapClient, CancellationToken cancellationToken) =>
{
var request = new ListAlbumPhotosRequest()
{
AlbumId = albumId,
SortDirection = SortDirection.Descending,
Sort = Sort.DateAdded,
PageNumber = page,
PageSize = 100,
};
return await qnapClient.ListAlbumPhotosAsync(request, cancellationToken);
})
.WithName("ListAlbumPhotos")
.WithTags("QnapPhotos")
.WithOpenApi();
app.MapGet("/list-album/{page:int}", async (int page, [FromServices] IPhotoStationClient qnapClient, CancellationToken cancellationToken) =>
{
var request = new ListAlbumsRequest()
{
SortDirection = SortDirection.Descending,
AlbumType = AlbumType.All,
Sort = AlbumSort.Title,
PageNumber = page,
PageSize = 100,
};
return await qnapClient.ListAlbumsAsync(request, cancellationToken);
})
.WithName("ListAlbums")
.WithTags("QnapPhotos")
.WithOpenApi();
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Microsoft.Extensions.Caching.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Caching.Memory (>= 9.0.0)
- Microsoft.Extensions.Configuration (>= 9.0.0)
- Microsoft.Extensions.Hosting.Abstractions (>= 9.0.0)
- Microsoft.Extensions.Http (>= 9.0.0)
- Serilog (>= 4.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.