update menus

This commit is contained in:
Luke Pulverenti 2015-06-21 17:31:21 -04:00
parent 8bb10cb12f
commit 95ac98d5d4
4 changed files with 9 additions and 40 deletions

View File

@ -150,6 +150,11 @@ namespace MediaBrowser.Providers.Manager
public Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken) public Task SaveImage(IHasImages item, string source, string mimeType, ImageType type, int? imageIndex, string internalCacheKey, CancellationToken cancellationToken)
{ {
if (string.IsNullOrWhiteSpace(source))
{
throw new ArgumentNullException("source");
}
var fileStream = _fileSystem.GetFileStream(source, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true); var fileStream = _fileSystem.GetFileStream(source, FileMode.Open, FileAccess.Read, FileShare.ReadWrite, true);
return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger).SaveImage(item, fileStream, mimeType, type, imageIndex, internalCacheKey, cancellationToken); return new ImageSaver(ConfigurationManager, _libraryMonitor, _fileSystem, _logger).SaveImage(item, fileStream, mimeType, type, imageIndex, internalCacheKey, cancellationToken);

View File

@ -27,7 +27,7 @@ namespace MediaBrowser.Server.Startup.Common.EntryPoints
_timer = new Timer(obj => _timer = new Timer(obj =>
{ {
var now = DateTime.UtcNow; var now = DateTime.UtcNow;
if (_sessionManager.Sessions.Any(i => (now - i.LastActivityDate).TotalMinutes < 5)) if (_sessionManager.Sessions.Any(i => (now - i.LastActivityDate).TotalMinutes < 15))
{ {
KeepAlive(); KeepAlive();
} }

View File

@ -1,38 +0,0 @@
using MediaBrowser.Controller.Plugins;
using System;
using System.Threading;
namespace MediaBrowser.ServerApplication.EntryPoints
{
public class ResourceEntryPoint : IServerEntryPoint
{
private Timer _timer;
public void Run()
{
_timer = new Timer(TimerCallback, null, TimeSpan.FromMinutes(1), TimeSpan.FromMinutes(30));
}
private void TimerCallback(object state)
{
try
{
// Bad practice, i know. But we keep a lot in memory, unfortunately.
GC.Collect(2, GCCollectionMode.Forced, true);
GC.Collect(2, GCCollectionMode.Forced, true);
}
catch
{
}
}
public void Dispose()
{
if (_timer != null)
{
_timer.Dispose();
_timer = null;
}
}
}
}

View File

@ -260,7 +260,9 @@ namespace MediaBrowser.WebDashboard.Api
html = _localization.LocalizeDocument(html, localizationCulture, GetLocalizationToken); html = _localization.LocalizeDocument(html, localizationCulture, GetLocalizationToken);
html = html.Replace("<html>", "<html lang=\"" + lang + "\">").Replace("<body>", "<body><div class=\"pageContainer\">").Replace("</body>", "</div></body>"); html = html.Replace("<html>", "<html lang=\"" + lang + "\">")
.Replace("<body>", "<body><paper-drawer-panel class=\"mainDrawerPanel mainDrawerPanelPreInit\" forceNarrow><div class=\"mainDrawer\" drawer></div><div main><div class=\"pageContainer\">")
.Replace("</body>", "</div></div></body>");
} }
if (enableMinification) if (enableMinification)