Skip to content

Commit

Permalink
fix: update version check to support physical vfs roots
Browse files Browse the repository at this point in the history
  • Loading branch information
revam authored Sep 23, 2024
1 parent 5ea5cb1 commit 109b967
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Shokofin/Tasks/VersionCheckTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,16 @@ public async Task ExecuteAsync(IProgress<double> progress, CancellationToken can
mediaFolders
.Select(m => m.ImportFolderId)
.Distinct()
.Except([0])
.Except([0, -1])
.Select(id => _apiClient.GetImportFolder(id))
.ToList()
)
.ContinueWith(task => task.Result.OfType<ImportFolder>().ToDictionary(i => i.Id, i => i.Name))
.ConfigureAwait(false);
foreach (var mediaFolderConfig in mediaFolders) {
if (mediaFolderConfig.IsVirtualRoot)
continue;

if (!importFolderNameMap.TryGetValue(mediaFolderConfig.ImportFolderId, out var importFolderName))
importFolderName = null;

Expand All @@ -90,7 +93,7 @@ public async Task ExecuteAsync(IProgress<double> progress, CancellationToken can
updated = true;
}

if (!string.Equals(mediaFolderConfig.ImportFolderName, importFolderName)) {
if (!string.IsNullOrEmpty(importFolderName) && !string.Equals(mediaFolderConfig.ImportFolderName, importFolderName)) {
_logger.LogDebug("Found new name for import folder; {name} (ImportFolder={ImportFolderId})", importFolderName, mediaFolderConfig.ImportFolderId);
mediaFolderConfig.ImportFolderName = importFolderName;
updated = true;
Expand All @@ -100,4 +103,4 @@ public async Task ExecuteAsync(IProgress<double> progress, CancellationToken can
Plugin.Instance.UpdateConfiguration();
}
}
}
}

0 comments on commit 109b967

Please sign in to comment.