Example #1
0
        public static string ToStringPublishMediaInfo(TaskSettings ts)
        {
            StringBuilder sbPublish = new StringBuilder();

            switch (ts.MediaOptions.MediaTypeChoice)
            {
            case MediaType.MediaDisc:
                StringBuilder sbMediaInfo = new StringBuilder();
                if (ts.Media.MediaFiles.Count > 0)
                {
                    foreach (MediaFile mf in ts.Media.MediaFiles)
                    {
                        sbMediaInfo.AppendLine(BbCode.Bold(mf.FileName));
                        sbMediaInfo.AppendLine(mf.Summary.Trim());
                        sbMediaInfo.AppendLine();
                    }
                }
                else
                {
                    sbMediaInfo.AppendLine(ts.Media.Overall.Summary.Trim());
                    sbMediaInfo.AppendLine();
                }

                sbPublish.AppendLine(BbFormat(sbMediaInfo.ToString(), ts.PublishOptions));

                if (ts.MediaOptions.UploadScreenshots)
                {
                    sbPublish.AppendLine(ts.Media.Overall.GetScreenshotString(ts.PublishOptions));
                }

                break;

            default:
                foreach (MediaFile mf in ts.Media.MediaFiles)
                {
                    sbMediaInfo = new StringBuilder();
                    sbMediaInfo.AppendLine(mf.Summary.Trim());
                    sbMediaInfo.AppendLine();

                    sbPublish.AppendLine(BbFormat(sbMediaInfo.ToString(), ts.PublishOptions));

                    if (ts.MediaOptions.UploadScreenshots)
                    {
                        sbPublish.AppendLine();
                        sbPublish.AppendLine(mf.GetScreenshotString(ts.PublishOptions));
                    }
                }

                break;
            }

            string publishInfo = sbPublish.ToString().Trim();

            if (App.Settings.ProfileActive.HidePrivateInfo)
            {
                publishInfo = Regex.Replace(publishInfo, "(?<=Complete name *: ).+?(?=\\r)", match => Path.GetFileName(match.Value));
            }

            return(publishInfo);
        }
Example #2
0
        public string CreatePublishMediaInfo(PublishOptionsPacket pop)
        {
            StringBuilder sbPublish = new StringBuilder();

            switch (Media.MediaTypeChoice)
            {
            case MediaType.MediaDisc:
                StringBuilder sbMediaInfo = new StringBuilder();
                if (Media.MediaFiles.Count > 0)
                {
                    foreach (MediaFile mf in Media.MediaFiles)
                    {
                        sbMediaInfo.AppendLine(BbCode.Bold(mf.FileName));
                        sbMediaInfo.AppendLine(mf.Summary.Trim());
                        sbMediaInfo.AppendLine();
                    }
                }
                else
                {
                    sbMediaInfo.AppendLine(Media.Overall.Summary.Trim());
                    sbMediaInfo.AppendLine();
                }

                sbPublish.AppendLine(GetPublishString(sbMediaInfo.ToString(), pop));

                if (Media.UploadScreenshots)
                {
                    sbPublish.AppendLine(Media.Overall.GetScreenshotString(pop));
                }

                break;

            default:
                foreach (MediaFile mf in Media.MediaFiles)
                {
                    sbMediaInfo = new StringBuilder();
                    sbMediaInfo.AppendLine(BbCode.Bold(mf.FileName));
                    sbMediaInfo.AppendLine();
                    sbMediaInfo.AppendLine(mf.Summary.Trim());
                    sbMediaInfo.AppendLine();

                    sbPublish.AppendLine(GetPublishString(sbMediaInfo.ToString(), pop));

                    if (Media.UploadScreenshots)
                    {
                        sbPublish.AppendLine(mf.GetScreenshotString(pop));
                    }
                }

                break;
            }

            return(sbPublish.ToString());
        }
