Skip to content

Commit

Permalink
Merge pull request #1351 from DevBetterCom/main
Browse files Browse the repository at this point in the history
update from main
  • Loading branch information
ShadyNagy authored Dec 28, 2024
2 parents 41bca8d + 7a574c6 commit 0225cca
Show file tree
Hide file tree
Showing 13 changed files with 305 additions and 306 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI/CD Pipeline
on: [ push, pull_request, workflow_dispatch ]

env:
AZURE_WEBAPP_NAME: devBetter
AZURE_WEBAPP_NAME: devbetter-linux
AZURE_GROUP_NAME: DevBetterGroup
AZURE_WEBAPP_PACKAGE_PATH: '.'

Expand All @@ -12,7 +12,7 @@ jobs:
name: Continuous Integration
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
outputs:
is_push_to_default_branch: ${{ steps.conditionals_handler.outputs.is_push_to_default_branch }}
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
if: needs.ci.outputs.is_push_to_default_branch == 'true'
name: Continuous Deployment
needs: ci
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: Download publish artifacts
id: dl_publish_artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [pull_request, workflow_dispatch]
jobs:
build:

runs-on: windows-latest
runs-on: ubuntu-latest
env:
VIMEO_TOKEN: ${{ secrets.VIMEO_TOKEN }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: publish

env:
AZURE_WEBAPP_NAME: devBetter
AZURE_WEBAPP_NAME: devbetter-linux
AZURE_GROUP_NAME: DevBetterGroup
AZURE_WEBAPP_PACKAGE_PATH: '.' # set this to the path to your web app project, defaults to the repository root

Expand All @@ -12,7 +12,7 @@ on:

jobs:
build-and-deploy:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
Expand Down
3 changes: 2 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@
<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.ApiClient" Version="1.0.11" />
<PackageVersion Include="NimblePros.Vimeo" Version="1.0.10" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="ReportGenerator" Version="5.1.25" />
<PackageVersion Include="Sendgrid" Version="9.28.1" />
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ A web application for devBetter.com, a developer coaching program web site and a

## What is devBetter?

Head over to [devBetter.com](https://devbetter.com) to see the live site. Scroll through the home page and read the testimonials. Essentially devBetter is a group dedicated to improving professional software developers of all stripes. We have a virtual community (currently using Discord) and we meet for live group Q&A sessions about once a week (currently using Zoom). We challenge and promote one another, answer tough code and software design questions, work through exercises, and more. This site is used as a playground by some members and its owner, Steve, to provide a real, working example of some of the coding techniques and practices we discuss. This is in contrast to labs, katas, and exercises that, while also valuable, are not the same as solving real world problems with real software in a production environment.
Head over to [devBetter.com](https://devbetter.com) to see the live site. Scroll through the home page and read the testimonials. Essentially devBetter is a group dedicated to improving professional software developers of all stripes. We have a virtual community (currently using Discord) and we meet for live group Q&A sessions about once a week (currently using Zoom). We challenge and promote one another, answer tough code and software design questions, work through exercises, and more. This site is used as a playground by some members and its owner, ardalis, to provide a real, working example of some of the coding techniques and practices we discuss. This is in contrast to labs, katas, and exercises that, while also valuable, are not the same as solving real world problems with real software in a production environment.

## Features

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"version": "8.*",
"rollForward": "latestFeature"
}
}
16 changes: 13 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,15 @@ 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);
//TODO: Remove this
_logger.LogInformation($"Error Vimeo: {responseSessionId.Json}");
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
1 change: 1 addition & 0 deletions src/DevBetterWeb.Web/DevBetterWeb.Web.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
</PackageReference>
<PackageReference Include="Microsoft.Web.LibraryManager.Build" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NimblePros.ApiClient" />
<PackageReference Include="NimblePros.Vimeo" />
<PackageReference Include="Sendgrid" />
<PackageReference Include="Serilog" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public UploadChunkEndpoint(ICreateVideoService createVideo, VimeoSettings vimeoS
_vimeoSettings = vimeoSettings;
}

[HttpPost("videos/upload")]
[HttpPost("api/videos/upload")]
public override async Task<ActionResult<UploadChunkStatus>> HandleAsync([FromBody] UploadChunkRequest uploadChunkRequest, CancellationToken cancellationToken = default)
{
if (uploadChunkRequest.Chunk.Length <= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@ public class UploadVideoStartEndpoint : EndpointBaseAsync
.WithResult<ActionResult<UploadVideoStartResponse>>
{
private readonly ICreateVideoService _createVideo;
private readonly IAppLogger<UploadVideoStartEndpoint> _logger;

public UploadVideoStartEndpoint(ICreateVideoService createVideo)
public UploadVideoStartEndpoint(ICreateVideoService createVideo,
IAppLogger<UploadVideoStartEndpoint> logger)
{
_createVideo = createVideo;
_logger = logger;
}

[HttpPost("videos/start")]
[HttpPost("api/videos/start")]
public override async Task<ActionResult<UploadVideoStartResponse>> HandleAsync([FromBody] UploadVideoStartRequest request, CancellationToken cancellationToken = default)
{
_logger.LogWarning("HandleAsync called for videos/start");
string domain = HttpContext.Request.Host.Value;
var sessionId = await _createVideo.StartAsync(request.VideoName, request.VideoSize, domain, cancellationToken);

Expand Down
Loading

0 comments on commit 0225cca

Please sign in to comment.