Duration as double
This commit is contained in:
@@ -22,7 +22,7 @@ namespace Musify.Application.Mixes
|
|||||||
{
|
{
|
||||||
private sealed record SeedArtist(Guid Id, string Name);
|
private sealed record SeedArtist(Guid Id, string Name);
|
||||||
|
|
||||||
private sealed record LocalCandidate(Guid TrackId, string Title, string? Artist, int DurationSeconds);
|
private sealed record LocalCandidate(Guid TrackId, string Title, string? Artist, double DurationSeconds);
|
||||||
|
|
||||||
private sealed record MixDraft(string Title, string? Subtitle, IReadOnlyList<MixItem> Items);
|
private sealed record MixDraft(string Title, string? Subtitle, IReadOnlyList<MixItem> Items);
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ namespace Musify.Application.Mixes.Responses
|
|||||||
string Title,
|
string Title,
|
||||||
string? Artist,
|
string? Artist,
|
||||||
string? ThumbnailUrl,
|
string? ThumbnailUrl,
|
||||||
int DurationSeconds,
|
double DurationSeconds,
|
||||||
bool IsExplicit)
|
bool IsExplicit)
|
||||||
{
|
{
|
||||||
public static MixItemApplicationResponse FromEntity(MixItem item) =>
|
public static MixItemApplicationResponse FromEntity(MixItem item) =>
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ namespace Musify.Application.Tracks.Responses
|
|||||||
TrackSource Source,
|
TrackSource Source,
|
||||||
string? ExternalId,
|
string? ExternalId,
|
||||||
ProcessingStatus AudioStatus,
|
ProcessingStatus AudioStatus,
|
||||||
int Duration,
|
double Duration,
|
||||||
int ListensCount,
|
int ListensCount,
|
||||||
long? OwnerUserId,
|
long? OwnerUserId,
|
||||||
DateTime CreatedAt,
|
DateTime CreatedAt,
|
||||||
|
|||||||
@@ -36,10 +36,10 @@ namespace Musify.Domain.Entities
|
|||||||
public string? ThumbnailUrl { get; set; }
|
public string? ThumbnailUrl { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public int DurationSeconds { get; set; } = 0;
|
public double DurationSeconds { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public bool IsExplicit { get; set; } = false;
|
public bool IsExplicit { get; set; }
|
||||||
|
|
||||||
[ForeignKey(nameof(MixId))]
|
[ForeignKey(nameof(MixId))]
|
||||||
public Mix Mix { get; set; }
|
public Mix Mix { get; set; }
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Musify.Domain.Entities
|
|||||||
public required string NormalizedTitle { get; set; }
|
public required string NormalizedTitle { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public int DurationSeconds { get; set; }
|
public double DurationSeconds { get; set; }
|
||||||
|
|
||||||
[Required]
|
[Required]
|
||||||
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
|
public LifeCycleStatus LifeCycleStatus { get; set; } = LifeCycleStatus.Active;
|
||||||
|
|||||||
+1
-1
@@ -47,7 +47,7 @@ namespace Musify.Infrastructure.MassTransit.Activities.Audio
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var durationSeconds = executeContext.GetVariable<int>(executeContext.Arguments.DurationSecondsVariable)
|
var durationSeconds = executeContext.GetVariable<double>(executeContext.Arguments.DurationSecondsVariable)
|
||||||
?? throw new InvalidOperationException($"Missing routing slip variable {executeContext.Arguments.DurationSecondsVariable}");
|
?? throw new InvalidOperationException($"Missing routing slip variable {executeContext.Arguments.DurationSecondsVariable}");
|
||||||
|
|
||||||
var log = new UpdateTrackAudioLog(
|
var log = new UpdateTrackAudioLog(
|
||||||
|
|||||||
@@ -3,5 +3,5 @@
|
|||||||
public record UpdateTrackAudioLog(
|
public record UpdateTrackAudioLog(
|
||||||
Guid TrackId,
|
Guid TrackId,
|
||||||
string? PreviousAudioFolderName,
|
string? PreviousAudioFolderName,
|
||||||
int PreviousDurationSeconds);
|
double PreviousDurationSeconds);
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1178
File diff suppressed because it is too large
Load Diff
+22
@@ -0,0 +1,22 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace Musify.Infrastructure.Persistence.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class DurationAsDouble : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -360,8 +360,8 @@ namespace Musify.Infrastructure.Persistence.Migrations
|
|||||||
.HasMaxLength(300)
|
.HasMaxLength(300)
|
||||||
.HasColumnType("character varying(300)");
|
.HasColumnType("character varying(300)");
|
||||||
|
|
||||||
b.Property<int>("DurationSeconds")
|
b.Property<double>("DurationSeconds")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("double precision");
|
||||||
|
|
||||||
b.Property<bool>("IsExplicit")
|
b.Property<bool>("IsExplicit")
|
||||||
.HasColumnType("boolean");
|
.HasColumnType("boolean");
|
||||||
@@ -474,8 +474,8 @@ namespace Musify.Infrastructure.Persistence.Migrations
|
|||||||
b.Property<DateTime>("CreatedAt")
|
b.Property<DateTime>("CreatedAt")
|
||||||
.HasColumnType("timestamp with time zone");
|
.HasColumnType("timestamp with time zone");
|
||||||
|
|
||||||
b.Property<int>("DurationSeconds")
|
b.Property<double>("DurationSeconds")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("double precision");
|
||||||
|
|
||||||
b.Property<int>("LifeCycleStatus")
|
b.Property<int>("LifeCycleStatus")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@@ -893,21 +893,25 @@ namespace Musify.Infrastructure.Persistence.Migrations
|
|||||||
.HasColumnType("uuid");
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
b1.Property<string>("LargeName")
|
b1.Property<string>("LargeName")
|
||||||
|
.IsRequired()
|
||||||
.HasMaxLength(64)
|
.HasMaxLength(64)
|
||||||
.HasColumnType("character varying(64)")
|
.HasColumnType("character varying(64)")
|
||||||
.HasColumnName("LargePictureName");
|
.HasColumnName("LargePictureName");
|
||||||
|
|
||||||
b1.Property<string>("MediumName")
|
b1.Property<string>("MediumName")
|
||||||
|
.IsRequired()
|
||||||
.HasMaxLength(64)
|
.HasMaxLength(64)
|
||||||
.HasColumnType("character varying(64)")
|
.HasColumnType("character varying(64)")
|
||||||
.HasColumnName("MediumPictureName");
|
.HasColumnName("MediumPictureName");
|
||||||
|
|
||||||
b1.Property<string>("OriginalName")
|
b1.Property<string>("OriginalName")
|
||||||
|
.IsRequired()
|
||||||
.HasMaxLength(64)
|
.HasMaxLength(64)
|
||||||
.HasColumnType("character varying(64)")
|
.HasColumnType("character varying(64)")
|
||||||
.HasColumnName("OriginalPictureName");
|
.HasColumnName("OriginalPictureName");
|
||||||
|
|
||||||
b1.Property<string>("SmallName")
|
b1.Property<string>("SmallName")
|
||||||
|
.IsRequired()
|
||||||
.HasMaxLength(64)
|
.HasMaxLength(64)
|
||||||
.HasColumnType("character varying(64)")
|
.HasColumnType("character varying(64)")
|
||||||
.HasColumnName("SmallPictureName");
|
.HasColumnName("SmallPictureName");
|
||||||
|
|||||||
Reference in New Issue
Block a user