Ejemplo n.º 1
0
        /// <summary>
        /// Gets a <see cref="FanArtPathCollection"/> containing all matching person fanart paths in the specified <see cref="ResourcePath"/>.
        /// </summary>
        /// <param name="potentialFanArtFiles">Enumeration of potential fanart paths..</param>
        /// <param name="personName">Name of the person to find fanart for..</param>
        /// <returns><see cref="FanArtPathCollection"/> containing all matching paths.</returns>
        protected FanArtPathCollection GetPersonFolderImages(IEnumerable <ResourcePath> potentialFanArtFiles, string personName)
        {
            FanArtPathCollection paths = new FanArtPathCollection();

            paths.AddRange(FanArtTypes.Thumbnail, LocalFanartHelper.FilterPotentialFanArtFilesByPrefix(potentialFanArtFiles, personName.Replace(" ", "_").ToLowerInvariant()));
            return(paths);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Populates the <paramref name="paths"/> with all matching image paths in <paramref name="potentialFanArtFiles"/>
        /// including only image paths that start with the specified <paramref name="prefix"/>.
        /// </summary>
        /// <param name="potentialFanArtFiles"><see cref="ResourcePath"/> collection containing potential fanart paths.</param>
        /// <param name="paths"><see cref="FanArtPathCollection"/> to populate</param>
        /// <param name="prefix">The filename prefix of the media item.</param>
        protected void ExtractAllFanArtImagesByPrefix(ICollection <ResourcePath> potentialFanArtFiles, FanArtPathCollection paths, string prefix)
        {
            if (potentialFanArtFiles == null && potentialFanArtFiles.Count == 0)
            {
                return;
            }

            prefix = prefix.ToLowerInvariant();

            paths.AddRange(FanArtTypes.Thumbnail, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                             null, LocalFanartHelper.THUMB_FILENAMES.Select(f => prefix + "-" + f)));

            paths.AddRange(FanArtTypes.Poster, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                          null, LocalFanartHelper.POSTER_FILENAMES.Select(f => prefix + "-" + f)));

            paths.AddRange(FanArtTypes.Logo, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                        null, LocalFanartHelper.LOGO_FILENAMES.Select(f => prefix + "-" + f)));

            paths.AddRange(FanArtTypes.ClearArt, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                            null, LocalFanartHelper.CLEARART_FILENAMES.Select(f => prefix + "-" + f)));

            paths.AddRange(FanArtTypes.DiscArt, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                           null, LocalFanartHelper.DISCART_FILENAMES.Select(f => prefix + "-" + f)));

            paths.AddRange(FanArtTypes.Banner, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                          null, LocalFanartHelper.BANNER_FILENAMES.Select(f => prefix + "-" + f)));

            paths.AddRange(FanArtTypes.FanArt, LocalFanartHelper.FilterPotentialFanArtFilesByNameOrPrefix(potentialFanArtFiles,
                                                                                                          null, LocalFanartHelper.BACKDROP_FILENAMES.Select(f => prefix + "-" + f)));
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Populates the <paramref name="paths"/> with all matching image paths in <paramref name="potentialFanArtFiles"/>.
 /// </summary>
 /// <param name="potentialFanArtFiles"><see cref="ResourcePath"/> collection containing potential fanart paths.</param>
 /// <param name="paths"><see cref="FanArtPathCollection"/> to populate</param>
 protected void ExtractAllFanArtImages(ICollection <ResourcePath> potentialFanArtFiles, FanArtPathCollection paths)
 {
     if (potentialFanArtFiles == null && potentialFanArtFiles.Count == 0)
     {
         return;
     }
     paths.AddRange(FanArtTypes.Thumbnail, LocalFanartHelper.FilterPotentialFanArtFilesByName(potentialFanArtFiles, LocalFanartHelper.THUMB_FILENAMES));
     paths.AddRange(FanArtTypes.Poster, LocalFanartHelper.FilterPotentialFanArtFilesByName(potentialFanArtFiles, LocalFanartHelper.POSTER_FILENAMES));
     paths.AddRange(FanArtTypes.Logo, LocalFanartHelper.FilterPotentialFanArtFilesByName(potentialFanArtFiles, LocalFanartHelper.LOGO_FILENAMES));
     paths.AddRange(FanArtTypes.ClearArt, LocalFanartHelper.FilterPotentialFanArtFilesByName(potentialFanArtFiles, LocalFanartHelper.CLEARART_FILENAMES));
     paths.AddRange(FanArtTypes.DiscArt, LocalFanartHelper.FilterPotentialFanArtFilesByName(potentialFanArtFiles, LocalFanartHelper.DISCART_FILENAMES));
     paths.AddRange(FanArtTypes.Banner, LocalFanartHelper.FilterPotentialFanArtFilesByName(potentialFanArtFiles, LocalFanartHelper.BANNER_FILENAMES));
     paths.AddRange(FanArtTypes.FanArt, LocalFanartHelper.FilterPotentialFanArtFilesByPrefix(potentialFanArtFiles, LocalFanartHelper.BACKDROP_FILENAMES));
 }