Example #3
0
        public string GetScreenshotString(PublishOptionsPacket pop)
        {
            StringBuilder sbPublish = new StringBuilder();

            foreach (Screenshot ss in this.Thumbnailer.Screenshots)
            {
                if (!string.IsNullOrEmpty(ss.FullImageLink) && pop.FullPicture)
                {
                    sbPublish.AppendLine(BbCode.Img(ss.FullImageLink));
                }
                else if (!string.IsNullOrEmpty(ss.LinkedThumbnail))
                {
                    sbPublish.AppendLine(ss.LinkedThumbnail);
                }
                sbPublish.AppendLine();
            }

            return(sbPublish.ToString());
        }
Example #4
0
        public string GetMediaInfo(string p, PublishOptionsPacket options)
        {
            StringBuilder sbPublish = new StringBuilder();

            if (options.AlignCenter)
            {
                p = BbCode.AlignCenter(p);
            }

            if (options.PreformattedText)
            {
                sbPublish.AppendLine(BbCode.Pre(p));
            }
            else
            {
                sbPublish.AppendLine(p);
            }

            return(sbPublish.ToString());
        }
Example #5
0
        private static string BbFormat(string p, PublishOptions options)
        {
            StringBuilder sbPublish = new StringBuilder();

            if (options.AlignCenter)
            {
                p = BbCode.AlignCenter(p);
            }

            if (options.PreformattedText)
            {
                sbPublish.AppendLine(BbCode.Pre(p));
            }
            else
            {
                sbPublish.AppendLine(p);
            }

            return(sbPublish.ToString().Trim());
        }
