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

update from main #1351

Merged
merged 25 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
051f993
- Vimeo updated to v1.0.9 and Start TUS log is used.
ShadyNagy Dec 16, 2024
2274b77
Merge pull request #1335 from DevBetterCom/ShadyNagy/vimeo-start-fix2
ShadyNagy Dec 16, 2024
ec606e9
- update to v1.0.10
ShadyNagy Dec 16, 2024
1043a05
Merge pull request #1336 from DevBetterCom/ShadyNagy/update-vimeo-1010
ShadyNagy Dec 16, 2024
944a8e2
fix the log.
ShadyNagy Dec 20, 2024
c13c675
Merge pull request #1337 from DevBetterCom/ShadyNagy/log-added-vimeo
ShadyNagy Dec 20, 2024
f744dcb
- try
ShadyNagy Dec 20, 2024
f5dae34
Merge pull request #1338 from DevBetterCom/ShadyNagy/log-added-vimeo-…
ShadyNagy Dec 20, 2024
9ea6bf3
- removed fetch
ShadyNagy Dec 20, 2024
8a21ff6
Merge pull request #1339 from DevBetterCom/ShadyNagy/fetch-ajax-vimeo
ShadyNagy Dec 20, 2024
f582e4c
- fix
ShadyNagy Dec 20, 2024
1f2808e
Merge pull request #1341 from DevBetterCom/ShadyNagy/log-added-vimeo-…
ShadyNagy Dec 20, 2024
503e45a
fix
ShadyNagy Dec 20, 2024
d270c9b
Merge pull request #1342 from DevBetterCom/ShadyNagy/log-added-vimeo-…
ShadyNagy Dec 20, 2024
0f006ca
fix
ShadyNagy Dec 20, 2024
b2cfad4
Merge pull request #1343 from DevBetterCom/ShadyNagy/vimeo-anti-added
ShadyNagy Dec 20, 2024
dd531d1
Add logging
ardalis Dec 20, 2024
2ddb440
fix
ShadyNagy Dec 20, 2024
e032c26
Merge pull request #1345 from DevBetterCom/ShadyNagy/vimeo-usestaticf…
ShadyNagy Dec 20, 2024
ba3efa5
Update CI/CD to push to a Linux web app (#1346)
sadukie Dec 20, 2024
5677e78
fixing AZURE_WEBAPP_NAME in ci-cd.yml
sadukie Dec 20, 2024
c78abed
Merge pull request #1347 from DevBetterCom/sadukie/move-to-linux-fixes
sadukie Dec 20, 2024
97929cc
- Api is added.
ShadyNagy Dec 23, 2024
e9010b3
Merge pull request #1348 from DevBetterCom/ShadyNagy/vimeo-api-update
ShadyNagy Dec 23, 2024
7a574c6
Update README.md (#1349)
ardalis Dec 24, 2024
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
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
Loading