Skip to content

Commit

Permalink
⚡️ Run initial scan in background
Browse files Browse the repository at this point in the history
  • Loading branch information
LNA-DEV committed Feb 8, 2025
1 parent 28ad45f commit d661437
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions OpenMediaServer/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,15 @@
app.UseAuthentication();
app.UseAuthorization();

// Run initial content scan and set up watchers
// Run initial content scan
var contentDiscoveryService = app.Services.GetRequiredService<IContentDiscoveryService>();
await contentDiscoveryService.ActiveScan(Globals.MediaFolder);

Task.Run(async () =>
{
await contentDiscoveryService.ActiveScan(Globals.MediaFolder);
});

// Setup watcher
contentDiscoveryService.Watch(Globals.MediaFolder);

// Map endpoints
Expand Down

0 comments on commit d661437

Please sign in to comment.