Example #6
0
        /// <summary>
        /// Returns a Publish layout of Media Info that has Audio and Video
        /// </summary>
        /// <returns></returns>
        public string ToStringPublish(PublishOptionsPacket pop)
        {
            int fontSizeHeading3 = (int)(Program.Settings.PreText && Program.Settings.LargerPreText == true ?
                                         Program.Settings.FontSizeHeading3 + Program.Settings.FontSizeIncr :
                                         Program.Settings.FontSizeHeading3);

            int fontSizeBody = (int)(Program.Settings.PreText && Program.Settings.LargerPreText == true ?
                                     Program.Settings.FontSizeBody + Program.Settings.FontSizeIncr :
                                     Program.Settings.FontSizeBody);

            StringBuilder sbBody = new StringBuilder();

            //*********************
            //* General
            //*********************
            StringBuilder sbGeneral = new StringBuilder();

            sbBody.AppendLine(BbCode.Size(fontSizeHeading3, BbCode.BoldItalic("General:")));
            sbBody.AppendLine();

            // Format
            sbGeneral.Append(string.Format("            [u]Format:[/u] {0}", this.Format));
            if (!string.IsNullOrEmpty(this.FormatInfo))
            {
                sbGeneral.Append(string.Format(" ({0})", this.FormatInfo));
            }
            sbGeneral.Append(Environment.NewLine);

            // File Size
            sbGeneral.AppendLine(string.Format("         [u]File Size:[/u] {0}", this.FileSizeString));

            // Duration
            sbGeneral.AppendLine(string.Format("          [u]Duration:[/u] {0}", this.DurationString2));

            // Bitrate
            sbGeneral.AppendLine(string.Format("           [u]Bitrate:[/u] {0}", this.BitrateOverall));

            // Subtitles
            if (!string.IsNullOrEmpty(this.Subtitles))
            {
                sbGeneral.AppendLine(string.Format("         [u]Subtitles:[/u] {0}", this.Subtitles));
            }

            sbBody.AppendLine(BbCode.Size(fontSizeBody, sbGeneral.ToString()));

            if (this.Thumbnailer != null)
            {
                string ss = this.GetScreenshotString(pop);
                if (ss.Length > 0)
                {
                    sbBody.AppendLine(this.GetScreenshotString(pop));
                }
            }

            //*********************
            //* Video
            //*********************
            VideoInfo vi = this.Video;

            sbBody.AppendLine();
            sbBody.AppendLine(BbCode.Size(fontSizeHeading3, BbCode.BoldItalic("Video:")));
            sbBody.AppendLine();

            StringBuilder sbVideo = new StringBuilder();

            // Format
            sbVideo.Append(string.Format("              [u]Format:[/u] {0}", this.Video.Format));
            if (!string.IsNullOrEmpty(this.Video.FormatVersion))
            {
                sbVideo.Append(string.Format(" {0}", this.Video.FormatVersion));
            }
            sbVideo.Append(Environment.NewLine);

            // Codec
            if (!string.IsNullOrEmpty(vi.Codec))
            {
                sbVideo.AppendLine(string.Format("               [u]Codec:[/u] {0}", vi.Codec));
            }

            // Bitrate
            sbVideo.AppendLine(string.Format("             [u]Bitrate:[/u] {0}", this.Video.Bitrate));

            // Standard
            if (!string.IsNullOrEmpty(vi.Standard))
            {
                sbVideo.AppendLine(string.Format("            [u]Standard:[/u] {0}", this.Video.Standard));
            }

            // Frame Rate
            sbVideo.AppendLine(string.Format("          [u]Frame Rate:[/u] {0}", vi.FrameRate));

            // Scan Type
            sbVideo.AppendLine(string.Format("           [u]Scan Type:[/u] {0}", vi.ScanType));
            sbVideo.AppendLine(string.Format("  [u]Bits/(Pixel*Frame):[/u] {0}", vi.BitsPerPixelXFrame));
            sbVideo.AppendLine(string.Format("[u]Display Aspect Ratio:[/u] {0}", vi.DisplayAspectRatio));

            // Resolution
            sbVideo.AppendLine(string.Format("          [u]Resolution:[/u] {0}x{1}",
                                             vi.Width,
                                             vi.Height));

            sbBody.Append(BbCode.Size(fontSizeBody, sbVideo.ToString()));

            //*********************
            //* Audio
            //*********************

            int audioCount = this.Audio.Count;

            for (int a = 0; a < audioCount; a++)
            {
                AudioInfo ai = this.Audio[a];

                sbBody.AppendLine();
                sbBody.AppendLine(string.Format(BbCode.Size(fontSizeHeading3, BbCode.BoldItalic("Audio #{0}:")), a + 1));
                sbBody.AppendLine();

                StringBuilder sbAudio = new StringBuilder();

                // Format
                sbAudio.Append(string.Format("            [u]Format:[/u] {0}", ai.Format));
                if (!string.IsNullOrEmpty(ai.FormatVersion))
                {
                    sbAudio.Append(string.Format(" {0}", ai.FormatVersion));
                }
                if (!string.IsNullOrEmpty(ai.FormatProfile))
                {
                    sbAudio.Append(string.Format(" {0}", ai.FormatProfile));
                }
                sbAudio.Append(Environment.NewLine);

                // Codec
                if (!string.IsNullOrEmpty(ai.Codec))
                {
                    sbAudio.AppendLine(string.Format("             [u]Codec:[/u] {0}", ai.Codec));
                }

                // Bitrate
                sbAudio.AppendLine(string.Format("           [u]Bitrate:[/u] {0} ({1})", ai.Bitrate, ai.BitrateMode));

                // Channels
                sbAudio.AppendLine(string.Format("          [u]Channels:[/u] {0}", ai.Channels));

                // Sampling Rate
                sbAudio.AppendLine(string.Format("     [u]Sampling Rate:[/u] {0}", ai.SamplingRate));

                // Resolution
                if (!string.IsNullOrEmpty(ai.Resolution))
                {
                    sbAudio.AppendLine(string.Format(("        [u]Resolution:[/u] {0}"), ai.Resolution));
                }

                sbBody.Append(BbCode.Size(fontSizeBody, sbAudio.ToString()));
                sbBody.AppendLine();
            }

            return(sbBody.ToString());
        }
