Пример #1
0
        public string GetDirectoryName()
        {
            string meta = string.Empty;

            if (!Metascore.IsZero())
            {
                meta = $", Meta-{Math.Round(Metascore, 1)}";
            }
            string ebert = string.Empty;

            if (StdEbertRating != 0)
            {
                ebert = $" Ebert-{EbertRating}";
            }
            string name = $"{Math.Round(Score,1)}, {Title} ({Year}) [{Runtime}] IMDB-{imdbRating}. RT={Math.Round(StdRtMeter??0,1)}%.{Math.Round(StdRtRating ?? 0,1)}, Meta-{Math.Round(Metascore,1)}{ebert}";


            if (Settings.Config.AppendGenre && !string.IsNullOrWhiteSpace(Genre))
            {
                var    genres      = Genre.Split(',').Select(x => $"[{x.Trim()}]");
                string genreString = string.Join(" ", genres);
                name = $"{name} {genreString}";
            }
            if (Settings.Config.AppendOscars && !Awards.IsNullOrWhitespace() && Awards.ToLowerInvariant().Contains("oscar"))
            {
                string oscarTag = OscarTagger.GetOscarTag(Awards);
                if (!oscarTag.IsNullOrWhitespace())
                {
                    name = $"{name} {oscarTag}";
                }
            }
            var invalid = Path.GetInvalidFileNameChars().Intersect(name);

            if (invalid.Any())
            {
                foreach (var i in invalid)
                {
                    name = name.Replace(i.ToString(), String.Empty);
                }
            }


            return(name);
        }