private MediaCover.MediaCover MapImage(string path, MediaCoverTypes type) { if (path.IsNotNullOrWhiteSpace()) { return(_configService.GetCoverForURL(path, type)); } return(null); }
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)); } }
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()); }
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 }); } }
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")); }
public MediaCover(MediaCoverTypes coverType, string url) { CoverType = coverType; Url = url; }
public string GetCoverPath(int seriesId, MediaCoverTypes coverTypes) { return(Path.Combine(GetSeriesCoverPath(seriesId), coverTypes.ToString().ToLower() + ".jpg")); }