/// <summary>
        /// Builds the multi system list to hyperspin asynchronously.
        /// </summary>
        /// <returns></returns>
        private Task <bool> BuildMultiSystemAsync()
        {
            MultiSystemOptions = new MultiSystemOptions
            {
                CopyMedia            = CopyMedia,
                CreateGenres         = CreateGenres,
                CreateRomMap         = CreateRomMap,
                CreateSymbolicLinks  = CreateSymbolicLinks,
                MultiSystemName      = MultiSystemName,
                SettingsTemplateFile = SettingsTemplate
            };

            Log($"Settings: MS Name: {MultiSystemName}, Copy media: {CopyMedia}, Copy media: {CreateGenres}, Create RomMap: {CreateRomMap}," +
                $"Symbolic: {CreateSymbolicLinks}, HS Settings template: {SettingsTemplate}", Category.Warn);

            return(_hyperspinManager.CreateMultiSystem(MultiSystemOptions));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Creates the multi system.
        /// </summary>
        /// <param name="options">The options.</param>
        /// <returns></returns>
        public Task <bool> CreateMultiSystem(MultiSystemOptions options)
        {
            IMediaCopier mc = new MediaCopier(_hyperspinFrontEnd);

            _hsSerializer = new HyperspinSerializer(_hyperspinFrontEnd.Path, options.MultiSystemName, "");
            IMultiSystem ms    = new MultiSystem(_hsSerializer, _systemCreator, mc, options);
            var          games = MultiSystemGamesList.Select(x => x.Game);

            if (!Systems.Any(x => x.Name == options.MultiSystemName))
            {
                Systems.Add(new MenuItemViewModel(new MainMenu(options.MultiSystemName, 1)));
            }

            //Group the games because we can't have duplicate romnames in the database.
            var filteredGames = games.GroupBy(x => x.RomName).Select(grp => grp.First());

            return(ms.CreateMultiSystem(filteredGames
                                        , _hyperspinFrontEnd.Path, _settingsRepo.HypermintSettings.RlPath));
        }