Skip to content

Commit

Permalink
- Vimeo updated to v1.0.9 and Start TUS log is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShadyNagy committed Dec 16, 2024
1 parent ad14262 commit 051f993
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
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

0 comments on commit 051f993

Please sign in to comment.