Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - support for nested folders #195

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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