Skip to content

Commit

Permalink
- New vimeo is added with Start TUS log.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadyNagy committed Dec 16, 2024
1 parent ab7bfee commit dbed51b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
15 changes: 2 additions & 13 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
<PackageVersion Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.4" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Tools" PrivateAssets="all" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Identity.Core" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Identity.Stores" Version="8.0.4" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
Expand All @@ -62,7 +62,7 @@
<PackageVersion Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.13" />
<PackageVersion Include="NETStandard.Library" Version="2.0.3" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NimblePros.Vimeo" Version="1.0.9" />
<PackageVersion Include="NimblePros.Vimeo" Version="1.0.6" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="ReportGenerator" Version="5.1.25" />
<PackageVersion Include="Sendgrid" Version="9.28.1" />
Expand All @@ -81,17 +81,6 @@
<PackageVersion Include="TagHelperSamples.Authorization" Version="3.0.56" />
<PackageVersion Include="Westwind.AspNetCore.Markdown" Version="3.12.0" />
<PackageVersion Include="WindowsAzure.Storage" Version="9.3.3" />
<!-- Aspire -->
<PackageVersion Include="Aspire.Hosting.AppHost" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http.Resilience" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="8.0.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.9.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Prometheus.AspNetCore" Version="1.9.0-beta.2" />
<!-- Test -->
<PackageVersion Include="xunit" Version="2.6.6" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="xunit.runner.console" Version="2.9.0">
Expand Down
14 changes: 3 additions & 11 deletions src/DevBetterWeb.Core/Services/CreateVideoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
using NimblePros.Vimeo.Models;
using NimblePros.Vimeo.VideoServices;
using NimblePros.Vimeo.VideoTusService;
using static DevBetterWeb.Core.Entities.Member;
using static Microsoft.ApplicationInsights.MetricDimensionNames.TelemetryContext;

namespace DevBetterWeb.Core.Services;
public class CreateVideoService : ICreateVideoService
Expand All @@ -22,15 +20,13 @@ public class CreateVideoService : ICreateVideoService
private readonly IUploadVideoTusService _uploadVideoTusService;
private readonly IRepository<ArchiveVideo> _repositoryArchiveVideo;
private readonly IAddCreatedVideoToFolderService _addCreatedVideoToFolderService;
private readonly IAppLogger<CreateVideoService> _logger;

public CreateVideoService(IAppLogger<CreateVideoService> logger, GetVideoService getVideoService, IUploadVideoTusService uploadVideoTusService, IRepository<ArchiveVideo> repositoryArchiveVideo, IAddCreatedVideoToFolderService addCreatedVideoToFolderService)
public CreateVideoService(GetVideoService getVideoService, IUploadVideoTusService uploadVideoTusService, IRepository<ArchiveVideo> repositoryArchiveVideo, IAddCreatedVideoToFolderService addCreatedVideoToFolderService)
{
_getVideoService = getVideoService;
_uploadVideoTusService = uploadVideoTusService;
_repositoryArchiveVideo = repositoryArchiveVideo;
_addCreatedVideoToFolderService = addCreatedVideoToFolderService;
_logger = logger;
}

public async Task<string> StartAsync(string videoName, long videoSize, string domain, CancellationToken cancellationToken = default)
Expand All @@ -44,13 +40,9 @@ public async Task<string> StartAsync(string videoName, long videoSize, string do
EmbedDomains = new List<string> { domain },
HideFromVimeo = true
};
var responseSessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken);
if (!responseSessionId.IsSuccess || string.IsNullOrEmpty(responseSessionId.Data))
{
_logger.LogError(new Exception(responseSessionId.Exception.Message), responseSessionId.Json);
}
var sessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken);

return responseSessionId.Data;
return sessionId;
}

public async Task<UploadChunkStatus> UploadChunkAsync(bool isBaseFolder, string sessionId, string chunk, string? description, long? folderId, CancellationToken cancellationToken = default)
Expand Down

0 comments on commit dbed51b

Please sign in to comment.