Exemplo n.º 1
0
        public async Task FindMissingAssets(CancellationToken token)
        {
            IsWorking = true;

            var missingAssets = await Task.Run(async() =>
            {
                var finder = new Finder(SelectedDataPath);

                await finder.BuildBSACacheAsync();
                await finder.BuildLooseFileCacheAsync();

                SelectedPlugins.Do(s =>
                {
                    finder.FindMissingAssets(s);
                });

                return(finder.MissingAssets);
            }, token);

            missingAssets.Sort((first, second) => (int)first.Record.FormKey.ID - (int)second.Record.FormKey.ID);
            MissingAssets = missingAssets;

            IsWorking = false;

            /*missingAssets.Do(a =>
             * {
             *  Utils.Log($"{a.Record.FormKey} is missing {a.Files.Aggregate((x,y) => $"{x},{y}")}");
             * });*/
        }
Exemplo n.º 2
0
        public async Task FindMissingAssets(CancellationToken token)
        {
            IsWorking = true;
            try
            {
                var missingAssets = await Task.Run(async() =>
                {
                    using var finder = new Finder(SelectedDataPath);

                    await finder.BuildBSACacheAsync();
                    await finder.BuildLooseFileCacheAsync();

                    if (UseLoadOrder)
                    {
                        finder.FindMissingAssets(UseLoadOrder);
                    }
                    else
                    {
                        SelectedPlugins.Do(s => { finder.FindMissingAssets(s); });
                    }

                    return(finder.MissingAssets);
                }, token);

                if (!UseLoadOrder)
                {
                    missingAssets.Sort((first, second) =>
                                       new Finder.FormKeyComparer().Compare(first.Record.FormKey, second.Record.FormKey));
                }
                MissingAssets = missingAssets;
            }
            catch (Exception e)
            {
                Utils.Log($"Exception: {e}");
            }
            finally
            {
                IsWorking = false;
            }
        }
Exemplo n.º 3
0
 public void DownloadPlugins()
 {
     SelectedPlugins.ForEach(selectedPlugin => selectedPlugin.Download());
 }