Commit 5436eb06 authored by Martin Finkel's avatar Martin Finkel
Browse files

Fix video cover image retrieval logic for moviedb results

parent 05e5a1dd
......@@ -192,10 +192,12 @@ namespace VLC.Model.Library
await DispatchHelper.InvokeInUIThreadHighPriority(() => videoVm.HasThumbnail = true);
else
{
// The thumbnail file does not exist, we must generate one.
await GenerateThumbnail(videoVm);
if (videoVm.Type == ".mkv")
await Locator.VideoMetaService.GetMoviePicture(videoVm);
var match = await Locator.VideoMetaService.GetMoviePicture(videoVm);
if (!match)
{
// The thumbnail file does not exist and MovieDb does not return a match, we must generate one.
await GenerateThumbnail(videoVm);
}
}
}
catch (Exception e)
......
......@@ -234,11 +234,17 @@ namespace VLC.Model.Video
private async Task<StorageFile> TryGetVideoThumbFile()
{
StorageFile ret = null;
StorageFolder subFolder = (StorageFolder)await ApplicationData.Current.LocalFolder.TryGetItemAsync("videoThumbs");
if (subFolder != null)
ret = (StorageFile)await subFolder.TryGetItemAsync($"{Id}.jpg");
return ret;
async Task<StorageFile> GetImage(string fdName)
{
var subFolder = (StorageFolder)await ApplicationData.Current.LocalFolder.TryGetItemAsync(fdName);
if (subFolder == null) return null;
var ret = (StorageFile)await subFolder.TryGetItemAsync($"{Id}.jpg");
return ret;
}
var file = await GetImage("moviePic") ?? await GetImage("videoThumbs");
return file;
}
[Ignore]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment