Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vimeo updated to v1.0.9 and Start TUS log is used. #1335

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -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.6" />
<PackageVersion Include="NimblePros.Vimeo" Version="1.0.9" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="ReportGenerator" Version="5.1.25" />
<PackageVersion Include="Sendgrid" Version="9.28.1" />
Expand Down
14 changes: 11 additions & 3 deletions src/DevBetterWeb.Core/Services/CreateVideoService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
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 @@ -20,13 +22,15 @@ public class CreateVideoService : ICreateVideoService
private readonly IUploadVideoTusService _uploadVideoTusService;
private readonly IRepository<ArchiveVideo> _repositoryArchiveVideo;
private readonly IAddCreatedVideoToFolderService _addCreatedVideoToFolderService;
private readonly IAppLogger<CreateVideoService> _logger;

public CreateVideoService(GetVideoService getVideoService, IUploadVideoTusService uploadVideoTusService, IRepository<ArchiveVideo> repositoryArchiveVideo, IAddCreatedVideoToFolderService addCreatedVideoToFolderService)
public CreateVideoService(IAppLogger<CreateVideoService> logger, 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 @@ -40,9 +44,13 @@ public async Task<string> StartAsync(string videoName, long videoSize, string do
EmbedDomains = new List<string> { domain },
HideFromVimeo = true
};
var sessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken);
var responseSessionId = await _uploadVideoTusService.StartAsync(uploadVideoRequest, cancellationToken);
if (!responseSessionId.IsSuccess || string.IsNullOrEmpty(responseSessionId.Data))
{
_logger.LogError(new Exception(responseSessionId.Exception.Message), responseSessionId.Json);
}

return sessionId;
return responseSessionId.Data;
}

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