mirror of
https://github.com/fergalmoran/podnoms.git
synced 2025-12-22 09:18:08 +00:00
Temp image fix
This commit is contained in:
@@ -8,6 +8,7 @@ using Hangfire;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Identity;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using PodNoms.Api.Models;
|
||||
@@ -25,6 +26,9 @@ namespace PodNoms.Api.Controllers {
|
||||
public class EntryController : BaseAuthController {
|
||||
private readonly IPodcastRepository _podcastRepository;
|
||||
private readonly IEntryRepository _repository;
|
||||
|
||||
public IConfiguration _options { get; }
|
||||
|
||||
private readonly IUnitOfWork _unitOfWork;
|
||||
private readonly IMapper _mapper;
|
||||
private readonly IUrlProcessService _processor;
|
||||
@@ -36,12 +40,14 @@ namespace PodNoms.Api.Controllers {
|
||||
IPodcastRepository podcastRepository,
|
||||
IUnitOfWork unitOfWork, IMapper mapper, IOptions<StorageSettings> storageSettings,
|
||||
IOptions<AudioFileStorageSettings> audioFileStorageSettings,
|
||||
IConfiguration options,
|
||||
IUrlProcessService processor, ILoggerFactory logger,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
IHttpContextAccessor contextAccessor) : base(contextAccessor, userManager) {
|
||||
this._logger = logger.CreateLogger<EntryController>();
|
||||
this._podcastRepository = podcastRepository;
|
||||
this._repository = repository;
|
||||
this._options = options;
|
||||
this._storageSettings = storageSettings.Value;
|
||||
this._unitOfWork = unitOfWork;
|
||||
this._audioFileStorageSettings = audioFileStorageSettings.Value;
|
||||
@@ -57,7 +63,10 @@ namespace PodNoms.Api.Controllers {
|
||||
extractJobId, service => service.UploadAudio(entry.Id, entry.AudioUrl));
|
||||
var notify = BackgroundJob.ContinueWith<INotifyJobCompleteService>(
|
||||
uploadJobId, service => service.NotifyUser(entry.Podcast.AppUser.Id, "PodNoms", $"{entry.Title} has finished processing",
|
||||
entry.Podcast.ImageUrl));
|
||||
entry.Podcast.GetThumbnailUrl(
|
||||
this._options.GetSection("Storage")["CdnUrl"],
|
||||
this._options.GetSection("ImageFileStorageSettings")["ContainerName"])
|
||||
));
|
||||
} catch (InvalidOperationException ex) {
|
||||
_logger.LogError($"Failed submitting job to processor\n{ex.Message}");
|
||||
entry.ProcessingStatus = ProcessingStatus.Failed;
|
||||
|
||||
Reference in New Issue
Block a user