Use DefaultAsync for default storage location

This commit is contained in:
Pat Hartl 2025-11-21 13:15:57 -06:00
parent 7374c904a1
commit 55ad5ddb96
2 changed files with 2 additions and 2 deletions

View file

@ -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;

View file

@ -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();