Skip to content

Commit

Permalink
Poster picker now loads faster. with thumb quality reduced.
Browse files Browse the repository at this point in the history
  • Loading branch information
DineshSolanki committed Aug 7, 2021
1 parent a04fd21 commit b36ef82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion FoliCon/Modules/TMDB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ public void ResultPicked(dynamic result, string resultType, string fullFolderPat

var folderName = Path.GetFileName(fullFolderPath);
var localPosterPath = fullFolderPath + @"\" + folderName + ".png";
string posterUrl = string.Concat(PosterBase, result.PosterPath);

string posterUrl = string.Concat(PosterBase, result.PosterPath.Replace("http://image.tmdb.org/t/p/w500",""));

if (resultType == MediaTypes.Tv)
{
Expand Down
6 changes: 4 additions & 2 deletions FoliCon/ViewModels/PosterPickerViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,11 @@ private async void LoadImages(ImagesWithId images)
Index = item.Index + 1;
if (image is not null)
{
var posterPath = image.FilePath != null ? TmdbObject.GetClient().GetImageUrl(PosterSize.W342, image.FilePath).ToString() : null;
var posterPath = image.FilePath != null ? TmdbObject.GetClient().GetImageUrl(PosterSize.W92, image.FilePath).ToString() : null;
var qualityPath = TmdbObject.GetClient().GetImageUrl(PosterSize.W500, image.FilePath)
.ToString(); //TODO: give user option to set quality of preview.
var bm = await Util.GetBitmapFromUrlAsync(posterPath);
ImageUrl.Add(new DArtImageList(posterPath, Util.LoadBitmap(bm)));
ImageUrl.Add(new DArtImageList(qualityPath, Util.LoadBitmap(bm)));
bm.Dispose();
}
if (_stopSearch)
Expand Down

0 comments on commit b36ef82

Please sign in to comment.