diff --git a/FoliCon/Modules/Util.cs b/FoliCon/Modules/Util.cs index 7188b756..247c4a18 100644 --- a/FoliCon/Modules/Util.cs +++ b/FoliCon/Modules/Util.cs @@ -412,7 +412,7 @@ public static int MakeIco(string iconMode, string selectedFolder, DataTable pick } if (!File.Exists(targetFile)) continue; - HideIcons(targetFile); + HideFile(targetFile); SetFolderIcon($"{i}.ico", $@"{selectedFolder}\{i}"); } ApplyChanges(selectedFolder); @@ -469,15 +469,15 @@ public static void BuildFolderIco(string iconMode, string filmFolderPath, string icon.Dispose(); } - public static void HideIcons(string icoFile) + public static void HideFile(string icoFile) { - // Set icon file attribute to "Hidden" + // Set file attribute to "Hidden" if ((File.GetAttributes(icoFile) & FileAttributes.Hidden) != FileAttributes.Hidden) { File.SetAttributes(icoFile, File.GetAttributes(icoFile) | FileAttributes.Hidden); } - // Set icon file attribute to "System" + // Set file attribute to "System" if ((File.GetAttributes(icoFile) & FileAttributes.System) != FileAttributes.System) { File.SetAttributes(icoFile, File.GetAttributes(icoFile) | FileAttributes.System); @@ -581,6 +581,7 @@ public static void SaveMediaInfo(int id, string mediaType, string folderPath) var filePath = $@"{folderPath}\folicon.folicon"; InIHelper.AddValue("ID", id.ToString(),null,filePath); InIHelper.AddValue("MediaType", mediaType,null,filePath); + Util.HideFile(filePath); } public static (string ID, string MediaType) ReadMediaInfo(string folderPath) diff --git a/FoliCon/ViewModels/CustomIconControlViewModel.cs b/FoliCon/ViewModels/CustomIconControlViewModel.cs index 954e9ac2..fccb593f 100644 --- a/FoliCon/ViewModels/CustomIconControlViewModel.cs +++ b/FoliCon/ViewModels/CustomIconControlViewModel.cs @@ -261,7 +261,7 @@ private int MakeIcons() File.Move(iconPath, newIconPath); if (!File.Exists(newIconPath)) continue; - Util.HideIcons(newIconPath); + Util.HideFile(newIconPath); Util.SetFolderIcon($"{Directories[i]}.ico", folderPath); Index++; if (StopSearch) diff --git a/FoliCon/ViewModels/SearchResultViewModel.cs b/FoliCon/ViewModels/SearchResultViewModel.cs index ff510372..52469b3a 100644 --- a/FoliCon/ViewModels/SearchResultViewModel.cs +++ b/FoliCon/ViewModels/SearchResultViewModel.cs @@ -246,8 +246,8 @@ private void PickMethod() } else { - _tmdbObject.ResultPicked(SearchResult.Result.Results[pickedIndex], SearchResult.MediaType, - _fullFolderPath, rating); + _tmdbObject.ResultPicked(SearchResult.Result, SearchResult.MediaType, + _fullFolderPath, rating,_isPickedById); } } else if (SearchMode == MediaTypes.Game) @@ -262,10 +262,9 @@ private void PickMethod() } catch (Exception ex) { - if (ex.Message == "NoPoster") - { - MessageBox.Show(CustomMessageBox.Warning(LangProvider.GetLang("NoPosterFound"), SearchTitle)); - } + MessageBox.Show(ex.Message == "NoPoster" + ? CustomMessageBox.Warning(LangProvider.GetLang("NoPosterFound"), SearchTitle) + : CustomMessageBox.Error(ex.Message, SearchTitle)); } CloseDialog("true"); @@ -281,12 +280,13 @@ private void MouseDoubleClick() var pickedIndex = ResultListViewData.Data.IndexOf(ResultListViewData.SelectedItem); try { - if (_isPickedById) + if (_isPickedById && SearchResult.MediaType != MediaTypes.Game) { + _dialogService.ShowPosterPicker(_tmdbObject, SearchResult, pickedIndex, ResultListViewData.Data, _isPickedById, r => { }); } - else if (SearchMode != MediaTypes.Game) + else if (SearchResult.MediaType != MediaTypes.Game) { _dialogService.ShowPosterPicker(_tmdbObject, SearchResult, pickedIndex, ResultListViewData.Data, _isPickedById, r => { });