Draft
Conversation
added 18 commits
March 6, 2026 13:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces the initial implementation of the
SDMeta.Apiproject, setting up the API backend for the SDMeta application. The changes establish the project structure, core services, and essential API contracts, including file watching, image identification, scanning management, and configuration. The most important changes are grouped below:Project Setup and Configuration:
SDMeta.Apiproject file (SDMeta.Api.csproj) with dependencies for image processing, IO abstraction, and resilience (Polly). References the coreSDMetaproject.launchSettings.json.Program.cs, configuring dependency injection, CORS, static file serving, JSON serialization, and API endpoint mapping. Also sets up image codecs and initializes the database.API Contracts and Data Structures:
ApiContracts.cs, including error, image, prompt, scan, and storage response types. These provide the data models for API endpoints.Core Services and Utilities:
ImageIdCodecandImagePathAuthorizerfor encoding/decoding image identifiers and authorizing file paths, as well as aCursorCodecfor paginated API responses.ImageDirSettingsfor resolving image directory paths from configuration, supporting multiple directories.File and Scan Management:
PendingFileChangeQueueto watch image directories for file changes (additions/removals) usingFileSystemWatcher, supporting thread-safe queueing of changes for later processing.ScanJobManagerto manage full and partial scan jobs, including progress tracking, concurrent job state management, and error handling.RetryingFileLoader, a decorator for image file loading that adds retry and timeout logic usingPollyfor improved resilience.