aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.WebDashboard
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-22 14:28:24 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2016-08-22 14:28:24 -0400
commit430b187ef6b7d550e9ade89dd0254c5d1448a77a (patch)
tree08a84e332db5b2f76942ee1392fde2a312317e26 /MediaBrowser.WebDashboard
parent9f7dbec0db461fe416d825b483d475f476c9d42d (diff)
start a dashboard folder
Diffstat (limited to 'MediaBrowser.WebDashboard')
-rw-r--r--MediaBrowser.WebDashboard/Api/DashboardService.cs62
-rw-r--r--MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj34
2 files changed, 58 insertions, 38 deletions
diff --git a/MediaBrowser.WebDashboard/Api/DashboardService.cs b/MediaBrowser.WebDashboard/Api/DashboardService.cs
index 12e1eb5eaf..aec4632ae8 100644
--- a/MediaBrowser.WebDashboard/Api/DashboardService.cs
+++ b/MediaBrowser.WebDashboard/Api/DashboardService.cs
@@ -157,11 +157,21 @@ namespace MediaBrowser.WebDashboard.Api
var creator = GetPackageCreator();
var directory = creator.DashboardUIPath;
- var skipExtensions = GetUndeployedExtensions();
+ var skipExtensions = GetDeployIgnoreExtensions();
+ var skipNames = GetDeployIgnoreFilenames();
return
Directory.GetFiles(directory, "*", SearchOption.AllDirectories)
.Where(i => !skipExtensions.Contains(Path.GetExtension(i) ?? string.Empty, StringComparer.OrdinalIgnoreCase))
+ .Where(i => !skipNames.Any(s =>
+ {
+ if (s.Item2)
+ {
+ return string.Equals(s.Item1, Path.GetFileName(i), StringComparison.OrdinalIgnoreCase);
+ }
+
+ return (Path.GetFileName(i) ?? string.Empty).IndexOf(s.Item1, StringComparison.OrdinalIgnoreCase) != -1;
+ }))
.Select(i => i.Replace(directory, string.Empty, StringComparison.OrdinalIgnoreCase).Replace("\\", "/").TrimStart('/') + "?v=" + _appHost.ApplicationVersion.ToString())
.ToList();
}
@@ -300,7 +310,7 @@ namespace MediaBrowser.WebDashboard.Api
return new PackageCreator(_fileSystem, _localization, Logger, _serverConfigurationManager, _jsonSerializer);
}
- private List<string> GetUndeployedExtensions()
+ private List<string> GetDeployIgnoreExtensions()
{
var list = new List<string>();
@@ -315,6 +325,28 @@ namespace MediaBrowser.WebDashboard.Api
return list;
}
+ private List<Tuple<string,bool>> GetDeployIgnoreFilenames()
+ {
+ var list = new List<Tuple<string, bool>>();
+
+ list.Add(new Tuple<string, bool>("copying", true));
+ list.Add(new Tuple<string, bool>("license", true));
+ list.Add(new Tuple<string, bool>("license-mit", true));
+ list.Add(new Tuple<string, bool>("gitignore", false));
+ list.Add(new Tuple<string, bool>("npmignore", false));
+ list.Add(new Tuple<string, bool>("jshintrc", false));
+ list.Add(new Tuple<string, bool>("gruntfile", false));
+ list.Add(new Tuple<string, bool>("bowerrc", false));
+ list.Add(new Tuple<string, bool>("jscsrc", false));
+ list.Add(new Tuple<string, bool>("hero.svg", false));
+ list.Add(new Tuple<string, bool>("travis.yml", false));
+ list.Add(new Tuple<string, bool>("build.js", false));
+ list.Add(new Tuple<string, bool>("editorconfig", false));
+ list.Add(new Tuple<string, bool>("gitattributes", false));
+
+ return list;
+ }
+
public async Task<object> Get(GetDashboardPackage request)
{
var path = Path.Combine(_serverConfigurationManager.ApplicationPaths.ProgramDataPath,
@@ -344,30 +376,12 @@ namespace MediaBrowser.WebDashboard.Api
// Try to trim the output size a bit
var bowerPath = Path.Combine(path, "bower_components");
- if (!string.Equals(mode, "cordova", StringComparison.OrdinalIgnoreCase))
- {
- //var versionedBowerPath = Path.Combine(Path.GetDirectoryName(bowerPath), "bower_components" + _appHost.ApplicationVersion);
- //Directory.Move(bowerPath, versionedBowerPath);
- //bowerPath = versionedBowerPath;
- }
-
- GetUndeployedExtensions().ForEach(i => DeleteFilesByExtension(bowerPath, i));
+ GetDeployIgnoreExtensions().ForEach(i => DeleteFilesByExtension(bowerPath, i));
DeleteFilesByExtension(bowerPath, ".json", "strings\\");
- DeleteFilesByName(bowerPath, "copying", true);
- DeleteFilesByName(bowerPath, "license", true);
- DeleteFilesByName(bowerPath, "license-mit", true);
- DeleteFilesByName(bowerPath, "gitignore");
- DeleteFilesByName(bowerPath, "npmignore");
- DeleteFilesByName(bowerPath, "jshintrc");
- DeleteFilesByName(bowerPath, "gruntfile");
- DeleteFilesByName(bowerPath, "bowerrc");
- DeleteFilesByName(bowerPath, "jscsrc");
- DeleteFilesByName(bowerPath, "hero.svg");
- DeleteFilesByName(bowerPath, "travis.yml");
- DeleteFilesByName(bowerPath, "build.js");
- DeleteFilesByName(bowerPath, "editorconfig");
- DeleteFilesByName(bowerPath, "gitattributes");
+
+ GetDeployIgnoreFilenames().ForEach(i => DeleteFilesByName(bowerPath, i.Item1, i.Item2));
+
DeleteFoldersByName(bowerPath, "demo");
DeleteFoldersByName(bowerPath, "test");
DeleteFoldersByName(bowerPath, "guides");
diff --git a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
index 54dd52fb7a..b2eb34526c 100644
--- a/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
+++ b/MediaBrowser.WebDashboard/MediaBrowser.WebDashboard.csproj
@@ -101,6 +101,9 @@
<Content Include="dashboard-ui\autoorganizesmart.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\camerauploadsettings.html">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\components\appfooter\appfooter.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -185,6 +188,9 @@
<Content Include="dashboard-ui\css\images\throbber.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
+ <Content Include="dashboard-ui\scripts\camerauploadsettings.js">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
<Content Include="dashboard-ui\scripts\userpasswordpage.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
@@ -326,7 +332,7 @@
<Content Include="dashboard-ui\scripts\homeupcoming.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\librarydisplay.js">
+ <Content Include="dashboard-ui\dashboard\librarydisplay.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\livetvguideprovider.js">
@@ -338,7 +344,7 @@
<Content Include="dashboard-ui\scripts\livetvtunerprovider-m3u.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\livetvtunerprovider-satip.js">
+ <Content Include="dashboard-ui\dashboard\livetvtunerprovider-satip.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\localsync.js">
@@ -356,7 +362,7 @@
<Content Include="dashboard-ui\scripts\mysyncsettings.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\autoorganizesmart.js">
+ <Content Include="dashboard-ui\dashboard\autoorganizesmart.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\searchpage.js">
@@ -377,7 +383,7 @@
<Content Include="dashboard-ui\scripts\tvlatest.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\wizardcomponents.js">
+ <Content Include="dashboard-ui\dashboard\wizardcomponents.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\wizardcontroller.js">
@@ -503,7 +509,7 @@
<Content Include="dashboard-ui\photos.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\dashboardhosting.js">
+ <Content Include="dashboard-ui\dashboard\dashboardhosting.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\forgotpassword.js">
@@ -863,13 +869,13 @@
<Content Include="dashboard-ui\scripts\chromecast.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\cinemamodeconfiguration.js">
+ <Content Include="dashboard-ui\dashboard\cinemamodeconfiguration.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\connectlogin.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\dashboardgeneral.js">
+ <Content Include="dashboard-ui\dashboard\dashboardgeneral.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\syncactivity.js">
@@ -881,7 +887,7 @@
<Content Include="dashboard-ui\scripts\devices.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\devicesupload.js">
+ <Content Include="dashboard-ui\dashboard\devicesupload.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\dlnaprofile.js">
@@ -896,10 +902,10 @@
<Content Include="dashboard-ui\scripts\encodingsettings.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\autoorganizetv.js">
+ <Content Include="dashboard-ui\dashboard\autoorganizetv.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\autoorganizelog.js">
+ <Content Include="dashboard-ui\dashboard\autoorganizelog.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\externalplayer.js">
@@ -1089,7 +1095,7 @@
<Content Include="dashboard-ui\scripts\edititemmetadata.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\librarysettings.js">
+ <Content Include="dashboard-ui\dashboard\librarysettings.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\scripts\musicrecommended.js">
@@ -1356,7 +1362,7 @@
</Content>
</ItemGroup>
<ItemGroup>
- <Content Include="dashboard-ui\scripts\logpage.js">
+ <Content Include="dashboard-ui\dashboard\logpage.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
@@ -1429,7 +1435,7 @@
</Content>
</ItemGroup>
<ItemGroup>
- <Content Include="dashboard-ui\scripts\aboutpage.js">
+ <Content Include="dashboard-ui\dashboard\aboutpage.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\supporter\supporterflag.png">
@@ -1441,7 +1447,7 @@
<Content Include="dashboard-ui\itemlist.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
- <Content Include="dashboard-ui\scripts\wizardfinishpage.js">
+ <Content Include="dashboard-ui\dashboard\wizardfinishpage.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="dashboard-ui\css\images\items\detail\video.png">