Use DefaultAsync for default storage location
This commit is contained in:
parent
7374c904a1
commit
55ad5ddb96
2 changed files with 2 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ public class MediaImporter(
|
|||
var archiveEntry = ImportContext.Archive.Entries.FirstOrDefault(e => e.Key == $"Media/{record.Id}");
|
||||
|
||||
var defaultMediaLocation =
|
||||
await storageLocationService.FirstOrDefaultAsync(l => l.Type == StorageLocationType.Media && l.Default);
|
||||
await storageLocationService.DefaultAsync(StorageLocationType.Media);
|
||||
|
||||
Data.Models.Media media = null;
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ namespace LANCommander.Server.Services
|
|||
media.StorageLocation = await storageLocationService.GetAsync(media.StorageLocationId);
|
||||
|
||||
if (media.StorageLocation == null)
|
||||
media.StorageLocation = await storageLocationService.FirstOrDefaultAsync(l => l.Type == StorageLocationType.Media && l.Default);
|
||||
media.StorageLocation = await storageLocationService.DefaultAsync(StorageLocationType.Media);
|
||||
|
||||
if (media.FileId == Guid.Empty)
|
||||
media.FileId = Guid.NewGuid();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue