Skip to content

Commit

Permalink
misc: log library id in import folder iteration step during VFS gener…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
revam committed Sep 29, 2024
1 parent 1ac96b2 commit c9a6f75
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Shokofin/Resolvers/VirtualFileSystemService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,7 @@ private HashSet<string> GetPathsForMediaFolders(IReadOnlyList<MediaFolderConfigu
var singleSeriesIds = new HashSet<int>();
var multiSeriesFiles = new List<(API.Models.File, string)>();
var totalSingleSeriesFiles = 0;
var libraryId = mediaConfigs[0].LibraryId;
foreach (var (importFolderId, importFolderSubPath, mediaFolderPaths) in mediaConfigs.ToImportFolderList()) {
var firstPage = ApiClient.GetFilesForImportFolder(importFolderId, importFolderSubPath);
var pageData = firstPage
Expand All @@ -533,10 +534,11 @@ private HashSet<string> GetPathsForMediaFolders(IReadOnlyList<MediaFolderConfigu
.GetResult();
var totalPages = pageData.List.Count == pageData.Total ? 1 : (int)Math.Ceiling((float)pageData.Total / pageData.List.Count);
Logger.LogDebug(
"Iterating ≤{FileCount} files to potentially use within media folder at {Path} by checking {TotalCount} matches. (ImportFolder={FolderId},RelativePath={RelativePath},PageSize={PageSize},TotalPages={TotalPages})",
"Iterating ≤{FileCount} files to potentially use within media folder at {Path} by checking {TotalCount} matches. (LibraryId={LibraryId},ImportFolder={FolderId},RelativePath={RelativePath},PageSize={PageSize},TotalPages={TotalPages})",
fileSet.Count,
mediaFolderPaths,
pageData.Total,
libraryId,
importFolderId,
importFolderSubPath,
pageData.List.Count == pageData.Total ? null : pageData.List.Count,
Expand All @@ -556,9 +558,10 @@ private HashSet<string> GetPathsForMediaFolders(IReadOnlyList<MediaFolderConfigu
pageData = task.Result;

Logger.LogTrace(
"Iterating page {PageNumber} with size {PageSize} (ImportFolder={FolderId},RelativePath={RelativePath})",
"Iterating page {PageNumber} with size {PageSize} (LibraryId={LibraryId},ImportFolder={FolderId},RelativePath={RelativePath})",
totalPages - pages.Count,
pageData.List.Count,
libraryId,
importFolderId,
importFolderSubPath
);
Expand Down Expand Up @@ -634,7 +637,7 @@ private HashSet<string> GetPathsForMediaFolders(IReadOnlyList<MediaFolderConfigu
totalMultiSeriesFiles,
mediaConfigs.Count,
timeSpent,
mediaConfigs[0].LibraryId
libraryId
);
}

Expand Down

0 comments on commit c9a6f75

Please sign in to comment.