当前位置: 首页>>代码示例>>C#>>正文


C# Title.AddFanArtImage方法代码示例

本文整理汇总了C#中Title.AddFanArtImage方法的典型用法代码示例。如果您正苦于以下问题:C# Title.AddFanArtImage方法的具体用法?C# Title.AddFanArtImage怎么用?C# Title.AddFanArtImage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Title的用法示例。


在下文中一共展示了Title.AddFanArtImage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DownloadBackDropsForTitle

 public void DownloadBackDropsForTitle(Title t, IList<string> urls)
 {
     foreach (string url in urls)
     {
         WebClient web = new WebClient();
         string filename = Path.Combine(FileSystemWalker.ImageDownloadDirectory, Guid.NewGuid().ToString());
         try
         {
             web.DownloadFile(url, filename);
             t.AddFanArtImage(filename);
         }
         catch (Exception e)
         {
             OMLApplication.DebugLine("[TheMovieDbBackDropDownloader] Error downloading backdrop file {0}: {1}",
                 url, e.Message);
         }
     }
 }
开发者ID:peeboo,项目名称:open-media-library,代码行数:18,代码来源:TheMovieDbBackDropDownloader.cs

示例2: ConvertOMLSDKTitleToTitle


//.........这里部分代码省略.........
                    foreach (string genre in omlsdktitle.Genres)
                    {
                        _title.AddGenre(genre);
                    }
                }
                #endregion

                #region Actring Roles
                if (omlsdktitle.ActingRoles != null)
                {
                    foreach (OMLSDKRole role in omlsdktitle.ActingRoles)
                    {
                        _title.AddActingRole(role.PersonName, role.RoleName);
                    }
                }
                #endregion

                #region Non Acting Roles
                if (omlsdktitle.NonActingRoles != null)
                {
                    foreach (OMLSDKRole role in omlsdktitle.NonActingRoles)
                    {
                        _title.AddNonActingRole(role.PersonName, role.RoleName);
                    }
                }
                #endregion

                #region Directors
                if (omlsdktitle.Directors != null)
                {
                    foreach (OMLSDKPerson person in omlsdktitle.Directors)
                    {
                        _title.AddDirector(ConvertOMLSDKPersonToPerson(person));
                    }
                }
                #endregion

                #region Writers
                if (omlsdktitle.Writers != null)
                {
                    foreach (OMLSDKPerson person in omlsdktitle.Writers)
                    {
                        _title.AddWriter(ConvertOMLSDKPersonToPerson(person));
                    }
                }
                #endregion

                #region Producers
                if (omlsdktitle.Producers != null)
                {
                    foreach (OMLSDKPerson person in omlsdktitle.Producers)
                    {
                        _title.AddProducer(ConvertOMLSDKPersonToPerson(person));
                    }
                }
                #endregion

                #region Tags
                if (omlsdktitle.Tags != null)
                {
                    foreach (string tag in omlsdktitle.Tags)
                    {
                        _title.AddTag(tag);
                    }
                }
                #endregion

                #region Audio Tracks
                if (omlsdktitle.AudioTracks != null)
                {
                    foreach (string track in omlsdktitle.AudioTracks)
                    {
                        _title.AddAudioTrack(track);
                    }
                }
                #endregion

                #region Subtitles
                if (omlsdktitle.Subtitles != null)
                {
                    foreach (string subtitles in omlsdktitle.Subtitles)
                    {
                        _title.AddSubtitle(subtitles);
                    }
                }
                #endregion

                #region Fanart Paths
                if (omlsdktitle.FanArtPaths != null)
                {
                    foreach (string path in omlsdktitle.FanArtPaths)
                    {
                        _title.AddFanArtImage(path);
                    }
                }
                #endregion
            }

            return _title;
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:101,代码来源:SDKUtilities.cs

示例3: CheckDiskPathForImages

        private void CheckDiskPathForImages(Title title, Disk disk)
        {
            if ((disk == null) || (string.IsNullOrEmpty(disk.Path))) return;

            string diskFolder = disk.GetDiskFolder;
            string diskPathWithExtension = null;
            string diskPathWithoutExtension = null;

            if (!string.IsNullOrEmpty(disk.GetDiskFile))
            {
                diskPathWithExtension = disk.Path;
                diskPathWithoutExtension = disk.GetDiskFolder + "\\" + Path.GetFileNameWithoutExtension(disk.GetDiskFile);
            }

            string image = null;

            // If the Disk is a media file, look for an image in the disk
            // folder with the same name as the media file.
            if (!string.IsNullOrEmpty(diskPathWithExtension))
            {
                if (File.Exists(diskPathWithExtension + ".jpg"))
                {
                    image = diskPathWithExtension + ".jpg";
                }
                else if (File.Exists(diskPathWithExtension + ".png"))
                {
                    image = diskPathWithExtension + ".png";
                }
                else if (File.Exists(diskPathWithoutExtension + ".jpg"))
                {
                    image = diskPathWithoutExtension + ".jpg";
                }
                else if (File.Exists(diskPathWithoutExtension + ".png"))
                {
                    image = diskPathWithoutExtension + ".png";
                }
            }

            // Look for a generic folder.xxx image
            if (string.IsNullOrEmpty(image))
            {
                if (File.Exists(Path.Combine(diskFolder, "folder.jpg")))
                {
                    image = Path.Combine(diskFolder, "folder.jpg");
                }
                else if (File.Exists(Path.Combine(diskFolder, "folder.png")))
                {
                    image = Path.Combine(diskFolder, "folder.png");
                }
            }

            // Look for any jpg image
            if (string.IsNullOrEmpty(image))
            {
                string[] imagefiles = Directory.GetFiles(diskFolder, "*.jpg");
                if (imagefiles.Count() > 0)
                {
                    image = imagefiles[0];
                }
            }

            // Look for any jpg image
            if (string.IsNullOrEmpty(image))
            {
                string[] imagefiles = Directory.GetFiles(diskFolder, "*.png");
                if (imagefiles.Count() > 0)
                {
                    image = imagefiles[0];
                }
            }

            if (!string.IsNullOrEmpty(image))
            {
                title.FrontCoverPath = image;
            }

            // Check for fanart
            string fanartfolder = Path.Combine(diskFolder, "Fanart");
            if (Directory.Exists(fanartfolder))
            {
                foreach (string imagefile in Directory.GetFiles(fanartfolder))
                {
                    string extension = Path.GetExtension(imagefile);
                    if (!string.IsNullOrEmpty(extension))
                    {
                        if ((string.Compare(extension, ".jpg", true) == 0) ||
                            (string.Compare(extension, ".png", true) == 0) ||
                            (string.Compare(extension, ".bmp", true) == 0))
                        {
                            title.AddFanArtImage(imagefile);
                        }
                    }
                }
            }
        }
开发者ID:peeboo,项目名称:open-media-library,代码行数:95,代码来源:StSanaServices.cs


注:本文中的Title.AddFanArtImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。