Files
flatrender/services/studio/FlatRender.StudioSvc/Models/Responses/Responses.cs
T
soroush.asadi 055d8365fe feat(studio): per-scene loop plays on hover (scene.demo end-to-end)
Wires the per-scene loop video all the way to the scene card:
- studio-svc: SavedSceneResponse now includes Demo (was stored + copied but never
  serialized); MapSceneResponse passes s.Demo.
- Scene type gains image?/demo?; parseScene reads them from the loaded scene data.
- SceneThumbnailBlock shows scene.image as the still and plays scene.demo (muted,
  looped) on hover, resetting on mouse-leave.

Existing projects backfilled (saved_scenes.image/demo from content.scenes). Both
services rebuilt + deployed.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-24 21:46:07 +03:30

176 lines
4.1 KiB
C#

namespace FlatRender.StudioSvc.Models.Responses;
public record PagedResponse<T>(IEnumerable<T> Items, PaginationMeta Meta);
public record PaginationMeta(int Page, int PageSize, long Total, int TotalPages);
public record ApiError(string Code, string Message, string? TraceId = null);
public record SavedProjectSummaryResponse(
Guid Id,
Guid UserId,
Guid OriginalProjectId,
string OriginalProjectName,
string? OriginalContainerSlug,
string Name,
string? Image,
string Type,
string Resolution,
string ChooseMode,
decimal ProjectDurationSec,
DateTime LastEditDate,
DateTime CreatedAt
);
public record SavedProjectFullResponse(
Guid Id,
Guid UserId,
Guid OriginalProjectId,
string OriginalProjectName,
string? OriginalContainerSlug,
string Name,
string? Image,
string Type,
int FrameRate,
decimal ProjectDurationSec,
string Resolution,
string ChooseMode,
decimal VipFactor,
Guid? MusicFileId,
Guid? MusicTrackId,
decimal MusicVolume,
Guid? VoiceoverFileId,
decimal VoiceoverVolume,
bool VoiceoverRecordedInBrowser,
decimal SfxVolume,
bool SfxEnabled,
string? AudioVisualizerMusicUrl,
decimal? AudioVisualizerDurationSec,
bool ManualColorPicker,
Guid? SelectedPresetStoryId,
string? LastEditStep,
string EditState,
DateTime LastEditDate,
DateTime CreatedAt,
List<SavedSceneResponse> Scenes,
List<SavedSharedColorResponse> SharedColors,
List<SavedSharedColorPresetResponse> SharedColorPresets,
List<SavedSharedLayerResponse> SharedLayers
);
public record SavedSceneResponse(
long Id,
Guid? OriginalSceneId,
string Key,
string? Title,
string? Image,
string? Demo,
string SceneType,
int Sort,
decimal SceneLengthSec,
decimal? MinDurationSec,
decimal? MaxDurationSec,
decimal OverlapAtEndSec,
bool CanHandleDuration,
bool ManualColorSelection,
long? SelectedColorPresetId,
List<SavedSceneContentResponse> Contents,
List<SavedSceneColorResponse> Colors,
List<SavedSceneColorPresetResponse> ColorPresets,
List<SavedSceneCharacterResponse> Characters
);
public record SavedSceneContentResponse(
long Id,
string Key,
string? Title,
string Type,
string? Value,
Guid? ValueFileId,
string? FileUrlCached,
string? FontFace,
int? FontSize,
string? Justify,
int PositionInContainer,
int DirectionLayerValue,
bool IsTextBox,
string? AiInputType,
int? SelectedDp,
string? RepeaterItemKey,
int? RepeaterIndex,
bool IsFocused,
string? MappedList,
int Sort
);
public record SavedSceneColorResponse(
long Id,
string ElementKey,
string? Title,
string? Icon,
string AttrValue,
string Value,
bool IsSelected,
int Sort
);
public record SavedSceneColorPresetResponse(
long Id,
bool IsSelected,
int Sort,
List<SavedColorPresetItemResponse> Items
);
public record SavedColorPresetItemResponse(long Id, string ElementKey, string Value, int Sort);
public record SavedSceneCharacterResponse(
long Id,
Guid Key,
string? Name,
string? Icon,
List<SavedCharacterControllerResponse> Controllers
);
public record SavedCharacterControllerResponse(long Id, string? Name, string Key, string Value, int Sort);
public record SavedSharedColorResponse(
long Id,
string ElementKey,
string? Title,
string? Icon,
string AttrValue,
string Value,
bool IsSelected,
int Sort
);
public record SavedSharedColorPresetResponse(
long Id,
string? Name,
bool IsSelected,
int Sort,
List<SavedColorPresetItemResponse> Items
);
public record SavedSharedLayerResponse(
long Id,
string Key,
string? Title,
string Type,
string? Value,
Guid? ValueFileId,
string? FileUrlCached,
string? FontFace,
int? FontSize,
string? Justify,
int PositionInContainer,
int DirectionLayerValue,
bool IsTextBox,
string? AiInputType,
string? MappedList,
int? Width,
int? Height,
bool IsFocused,
bool IsFontChangeable,
bool IsFontSizeChangeable,
int Sort
);