Polish Round 2 (#2845)
This commit is contained in:
parent
c47fec4648
commit
5195f08c2f
11 changed files with 63 additions and 22 deletions
|
@ -108,7 +108,7 @@ public class DeviceService : IDeviceService
|
|||
public async Task<bool> SendTo(IReadOnlyList<int> chapterIds, int deviceId)
|
||||
{
|
||||
var settings = await _unitOfWork.SettingsRepository.GetSettingsDtoAsync();
|
||||
if (!settings.IsEmailSetup())
|
||||
if (!settings.IsEmailSetupForSendToDevice())
|
||||
throw new KavitaException("send-to-kavita-email");
|
||||
|
||||
var device = await _unitOfWork.DeviceRepository.GetDeviceById(deviceId);
|
||||
|
@ -123,9 +123,16 @@ public class DeviceService : IDeviceService
|
|||
throw new KavitaException("send-to-size-limit");
|
||||
|
||||
|
||||
device.UpdateLastUsed();
|
||||
_unitOfWork.DeviceRepository.Update(device);
|
||||
await _unitOfWork.CommitAsync();
|
||||
try
|
||||
{
|
||||
device.UpdateLastUsed();
|
||||
_unitOfWork.DeviceRepository.Update(device);
|
||||
await _unitOfWork.CommitAsync();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.LogError(ex, "There was an issue updating device last used time");
|
||||
}
|
||||
|
||||
var success = await _emailService.SendFilesToEmail(new SendToDto()
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue