fix recording button

This commit is contained in:
Luke Pulverenti 2015-06-23 18:13:06 -04:00
parent 72752fc559
commit f511cb70ad
5 changed files with 13 additions and 71 deletions

View File

@ -118,6 +118,11 @@ namespace MediaBrowser.Controller.LiveTv
return System.IO.Path.Combine(basePath, "livetv", Id.ToString("N"));
}
public override bool CanDelete()
{
return true;
}
public override bool IsAuthorizedToDelete(User user)
{
return user.Policy.EnableLiveTvManagement;

View File

@ -116,6 +116,11 @@ namespace MediaBrowser.Controller.LiveTv
return System.IO.Path.Combine(basePath, "livetv", Id.ToString("N"));
}
public override bool CanDelete()
{
return true;
}
public override bool IsAuthorizedToDelete(User user)
{
return user.Policy.EnableLiveTvManagement;

View File

@ -1458,5 +1458,6 @@
"LabelEmail": "Email:",
"LabelUsername": "Username:",
"HeaderSignUp": "Sign Up",
"LabelPasswordConfirm": "Password (confirm):"
"LabelPasswordConfirm": "Password (confirm):",
"ButtonAddServer": "Add Server"
}

View File

@ -24,9 +24,6 @@ namespace MediaBrowser.Server.Implementations.Session
private readonly string _postUrl;
private Timer _pingTimer;
private DateTime _lastPingTime;
public HttpSessionController(IHttpClient httpClient,
IJsonSerializer json,
SessionInfo session,
@ -37,10 +34,6 @@ namespace MediaBrowser.Server.Implementations.Session
Session = session;
_postUrl = postUrl;
_sessionManager = sessionManager;
_pingTimer = new Timer(PingTimerCallback, null, Timeout.Infinite, Timeout.Infinite);
ResetPingTimer();
}
public void OnActivity()
@ -59,7 +52,7 @@ namespace MediaBrowser.Server.Implementations.Session
{
get
{
return (DateTime.UtcNow - Session.LastActivityDate).TotalMinutes <= 20;
return (DateTime.UtcNow - Session.LastActivityDate).TotalMinutes <= 10;
}
}
@ -68,54 +61,6 @@ namespace MediaBrowser.Server.Implementations.Session
get { return true; }
}
private async void PingTimerCallback(object state)
{
try
{
await SendMessage("Ping", CancellationToken.None).ConfigureAwait(false);
_lastPingTime = DateTime.UtcNow;
}
catch
{
var lastActivityDate = new[] { _lastPingTime, Session.LastActivityDate }
.Max();
var timeSinceLastPing = DateTime.UtcNow - lastActivityDate;
// We don't want to stop the session due to one single request failure
// At the same time, we don't want the timeout to be too long because it will
// be sitting in active sessions available for remote control, when it's not
if (timeSinceLastPing >= TimeSpan.FromMinutes(5))
{
ReportSessionEnded();
}
}
}
private void ReportSessionEnded()
{
try
{
_sessionManager.ReportSessionEnded(Session.Id);
}
catch (Exception ex)
{
}
}
private void ResetPingTimer()
{
if (_pingTimer != null)
{
_lastPingTime = DateTime.UtcNow;
var period = TimeSpan.FromSeconds(60);
_pingTimer.Change(period, period);
}
}
private Task SendMessage(string name, CancellationToken cancellationToken)
{
return SendMessage(name, new Dictionary<string, string>(), cancellationToken);
@ -133,8 +78,6 @@ namespace MediaBrowser.Server.Implementations.Session
CancellationToken = cancellationToken
}).ConfigureAwait(false);
ResetPingTimer();
}
public Task SendSessionEndedNotification(SessionInfoDto sessionInfo, CancellationToken cancellationToken)
@ -237,16 +180,6 @@ namespace MediaBrowser.Server.Implementations.Session
public void Dispose()
{
DisposePingTimer();
}
private void DisposePingTimer()
{
if (_pingTimer != null)
{
_pingTimer.Dispose();
_pingTimer = null;
}
}
}
}

View File

@ -449,7 +449,6 @@ namespace MediaBrowser.WebDashboard.Api
await AppendResource(memoryStream, "bower_components/webcomponentsjs/webcomponents-lite.min.js", newLineBytes).ConfigureAwait(false);
// jQuery + jQuery mobile
await AppendResource(memoryStream, "thirdparty/jquery-2.1.1.min.js", newLineBytes).ConfigureAwait(false);
await AppendResource(memoryStream, "thirdparty/jquerymobile-1.4.5/jquery.mobile.custom.min.js", newLineBytes).ConfigureAwait(false);
@ -657,7 +656,6 @@ namespace MediaBrowser.WebDashboard.Api
"mediaplayer-video.css",
"librarymenu.css",
"librarybrowser.css",
"detailtable.css",
"card.css",
"tileitem.css",
"metadataeditor.css",