Example #7
0
        public string ToStringMedia(PublishOptionsPacket pop)
        {
            int fontSizeHeading1 = (int)(Program.Settings.PreText && Program.Settings.LargerPreText == true ?
                                         Program.Settings.FontSizeHeading1 + Program.Settings.FontSizeIncr :
                                         Program.Settings.FontSizeHeading1);

            int fontSizeHeading2 = (int)(Program.Settings.PreText && Program.Settings.LargerPreText == true ?
                                         Program.Settings.FontSizeHeading2 + Program.Settings.FontSizeIncr :
                                         Program.Settings.FontSizeHeading2);

            int fontSizeBody = (int)(Program.Settings.PreText && Program.Settings.LargerPreText == true ?
                                     Program.Settings.FontSizeBody + Program.Settings.FontSizeIncr :
                                     Program.Settings.FontSizeBody);

            StringBuilder sbBody = new StringBuilder();

            // Show Title
            if (Program.Settings.bTitle)
            {
                sbBody.AppendLine(BbCode.Size(fontSizeHeading1, BbCode.Bold(this.Title)));
                sbBody.AppendLine();
            }

            StringBuilder sbTitleInfo = new StringBuilder();

            // Source
            if (!string.IsNullOrEmpty(this.Source))
            {
                sbTitleInfo.AppendLine(string.Format("[u]Source:[/u] {0}", this.Source));
            }

            if (MediaTypeChoice == MediaType.MediaDisc)
            {
                // Authoring
                if (Program.Settings.bAuthoring && !string.IsNullOrEmpty(this.Authoring))
                {
                    sbTitleInfo.AppendLine(string.Format("[u]Authoring:[/u] {0}", this.Authoring));
                }
                if (Program.Settings.bDiscMenu && !string.IsNullOrEmpty(this.Menu))
                {
                    sbTitleInfo.AppendLine(string.Format("[u]Menu:[/u] {0}", this.Menu));
                }

                // Extras
                if (Program.Settings.bExtras && !string.IsNullOrEmpty(this.Extras))
                {
                    sbTitleInfo.AppendLine(string.Format("[u]Extras:[/u] {0}", this.Extras));
                }

                // WebLink
                if (Program.Settings.bWebLink && !string.IsNullOrEmpty(this.WebLink))
                {
                    sbTitleInfo.AppendLine(string.Format("[u]Web Link:[/u] {0}", this.WebLink));
                }
            }

            if (!string.IsNullOrEmpty(sbTitleInfo.ToString()))
            {
                sbBody.AppendLine(BbCode.Size(fontSizeBody, sbTitleInfo.ToString()));
                sbBody.AppendLine();
            }

            if (this.MediaFiles.Count > 1 && this.MediaTypeChoice == MediaType.MediaDisc)

            // is a DVD so need Overall Info only
            {
                sbBody.AppendLine(this.Overall.ToStringPublish(pop));
            }
            else
            {
                // If the loaded folder is not a Disc but individual ripped files or a collection of files
                if (MediaTypeChoice == MediaType.MediaCollection)
                {
                    sbBody.AppendLine(ToStringMediaList());
                }
                else
                {
                    foreach (MediaFile mf in this.MediaFiles)
                    {
                        sbBody.AppendLine(BbCode.Size(fontSizeHeading2, BbCode.BoldItalic(mf.FileName)));
                        sbBody.AppendLine();
                        sbBody.AppendLine(mf.ToStringPublish(pop));
                    }
                }
            }

            // CREATING XML TORRENT UPLOAD FILE DOES NOT REQUIRE SCREENSHOT IN RELEASE DESCRIPTION
            // THE SCREENSHOTS ARE IN THE XML INSTEAD
            if (this.HasScreenshots())
            {
                sbBody.AppendLine();
            }
            foreach (MediaFile mf in this.MediaFiles)
            {
                if (mf.Thumbnailer != null)
                {
                    sbBody.AppendLine(mf.GetScreenshotString(pop));
                }
            }

            return(sbBody.ToString());
        }