private void RunBot(GmtBotOptions options) { _bot = new GmtBot(_files, options); _bot.OnProgress += Bot_OnProgress; _bot.OnComplete += Bot_OnComplete; IsBotRunning = true; _listView_progress.ItemsSource = _bot.Logger.LogEntries; _tabs.SelectedIndex = 2; _bot.Run(Dispatcher); }
public GmtBot(List <TrackFile> fileList, GmtBotOptions options) { _files = fileList; Options = options; _cacheFile = CoreVars.GetFilePath(PluginSettings.Folder, "cache.bin"); Logger = new LogBot(); if (Options.UsePersistentCache) { LoadCache(); } else { Cache = new CacheBot(); } }
/// <summary> /// Add GMT tags according to bot options /// </summary> /// <param name="file"></param> /// <param name="media"></param> /// <param name="setOptions"></param> /// <returns></returns> public static TrackFile SetGmtMedia(this TrackFile file, IGmtMedia media, GmtBotOptions setOptions) { switch (setOptions.FillTagsMode) { case 1: //If empty return(file.SetGmtMediaIfEmpty(media)); case 2: //Add to existing ones return(file.AddGmtMedia(media)); case 3: // Replace all return(file.ForceSetGmt(media)); default: // Test mode or invalid options return unchanged data return(file); } }