Example #1
0
        private MediaCover.MediaCover MapImage(string path, MediaCoverTypes type)
        {
            if (path.IsNotNullOrWhiteSpace())
            {
                return(_configService.GetCoverForURL(path, type));
            }

            return(null);
        }
Example #2
0
        public string GetCoverPath(int entityId, MediaCoverEntity coverEntity, MediaCoverTypes coverTypes, string extension, int?height = null)
        {
            var heightSuffix = height.HasValue ? "-" + height.ToString() : "";

            if (coverEntity == MediaCoverEntity.Book)
            {
                return(Path.Combine(GetBookCoverPath(entityId), coverTypes.ToString().ToLower() + heightSuffix + extension));
            }
            else
            {
                return(Path.Combine(GetAuthorCoverPath(entityId), coverTypes.ToString().ToLower() + heightSuffix + extension));
            }
        }
Example #3
0
        private string GetMovieImageFilename(string movieFilePath, MediaCoverTypes imageCoverType)
        {
            var baseDestination = new StringBuilder();

            if (!Settings.UseMovieImages)
            {
                baseDestination.Append(Path.GetFileNameWithoutExtension(movieFilePath));
                baseDestination.Append('-');
            }

            baseDestination.Append($"{imageCoverType.ToString().ToLowerInvariant()}.jpg");

            return(baseDestination.ToString());
        }
Example #4
0
        private int[] GetDefaultHeights(MediaCoverTypes coverType)
        {
            switch (coverType)
            {
            default:
                return(new int[] { });

            case MediaCoverTypes.Poster:
            case MediaCoverTypes.Disc:
            case MediaCoverTypes.Cover:
            case MediaCoverTypes.Logo:
            case MediaCoverTypes.Headshot:
                return(new[] { 500, 250 });

            case MediaCoverTypes.Banner:
                return(new[] { 70, 35 });

            case MediaCoverTypes.Fanart:
            case MediaCoverTypes.Screenshot:
                return(new[] { 360, 180 });
            }
        }
Example #5
0
        public string GetCoverPath(int seriesId, MediaCoverTypes coverTypes, int?height = null)
        {
            var heightSuffix = height.HasValue ? "-" + height.ToString() : "";

            return(Path.Combine(GetSeriesCoverPath(seriesId), coverTypes.ToString().ToLower() + heightSuffix + ".jpg"));
        }
Example #6
0
 public MediaCover(MediaCoverTypes coverType, string url)
 {
     CoverType = coverType;
     Url = url;
 }
Example #7
0
 public string GetCoverPath(int seriesId, MediaCoverTypes coverTypes)
 {
     return(Path.Combine(GetSeriesCoverPath(seriesId), coverTypes.ToString().ToLower() + ".jpg"));
 }
Example #8
0
 public MediaCover(MediaCoverTypes coverType, string url)
 {
     CoverType = coverType;
     Url       = url;
 }