public bool WithCover(Metadata metadata, Action <string> action) { string cachedCoverFilePath; if (PathFormatter.IsEnabled) { cachedCoverFilePath = PathFormatter.GetCover(metadata); } else { cachedCoverFilePath = string.Format(CultureInfo.InvariantCulture, "{0}{1}{2}", PathFormatter.GetCacheDirectory(), metadata.Id, metadata.Images.Cover.GetFileExtension()); } if (!File.Exists(cachedCoverFilePath)) { return(false); } if (action != null) { action.Invoke(cachedCoverFilePath); } return(true); }