private void AddPreferredWords(Dictionary <string, Func <TokenMatch, string> > tokenHandlers, Series series, EpisodeFile episodeFile, PreferredWordMatchResults preferredWords = null) { if (preferredWords == null) { preferredWords = _preferredWordService.GetMatchingPreferredWords(series, episodeFile.GetSceneOrFileName()); } tokenHandlers["{Preferred Words}"] = m => { var profileName = ""; if (m.CustomFormat != null) { profileName = m.CustomFormat.Trim(); } if (profileName.IsNullOrWhiteSpace()) { return(string.Join(" ", preferredWords.All)); } if (preferredWords.ByReleaseProfile.TryGetValue(profileName, out var profilePreferredWords)) { return(string.Join(" ", profilePreferredWords)); } return(string.Empty); }; }
private void AddPreferredWords(Dictionary <string, Func <TokenMatch, string> > tokenHandlers, Series series, EpisodeFile episodeFile, List <string> preferredWords = null) { if (preferredWords == null) { preferredWords = _preferredWordService.GetMatchingPreferredWords(series, episodeFile.GetSceneOrFileName()); } tokenHandlers["{Preferred Words}"] = m => string.Join(" ", preferredWords); }
private void AddPreferredWords(Dictionary <string, Func <TokenMatch, string> > tokenHandlers, Artist artist, TrackFile trackFile, List <string> preferredWords = null) { if (preferredWords == null) { preferredWords = _preferredWordService.GetMatchingPreferredWords(artist, trackFile.GetSceneOrFileName()); } tokenHandlers["{Preferred Words}"] = m => string.Join(" ", preferredWords); }