Files
immich-to-slideshow/src/ImmichToSlideshow/Controllers/AssetsController.cs
mikep@0027C8334BC77C8 9c85684af7 Birthday
hurl file over http file

AddControllers

Formatting
2025-09-06 12:11:57 -07:00

54 lines
2.0 KiB
C#

using ImmichToSlideshow.Services;
using Microsoft.AspNetCore.Mvc;
namespace ImmichToSlideshow.Controllers;
[ApiController]
[Route("api/v1/[controller]")]
public class AssetsController(AssetService assetService) : ControllerBase {
private readonly string _ContentType = "application/json";
private readonly AssetService _AssetService = assetService;
[HttpGet("columns")]
public IActionResult GetColumns() =>
Content(_AssetService.GetColumns() ?? string.Empty, _ContentType);
[HttpGet("owner-ids")]
public IActionResult GetOwnerIds() =>
Content(_AssetService.GetOwnerIds() ?? string.Empty, _ContentType);
[HttpGet("{ownerId:guid}")]
public IActionResult Get(Guid ownerId) =>
Content(_AssetService.GetAssets(ownerId) ?? string.Empty, _ContentType);
[HttpGet("{ownerId:guid}/random-paths")]
public IActionResult GetRandomPaths(Guid ownerId) =>
Ok(_AssetService.GetRandomPaths(ownerId, tomorrow: null));
[HttpGet("{ownerId:guid}/archived-tag")]
public IActionResult GetArchivedTag(Guid ownerId) =>
Content(_AssetService.GetArchivedTag(ownerId) ?? string.Empty, _ContentType);
[HttpGet("{ownerId:guid}/save-random-paths")]
public IActionResult SaveRandomPaths(Guid ownerId) =>
Content(_AssetService.SaveRandomPaths(ownerId) ?? string.Empty, _ContentType);
[HttpGet("{ownerId:guid}/sync-immich")]
public IActionResult SyncImmich(Guid ownerId) =>
Ok(_AssetService.SyncImmich(ownerId));
[HttpGet("{ownerId:guid}/set-archive-immich")]
public IActionResult SetArchiveImmich(Guid ownerId) =>
Ok(_AssetService.SetArchiveImmich(ownerId));
[HttpGet("{ownerId:guid}/set-digi-kam-4-archive-immich")]
public IActionResult SetDigiKam4ArchiveImmich(Guid ownerId) =>
Ok(_AssetService.SetDigiKam4ArchiveImmich(ownerId));
[HttpGet("update-assets-set-local-date-time-for-three-and-seven")]
public IActionResult UpdateAssetsSetLocalDateTimeForThreeAndSeven() =>
Ok(_AssetService.UpdateAssetsSetLocalDateTimeForThreeAndSeven());
}