Skip to content

Commit

Permalink
Merge pull request #195 from DineshSolanki/192-support-for-nested-sub…
Browse files Browse the repository at this point in the history
…folder-such-as-moviesstarwars-collectionstar-wars-1

Feature - support for nested folders closes #192
  • Loading branch information
DineshSolanki authored Mar 21, 2024
2 parents 8723c60 + 02fc842 commit ab9545c
Show file tree
Hide file tree
Showing 13 changed files with 217 additions and 109 deletions.
3 changes: 1 addition & 2 deletions FoliCon/Models/Constants/GlobalVariables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ namespace FoliCon.Models.Constants;

internal static class GlobalVariables
{
public static bool SkipAll;


public static IconOverlay IconOverlayType()
{
return new PosterIconConfigViewModel().IconOverlay switch
Expand Down
4 changes: 4 additions & 0 deletions FoliCon/Modules/utils/FileUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public static List<string> GetFolderNames(string folderPath)
return folderNames;
}

public static string[] GetAllSubFolders(string folderPath)
{
return Directory.GetDirectories(folderPath);
}
/// <summary>
/// Get List of file in given folder.
/// </summary>
Expand Down
10 changes: 7 additions & 3 deletions FoliCon/Modules/utils/IconUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,13 @@ public static int MakeIco(string iconMode, string selectedFolder, List<PickedLis

foreach (var item in pickedListDataTable)
{
var parent = Directory.GetParent(item.Folder);
var parentFolder = parent != null
? parent.FullName
: selectedFolder;
var folderName = item.FolderName;
var targetFile = $@"{selectedFolder}\{folderName}\{ImageName}.ico";
var pngFilePath = $@"{selectedFolder}\{folderName}\{ImageName}.png";
var targetFile = $@"{parentFolder}\{folderName}\{ImageName}.ico";
var pngFilePath = $@"{parentFolder}\{folderName}\{ImageName}.png";
if (File.Exists(pngFilePath) && !File.Exists(targetFile))
{
var rating = item.Rating;
Expand All @@ -51,7 +55,7 @@ public static int MakeIco(string iconMode, string selectedFolder, List<PickedLis
}
if (!File.Exists(targetFile)) continue;
FileUtils.HideFile(targetFile);
FileUtils.SetFolderIcon($"{ImageName}.ico", $@"{selectedFolder}\{folderName}");
FileUtils.SetFolderIcon($"{ImageName}.ico", $@"{parentFolder}\{folderName}");
}

FileUtils.ApplyChanges(selectedFolder);
Expand Down
9 changes: 9 additions & 0 deletions FoliCon/Properties/Langs/Lang.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions FoliCon/Properties/Langs/Lang.ar.resx
Original file line number Diff line number Diff line change
Expand Up @@ -612,4 +612,7 @@
<data name="WebView2DownloadConfirmationHeader" xml:space="preserve">
<value>تثبيت بيئة تشغيل WebView2</value>
</data>
<data name="SkipThisPlaceholderParent" xml:space="preserve">
<value>تخطي هذا وكل العناوين المتبقية لـ {0}</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FoliCon/Properties/Langs/Lang.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -612,4 +612,7 @@ Esto ayuda a folicon a identificar los medios sin tener que elegir entre título
<data name="WebView2DownloadConfirmationHeader" xml:space="preserve">
<value>Instalar Runtime de WebView2</value>
</data>
<data name="SkipThisPlaceholderParent" xml:space="preserve">
<value>Omitir este y todos los títulos restantes de {0}</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FoliCon/Properties/Langs/Lang.hi.resx
Original file line number Diff line number Diff line change
Expand Up @@ -612,4 +612,7 @@
<data name="WebView2DownloadConfirmationHeader" xml:space="preserve">
<value>WebView2 Runtime इंस्टॉल करें</value>
</data>
<data name="SkipThisPlaceholderParent" xml:space="preserve">
<value>इसे और {0} के बाकी मीडिया को छोड़ दे</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FoliCon/Properties/Langs/Lang.pt.resx
Original file line number Diff line number Diff line change
Expand Up @@ -611,4 +611,7 @@ e renovar o cache dos Ícones?</value>
<data name="WebView2DownloadConfirmationHeader" xml:space="preserve">
<value>Instalar Runtime do WebView2</value>
</data>
<data name="SkipThisPlaceholderParent" xml:space="preserve">
<value>Ignorar este e todos os títulos restantes de {0}</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FoliCon/Properties/Langs/Lang.resx
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,7 @@ and refresh Icon Cache?</value>
<data name="WebView2DownloadConfirmationHeader" xml:space="preserve">
<value>Install WebView2 Runtime</value>
</data>
<data name="SkipThisPlaceholderParent" xml:space="preserve">
<value>Skip this and all remaining titles of {0}</value>
</data>
</root>
3 changes: 3 additions & 0 deletions FoliCon/Properties/Langs/Lang.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -615,4 +615,7 @@
<data name="WebView2DownloadConfirmationHeader" xml:space="preserve">
<value>Установить исполняющую среду WebView2</value>
</data>
<data name="SkipThisPlaceholderParent" xml:space="preserve">
<value>Пропустить этот и все оставшиеся заголовки {0}</value>
</data>
</root>
Loading

0 comments on commit ab9545c

Please sign in to comment.