diff options
author | Heonjae.Jang <Heonjae.Jang@samsung.com> | 2017-09-07 09:56:27 +0900 |
---|---|---|
committer | Heonjae Jang <heonjae.jang@samsung.com> | 2017-09-07 07:25:57 +0000 |
commit | 761668849185d74133a87ef9caebd90e1e0d473e (patch) | |
tree | 8b881afe559f0784bfad24a5198ac40e906067c1 | |
parent | f4366e392d9f7e56f80f44c68054b32d19634fc3 (diff) | |
download | mediahub-761668849185d74133a87ef9caebd90e1e0d473e.tar.gz mediahub-761668849185d74133a87ef9caebd90e1e0d473e.tar.bz2 mediahub-761668849185d74133a87ef9caebd90e1e0d473e.zip |
Fix Issue : [TNEXT-2868][TNEXT-2870] Thumbnails are not createdsubmit/tizen_4.0/20170907.102917submit/tizen/20170907.102945
Change-Id: I0e55143fbf3a0804742766787e6b2787d5b31785
Signed-off-by: Heonjae.Jang <Heonjae.Jang@samsung.com>
5 files changed, 16 insertions, 20 deletions
diff --git a/TVMediaHub/TVMediaHub.Tizen/Models/ContentProvider.cs b/TVMediaHub/TVMediaHub.Tizen/Models/ContentProvider.cs index 261ce93..fbba94a 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Models/ContentProvider.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Models/ContentProvider.cs @@ -202,7 +202,6 @@ namespace TVMediaHub.Tizen.Models private async Task<IEnumerable<GroupItem>> MakeGroupAsync(IEnumerable<MediaInformationEx> mediaInformationExList, SortOption sortOption) #pragma warning restore CS1998 // Async method lacks 'await' operators and will run synchronously { - DbgPort.D("MG Async"); List<GroupItem> result = new List<GroupItem>(); GroupItem lastGroupItem = null; GroupItem currentGroupItem = null; @@ -330,15 +329,15 @@ namespace TVMediaHub.Tizen.Models /// </summary> /// <param name="list">A list of media contents</param> /// <returns>A path of thumbnail</returns> - public async Task CheckThumbnail(IEnumerable<MediaShortcutInfo> list) + public async Task CheckThumbnail(IEnumerable<MediaInformationEx> list) { foreach (var info in list) { - if (info.Information.MediaContentInformation.ThumbnailPath == null) + if (string.IsNullOrEmpty(info.MediaContentInformation.ThumbnailPath)) { try { - string path = await MediaHubImpl.GetInstance.MediaInfoCommand.CreateThumbnailAsync(info.Information.MediaContentInformation.Id); + string path = await MediaHubImpl.GetInstance.MediaInfoCommand.CreateThumbnailAsync(info.MediaContentInformation.Id); } catch (Exception e) { diff --git a/TVMediaHub/TVMediaHub.Tizen/Models/VideoProvider.cs b/TVMediaHub/TVMediaHub.Tizen/Models/VideoProvider.cs index 0482852..0c3cd2b 100755 --- a/TVMediaHub/TVMediaHub.Tizen/Models/VideoProvider.cs +++ b/TVMediaHub/TVMediaHub.Tizen/Models/VideoProvider.cs @@ -66,7 +66,7 @@ namespace TVMediaHub.Tizen.Models public MediaInformationEx GetRecentlyPlayedVideo() { var selectArguments = new SelectArguments(); - selectArguments.SortOrder = "MEDIA_LAST_PLAYED_TIME"; + selectArguments.SortOrder = "MEDIA_LAST_PLAYED_TIME"; selectArguments.FilterExpression = GetConditionStringForSelection(); List<MediaInfo> mediaInformationList = new List<MediaInfo>(); diff --git a/TVMediaHub/TVMediaHub.Tizen/ViewModels/ImageTabViewModel.cs b/TVMediaHub/TVMediaHub.Tizen/ViewModels/ImageTabViewModel.cs index 749d0b2..dd7abf6 100755 --- a/TVMediaHub/TVMediaHub.Tizen/ViewModels/ImageTabViewModel.cs +++ b/TVMediaHub/TVMediaHub.Tizen/ViewModels/ImageTabViewModel.cs @@ -575,11 +575,11 @@ namespace TVMediaHub.Tizen.ViewModels private async void ReadImageList(SortOption option, string storageID = null) { ImageList.Clear(); + + IEnumerable<MediaInformationEx> list = await MediaHubImpl.GetInstance.ImageProviderInstance.ReadWithoutGroupAsync(SortOption.Title); + await MediaHubImpl.GetInstance.ImageProviderInstance.CheckThumbnail(list); + IEnumerable<GroupItem> tempList = await MediaHubImpl.GetInstance.ImageProviderInstance.ReadAsync(option, storageID); - foreach (var group in tempList) - { - await MediaHubImpl.GetInstance.ImageProviderInstance.CheckThumbnail(group.Contents); - } IsNeededClearList = true; diff --git a/TVMediaHub/TVMediaHub.Tizen/ViewModels/MusicTabViewModel.cs b/TVMediaHub/TVMediaHub.Tizen/ViewModels/MusicTabViewModel.cs index 851b044..a953a38 100755 --- a/TVMediaHub/TVMediaHub.Tizen/ViewModels/MusicTabViewModel.cs +++ b/TVMediaHub/TVMediaHub.Tizen/ViewModels/MusicTabViewModel.cs @@ -213,11 +213,10 @@ namespace TVMediaHub.Tizen.ViewModels private async void ReadMusicList(SortOption option, string storageID = null) { MusicList.Clear(); + IEnumerable<MediaInformationEx> list = await MediaHubImpl.GetInstance.MusicProviderInstance.ReadWithoutGroupAsync(SortOption.Title); + await MediaHubImpl.GetInstance.MusicProviderInstance.CheckThumbnail(list); + IEnumerable<GroupItem> templist = await MediaHubImpl.GetInstance.MusicProviderInstance.ReadAsync(option, storageID); - foreach (var group in templist) - { - await MediaHubImpl.GetInstance.MusicProviderInstance.CheckThumbnail(group.Contents); - } foreach (var group in templist) { diff --git a/TVMediaHub/TVMediaHub.Tizen/ViewModels/VideoTabViewModel.cs b/TVMediaHub/TVMediaHub.Tizen/ViewModels/VideoTabViewModel.cs index 126394b..dce44a8 100755 --- a/TVMediaHub/TVMediaHub.Tizen/ViewModels/VideoTabViewModel.cs +++ b/TVMediaHub/TVMediaHub.Tizen/ViewModels/VideoTabViewModel.cs @@ -26,6 +26,7 @@ using TVMediaHub.Tizen.Utils; using TVMediaHub.Tizen.DataModels; using Xamarin.Forms; using Tizen.Xamarin.Forms.Extension; +using System.Threading.Tasks; namespace TVMediaHub.Tizen.ViewModels { @@ -222,7 +223,6 @@ namespace TVMediaHub.Tizen.ViewModels /// </summary> public VideoTabViewModel() { - DbgPort.D("Binding Context cotr " + DateTime.Now); VideoList = new ObservableCollection<GroupItem>(); SelectedList = new List<MediaInformationEx>(); PlayList = new List<MediaInformationEx>(); @@ -450,18 +450,16 @@ namespace TVMediaHub.Tizen.ViewModels { VideoList.Clear(); + IEnumerable<MediaInformationEx> list = await MediaHubImpl.GetInstance.VideoProviderInstance.ReadWithoutGroupAsync(SortOption.Title); + await MediaHubImpl.GetInstance.VideoProviderInstance.CheckThumbnail(list); + IEnumerable<GroupItem> tempList = await MediaHubImpl.GetInstance.VideoProviderInstance.ReadAsync(option, storageId); - foreach (var group in tempList) - { - await MediaHubImpl.GetInstance.VideoProviderInstance.CheckThumbnail(group.Contents); - } IsNeededClearList = true; foreach (var group in tempList) { - //await Task.Delay(1); - VideoList.Add(group); + VideoList.Add(group); } IsNeededClearList = false; |