Skip to content

Commit da6b4bf

Browse files
committed
Some more clean up
1 parent e4326ed commit da6b4bf

File tree

4 files changed

+4
-42
lines changed

4 files changed

+4
-42
lines changed

src/Core/Api/ThemesController.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
using System;
88
using System.Collections.Generic;
99
using System.IO;
10-
using System.Linq;
1110
using System.Threading.Tasks;
1211

1312
namespace Core.Api
@@ -160,23 +159,12 @@ public IActionResult Delete(string id)
160159
List<ThemeItem> GetThemes()
161160
{
162161
var themes = new List<ThemeItem>();
163-
var combined = new List<string>();
162+
var themeList = _store.GetThemes();
164163

165-
var storageThemes = _store.GetThemes();
166-
167-
if (storageThemes != null)
168-
combined.AddRange(storageThemes);
169-
170-
if (AppConfig.EmbeddedThemes != null)
171-
combined.AddRange(AppConfig.EmbeddedThemes);
172-
173-
combined = combined.Distinct().ToList();
174-
combined.Sort();
175-
176-
if (combined != null && combined.Count > 0)
164+
if (themeList != null && themeList.Count > 0)
177165
{
178166
var current = new ThemeItem();
179-
foreach (var themeTitle in combined)
167+
foreach (var themeTitle in themeList)
180168
{
181169
var theme = themeTitle.ToLower();
182170
var slash = Path.DirectorySeparatorChar.ToString();

src/Core/AppConfig.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ namespace Core
88
{
99
public static class AppConfig
1010
{
11-
public static IList<string> EmbeddedThemes { get; set; }
12-
1311
public static IEnumerable<Assembly> GetAssemblies(bool includeApp = false)
1412
{
1513
var assemblies = new List<Assembly>();

src/Core/Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>netcoreapp2.2</TargetFramework>
5-
<Version>2.4.1.4</Version>
5+
<Version>2.4.1.5</Version>
66
</PropertyGroup>
77

88
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

src/Core/Extensions/ServiceCollectionExtensions.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -53,30 +53,6 @@ static void AddFileProviders(IServiceCollection services)
5353
foreach (var assembly in AppConfig.GetAssemblies(true))
5454
{
5555
var fileProvider = new EmbeddedFileProvider(assembly, assembly.GetName().Name);
56-
57-
// load themes from embedded provider
58-
var content = fileProvider.GetDirectoryContents("");
59-
if (content.Exists)
60-
{
61-
foreach (var item in content)
62-
{
63-
if (item.Name.StartsWith("Views.Themes"))
64-
{
65-
if (AppConfig.EmbeddedThemes == null)
66-
AppConfig.EmbeddedThemes = new List<string>();
67-
68-
var ar = item.Name.Split('.');
69-
if(ar.Length > 2 && !AppConfig.EmbeddedThemes.Contains(ar[2]))
70-
{
71-
if(assembly.GetName().Name.ToLower() != "app")
72-
{
73-
AppConfig.EmbeddedThemes.Add(ar[2]);
74-
}
75-
}
76-
}
77-
}
78-
}
79-
8056
options.FileProviders.Add(fileProvider);
8157
}
8258
});

0 commit comments

Comments
 (0)