fixes #295 - Add play to vlc option

This commit is contained in:
Luke Pulverenti
2014-09-15 23:33:30 -04:00
parent cbbc7269fa
commit a35f62a4a4
9 changed files with 69 additions and 26 deletions

View File

@@ -266,21 +266,28 @@ namespace MediaBrowser.Server.Implementations.Channels
private bool IsSizeLimitReached(string path, double gbLimit)
{
var byteLimit = gbLimit*1000000000;
long total = 0;
foreach (var file in new DirectoryInfo(path).EnumerateFiles("*", SearchOption.AllDirectories))
try
{
total += file.Length;
var byteLimit = gbLimit * 1000000000;
if (total >= byteLimit)
long total = 0;
foreach (var file in new DirectoryInfo(path).EnumerateFiles("*", SearchOption.AllDirectories))
{
return true;
}
}
total += file.Length;
return false;
if (total >= byteLimit)
{
return true;
}
}
return false;
}
catch (DirectoryNotFoundException)
{
return false;
}
}
private async Task RefreshMediaSourceItems(IEnumerable<MediaSourceInfo> items, CancellationToken cancellationToken)

View File

@@ -133,9 +133,8 @@ namespace MediaBrowser.Server.Implementations.Connect
}
catch (HttpException ex)
{
var webEx = (WebException) ex.InnerException;
if (webEx == null || (webEx.Status != WebExceptionStatus.ProtocolError && ((HttpWebResponse)webEx.Response).StatusCode != HttpStatusCode.NotFound))
if (!ex.StatusCode.HasValue || ex.StatusCode.Value != HttpStatusCode.NotFound ||
ex.StatusCode.Value != HttpStatusCode.Unauthorized)
{
throw;
}

View File

@@ -845,9 +845,11 @@ namespace MediaBrowser.Server.Implementations.Library
if (isArtist)
{
var validFilename = _fileSystem.GetValidFilename(name).Trim();
var existing = RootFolder.RecursiveChildren
.OfType<T>()
.FirstOrDefault(i => string.Equals(i.Name, name, StringComparison.OrdinalIgnoreCase));
.FirstOrDefault(i => string.Equals(_fileSystem.GetValidFilename(i.Name).Trim(), validFilename, StringComparison.OrdinalIgnoreCase));
if (existing != null)
{

View File

@@ -462,5 +462,11 @@
"ValueDiscNumber": "Disc {0}",
"HeaderUnknownDate": "Unknown Date",
"HeaderUnknownYear": "Unknown Year",
"ValueMinutes": "{0} min"
"ValueMinutes": "{0} min",
"ButtonPlayExternalPlayer": "Play with external player",
"HeaderSelectExternalPlayer": "Select External Player",
"HeaderExternalPlayerPlayback": "External Player Playback",
"ButtonImDone": "I'm Done",
"OptionMarkWatched": "Mark watched",
"OptionMarkWatchedHelp": "Check this if you watched the entire video"
}

View File

@@ -1166,5 +1166,5 @@
"LabelConnectUserNameHelp": "Connect this user to a Media Browser account to enable easy sign-in access from any app without having to know the server ip address.",
"ButtonLearnMoreAboutMediaBrowserConnect": "Learn more about Media Browser Connect",
"LabelExternalPlayers": "External players:",
"LabelExternalPlayersHelp": "Display buttons to play content in external players. This is only available on devices that support url schemes, generally Android and iOS."
"LabelExternalPlayersHelp": "Display buttons to play content in external players. This is only available on devices that support url schemes, generally Android and iOS. With external players there is generally no support for remote control, resuming, or reporting progress to the server."
}