Example #1
0
        public override ItemList ProcessShow(ShowConfiguration si, bool forceRefresh)
        {
            ItemList theActionList = new ItemList();

            if (!TVSettings.Instance.FolderJpg)
            {
                return(theActionList);
            }

            FileInfo fi = FileHelper.FileInFolder(si.AutoAddFolderBase, DEFAULT_FILE_NAME);
            bool     fileDoesntExist = !doneFolderJpg.Contains(fi.FullName) && !fi.Exists;

            if (forceRefresh || fileDoesntExist)
            {
                CachedSeriesInfo cachedSeries = si.CachedShow;

                if (cachedSeries is null)
                {
                    return(theActionList);
                }

                //default to poster when we want season posters for the season specific folders
                string downloadPath = TVSettings.Instance.SeasonSpecificFolderJPG()
                    ? cachedSeries.GetSeriesPosterPath()
                    : cachedSeries.GetImage(TVSettings.Instance.ItemForFolderJpg());

                if (!string.IsNullOrEmpty(downloadPath))
                {
                    theActionList.Add(new ActionDownloadImage(si, null, fi, downloadPath, false));
                }

                doneFolderJpg.Add(fi.FullName);
            }
            return(theActionList);
        }
Example #2
0
        private static string CreateHtml([NotNull] ShowConfiguration si)
        {
            CachedSeriesInfo cachedSeries = si.CachedShow;

            if (cachedSeries is null)
            {
                return(string.Empty);
            }

            string posterUrl      = TheTVDB.API.GetImageURL(cachedSeries.GetImage(TVSettings.FolderJpgIsType.Poster));
            string yearRange      = ShowHtmlHelper.YearRange(cachedSeries);
            string episodeSummary = cachedSeries.Episodes.Count.ToString();
            string stars          = ShowHtmlHelper.StarRating(cachedSeries.SiteRating / 2);
            string genreIcons     = string.Join(" ", cachedSeries.Genres.Select(ShowHtmlHelper.GenreIconHtml));
            string siteRating     = cachedSeries.SiteRating > 0 ? cachedSeries.SiteRating + "/10" : "";

            return($@"<div class=""card card-body"">
            <div class=""row"">
            <div class=""col-md-4"">
                <img class=""show-poster rounded w-100"" src=""{posterUrl}"" alt=""{si.ShowName} Show Poster""></div>
            <div class=""col-md-8 d-flex flex-column"">
                <div class=""row"">
                    <div class=""col-md-8""><h1>{si.ShowName}</h1></div>
                    <div class=""col-md-4 text-right""><h6>{yearRange} ({cachedSeries.Status})</h6><small class=""text-muted"">{episodeSummary} Episodes</small></div>
                </div>
            <div><blockquote>{cachedSeries.Overview}</blockquote></div>
            <div><blockquote>{cachedSeries.GetActorNames().ToCsv()}</blockquote></div>
            <div class=""row align-items-bottom flex-grow-1"">
                <div class=""col-md-4 align-self-end"">{stars}<br>{siteRating}</div>
                <div class=""col-md-4 align-self-end text-center"">{cachedSeries.ContentRating}<br>{cachedSeries.Network}</div>
                <div class=""col-md-4 align-self-end text-right"">{genreIcons}<br>{cachedSeries.Genres.ToCsv()}</div>
            </div>
            </div></div></div>");
        }