Skip to content

Commit

Permalink
refactor: use setting for thread count
Browse files Browse the repository at this point in the history
but don't add it to the UI… yet at least.
  • Loading branch information
revam committed Mar 28, 2024
1 parent fbf6b63 commit b806492
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Shokofin/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public virtual string PrettyHost

public bool VirtualFileSystem { get; set; }

public int VirtualFileSystemThreads { get; set; }

public bool UseGroupsForShows { get; set; }

public bool SeparateMovies { get; set; }
Expand Down Expand Up @@ -128,6 +130,7 @@ public PluginConfiguration()
TitleAllowAny = false;
DescriptionSource = TextSourceType.Default;
VirtualFileSystem = true;
VirtualFileSystemThreads = 10;
UseGroupsForShows = false;
SeparateMovies = false;
SeasonOrdering = OrderType.Default;
Expand Down
2 changes: 1 addition & 1 deletion Shokofin/Resolvers/ShokoResolveManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private async Task GenerateSymbolicLinks(Folder mediaFolder, IReadOnlyList<(stri
var vfsPath = ShokoAPIManager.GetVirtualRootForMediaFolder(mediaFolder);
var collectionType = LibraryManager.GetInheritedContentType(mediaFolder);
var allPathsForVFS = new ConcurrentBag<(string sourceLocation, string symbolicLink)>();
var semaphore = new SemaphoreSlim(10);
var semaphore = new SemaphoreSlim(Plugin.Instance.Configuration.VirtualFileSystemThreads);
await Task.WhenAll(files
.Select(async (tuple) => {
await semaphore.WaitAsync();
Expand Down

0 comments on commit b806492

Please sign in to comment.