Пример #1
0
        public static string ToPublishString(TaskSettings ts, PublishOptions pop)
        {
            string pt = "";

            switch (pop.PublishInfoTypeChoice)
            {
            case PublishInfoType.ExternalTemplate:
                if (Directory.Exists(pop.TemplateLocation))
                {
                    pt = TorrentInfo.ToStringPublishExternal(pop, new TemplateReader(pop.TemplateLocation, ts));
                }
                else if (Directory.Exists(ts.Media.TemplateLocation))
                {
                    pt = TorrentInfo.ToStringPublishExternal(pop, new TemplateReader(ts.Media.TemplateLocation, ts));
                }
                else
                {
                    pt = TorrentInfo.ToStringPublishInternal(ts);
                }
                break;

            case PublishInfoType.InternalTemplate:
                pt = TorrentInfo.ToStringPublishInternal(ts);
                break;

            case PublishInfoType.MediaInfo:
                pt = TorrentInfo.ToStringPublishMediaInfo(ts);
                break;
            }

            ts.Media.ReleaseDescription = Adapter.StripImg(pt).Trim();
            ;

            return(pt);
        }
Пример #2
0
        public static string CreatePublish(TorrentInfo ti, PublishOptionsPacket pop)
        {
            string pt = "";

            switch (pop.PublishInfoTypeChoice)
            {
            case PublishInfoType.ExternalTemplate:
                if (Directory.Exists(pop.TemplateLocation))
                {
                    pt = ti.CreatePublish(pop, new TemplateReader2(pop.TemplateLocation, ti));
                }
                else if (Directory.Exists(ti.Media.TemplateLocation))
                {
                    pt = ti.CreatePublish(pop, new TemplateReader2(ti.Media.TemplateLocation, ti));
                }
                else
                {
                    pt = ti.CreatePublishInternal(pop);
                }
                break;

            case PublishInfoType.InternalTemplate:
                pt = ti.CreatePublishInternal(pop);
                break;

            case PublishInfoType.MediaInfo:
                pt = ti.CreatePublishMediaInfo(pop);
                break;
            }

            ti.Media.ReleaseDescription = Adapter.StripImg(pt).Trim();;

            return(pt);
        }