Exemplo n.º 1
0
        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);
            };
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }