Merge pull request #1008 from MediaBrowser/dev

3.0.5518.2
This commit is contained in:
Luke 2015-02-10 23:10:38 -05:00
commit 177a5d78bf
15 changed files with 75 additions and 107 deletions

View File

@ -44,6 +44,11 @@ namespace MediaBrowser.Controller.Channels
/// </summary> /// </summary>
/// <value>The daily download limit.</value> /// <value>The daily download limit.</value>
public int? DailyDownloadLimit { get; set; } public int? DailyDownloadLimit { get; set; }
/// <summary>
/// Gets or sets a value indicating whether [supports downloading].
/// </summary>
/// <value><c>true</c> if [supports downloading]; otherwise, <c>false</c>.</value>
public bool SupportsContentDownloading { get; set; }
public InternalChannelFeatures() public InternalChannelFeatures()
{ {

View File

@ -170,6 +170,11 @@ namespace MediaBrowser.Server.Implementations.Channels
foreach (var item in result.Items) foreach (var item in result.Items)
{ {
var channelItem = (IChannelItem)item; var channelItem = (IChannelItem)item;
var channelFeatures = _manager.GetChannelFeatures(channelItem.ChannelId);
if (channelFeatures.SupportsContentDownloading)
{
if (options.DownloadingChannels.Contains(channelItem.ChannelId)) if (options.DownloadingChannels.Contains(channelItem.ChannelId))
{ {
try try
@ -189,6 +194,7 @@ namespace MediaBrowser.Server.Implementations.Channels
_logger.ErrorException("Error downloading channel content for {0}", ex, item.Name); _logger.ErrorException("Error downloading channel content for {0}", ex, item.Name);
} }
} }
}
numComplete++; numComplete++;
double percent = numComplete; double percent = numComplete;

View File

@ -508,7 +508,7 @@ namespace MediaBrowser.Server.Implementations.Channels
SupportsLatestMedia = supportsLatest, SupportsLatestMedia = supportsLatest,
Name = channel.Name, Name = channel.Name,
Id = channel.Id.ToString("N"), Id = channel.Id.ToString("N"),
SupportsContentDownloading = isIndexable || supportsLatest, SupportsContentDownloading = features.SupportsContentDownloading && (isIndexable || supportsLatest),
AutoRefreshLevels = features.AutoRefreshLevels AutoRefreshLevels = features.AutoRefreshLevels
}; };
} }

View File

@ -956,6 +956,10 @@ namespace MediaBrowser.Server.Implementations.Connect
_data.LastAuthorizationsRefresh = DateTime.UtcNow; _data.LastAuthorizationsRefresh = DateTime.UtcNow;
CacheData(); CacheData();
} }
catch (Exception ex)
{
_logger.ErrorException("Error refreshing authorization", ex);
}
finally finally
{ {
_operationLock.Release(); _operationLock.Release();

View File

@ -669,11 +669,6 @@ namespace MediaBrowser.Server.Implementations.Library
throw new ArgumentNullException("newPasswordSha1"); throw new ArgumentNullException("newPasswordSha1");
} }
if (user.ConnectLinkType.HasValue && user.ConnectLinkType.Value == UserLinkType.Guest)
{
throw new ArgumentException("Passwords for guests cannot be changed.");
}
user.EasyPassword = newPasswordSha1; user.EasyPassword = newPasswordSha1;
await UpdateUser(user).ConfigureAwait(false); await UpdateUser(user).ConfigureAwait(false);

View File

@ -1,58 +0,0 @@
using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.LiveTv;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace MediaBrowser.Server.Implementations.LiveTv
{
class CleanDatabaseScheduledTask : IScheduledTask, IConfigurableScheduledTask
{
private readonly ILiveTvManager _liveTvManager;
public CleanDatabaseScheduledTask(ILiveTvManager liveTvManager)
{
_liveTvManager = liveTvManager;
}
public string Name
{
get { return "Clean TV Database"; }
}
public string Description
{
get { return "Deletes old programs from the tv database."; }
}
public string Category
{
get { return "Live TV"; }
}
public Task Execute(System.Threading.CancellationToken cancellationToken, IProgress<double> progress)
{
var manager = (LiveTvManager)_liveTvManager;
return manager.CleanDatabase(progress, cancellationToken);
}
public IEnumerable<ITaskTrigger> GetDefaultTriggers()
{
return new ITaskTrigger[]
{
new IntervalTrigger{ Interval = TimeSpan.FromHours(12)}
};
}
public bool IsHidden
{
get { return _liveTvManager.ActiveService == null; }
}
public bool IsEnabled
{
get { return true; }
}
}
}

View File

@ -2,6 +2,7 @@
using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Configuration;
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Common.Progress;
using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Common.ScheduledTasks;
using MediaBrowser.Controller.Channels; using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Configuration;
@ -887,7 +888,13 @@ namespace MediaBrowser.Server.Implementations.LiveTv
try try
{ {
await RefreshChannelsInternal(progress, cancellationToken).ConfigureAwait(false); var innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(p => progress.Report(p * .9));
await RefreshChannelsInternal(innerProgress, cancellationToken).ConfigureAwait(false);
innerProgress = new ActionableProgress<double>();
innerProgress.RegisterAction(p => progress.Report(90 + (p * .1)));
await CleanDatabaseInternal(progress, cancellationToken).ConfigureAwait(false);
} }
finally finally
{ {
@ -998,14 +1005,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv
public async Task CleanDatabase(IProgress<double> progress, CancellationToken cancellationToken) public async Task CleanDatabase(IProgress<double> progress, CancellationToken cancellationToken)
{ {
var service = ActiveService;
if (service == null)
{
progress.Report(100);
return;
}
await _refreshSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false); await _refreshSemaphore.WaitAsync(cancellationToken).ConfigureAwait(false);
try try
@ -1018,8 +1017,21 @@ namespace MediaBrowser.Server.Implementations.LiveTv
} }
} }
private Task CleanDatabaseInternal(IProgress<double> progress, CancellationToken cancellationToken)
{
return DeleteOldPrograms(_programs.Keys.ToList(), progress, cancellationToken);
}
private async Task DeleteOldPrograms(List<Guid> currentIdList, IProgress<double> progress, CancellationToken cancellationToken) private async Task DeleteOldPrograms(List<Guid> currentIdList, IProgress<double> progress, CancellationToken cancellationToken)
{ {
var service = ActiveService;
if (service == null)
{
progress.Report(100);
return;
}
var list = _itemRepo.GetItemsOfType(typeof(LiveTvProgram)).ToList(); var list = _itemRepo.GetItemsOfType(typeof(LiveTvProgram)).ToList();
var numComplete = 0; var numComplete = 0;

View File

@ -70,6 +70,7 @@
"HeaderSelectCertificatePath": "Select Certificate Path", "HeaderSelectCertificatePath": "Select Certificate Path",
"ConfirmMessageScheduledTaskButton": "This operation normally runs automatically as a scheduled task. It can also be run manually here. To configure the scheduled task, see:", "ConfirmMessageScheduledTaskButton": "This operation normally runs automatically as a scheduled task. It can also be run manually here. To configure the scheduled task, see:",
"HeaderSupporterBenefit": "A supporter membership provides additional benefits such as access to premium plugins, internet channel content, and more. {0}Learn more{1}.", "HeaderSupporterBenefit": "A supporter membership provides additional benefits such as access to premium plugins, internet channel content, and more. {0}Learn more{1}.",
"LabelSyncNoTargetsHelp": "It looks like you don't currently have any apps that support sync.",
"HeaderWelcomeToMediaBrowserServerDashboard": "Welcome to the Media Browser Dashboard", "HeaderWelcomeToMediaBrowserServerDashboard": "Welcome to the Media Browser Dashboard",
"HeaderWelcomeToMediaBrowserWebClient": "Welcome to the Media Browser Web Client", "HeaderWelcomeToMediaBrowserWebClient": "Welcome to the Media Browser Web Client",
"ButtonTakeTheTour": "Take the tour", "ButtonTakeTheTour": "Take the tour",
@ -83,6 +84,7 @@
"ButtonCancelItem": "Cancel item", "ButtonCancelItem": "Cancel item",
"ButtonQueueForRetry": "Queue for retry", "ButtonQueueForRetry": "Queue for retry",
"ButtonReenable": "Re-enable", "ButtonReenable": "Re-enable",
"ButtonLearnMore": "Learn more",
"SyncJobItemStatusSyncedMarkForRemoval": "Marked for removal", "SyncJobItemStatusSyncedMarkForRemoval": "Marked for removal",
"LabelAbortedByServerShutdown": "(Aborted by server shutdown)", "LabelAbortedByServerShutdown": "(Aborted by server shutdown)",
"LabelScheduledTaskLastRan": "Last ran {0}, taking {1}.", "LabelScheduledTaskLastRan": "Last ran {0}, taking {1}.",

View File

@ -153,8 +153,8 @@
<Compile Include="EntryPoints\ServerEventNotifier.cs" /> <Compile Include="EntryPoints\ServerEventNotifier.cs" />
<Compile Include="EntryPoints\UserDataChangeNotifier.cs" /> <Compile Include="EntryPoints\UserDataChangeNotifier.cs" />
<Compile Include="FileOrganization\OrganizerScheduledTask.cs" /> <Compile Include="FileOrganization\OrganizerScheduledTask.cs" />
<Compile Include="HttpServer\NetListener\HttpListenerServer.cs" />
<Compile Include="HttpServer\IHttpListener.cs" /> <Compile Include="HttpServer\IHttpListener.cs" />
<Compile Include="HttpServer\NetListener\HttpListenerServer.cs" />
<Compile Include="HttpServer\Security\AuthorizationContext.cs" /> <Compile Include="HttpServer\Security\AuthorizationContext.cs" />
<Compile Include="HttpServer\ContainerAdapter.cs" /> <Compile Include="HttpServer\ContainerAdapter.cs" />
<Compile Include="HttpServer\GetSwaggerResource.cs" /> <Compile Include="HttpServer\GetSwaggerResource.cs" />
@ -222,7 +222,6 @@
<Compile Include="Library\Validators\StudiosValidator.cs" /> <Compile Include="Library\Validators\StudiosValidator.cs" />
<Compile Include="Library\Validators\YearsPostScanTask.cs" /> <Compile Include="Library\Validators\YearsPostScanTask.cs" />
<Compile Include="LiveTv\ChannelImageProvider.cs" /> <Compile Include="LiveTv\ChannelImageProvider.cs" />
<Compile Include="LiveTv\CleanDatabaseScheduledTask.cs" />
<Compile Include="LiveTv\LiveTvConfigurationFactory.cs" /> <Compile Include="LiveTv\LiveTvConfigurationFactory.cs" />
<Compile Include="LiveTv\LiveTvDtoService.cs" /> <Compile Include="LiveTv\LiveTvDtoService.cs" />
<Compile Include="LiveTv\LiveTvManager.cs" /> <Compile Include="LiveTv\LiveTvManager.cs" />

View File

@ -842,6 +842,8 @@ namespace MediaBrowser.Server.Startup.Common
// Need to restart if ports have changed // Need to restart if ports have changed
if (ServerConfigurationManager.Configuration.HttpServerPortNumber != HttpPort || if (ServerConfigurationManager.Configuration.HttpServerPortNumber != HttpPort ||
ServerConfigurationManager.Configuration.HttpsPortNumber != HttpsPort) ServerConfigurationManager.Configuration.HttpsPortNumber != HttpsPort)
{
if (ServerConfigurationManager.Configuration.IsPortAuthorized)
{ {
ServerConfigurationManager.Configuration.IsPortAuthorized = false; ServerConfigurationManager.Configuration.IsPortAuthorized = false;
ServerConfigurationManager.SaveConfiguration(); ServerConfigurationManager.SaveConfiguration();
@ -849,6 +851,7 @@ namespace MediaBrowser.Server.Startup.Common
requiresRestart = true; requiresRestart = true;
} }
} }
}
if (!HttpServer.UrlPrefixes.SequenceEqual(GetUrlPrefixes(), StringComparer.OrdinalIgnoreCase)) if (!HttpServer.UrlPrefixes.SequenceEqual(GetUrlPrefixes(), StringComparer.OrdinalIgnoreCase))
{ {

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.566</version> <version>3.0.567</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.566" /> <dependency id="MediaBrowser.Common" version="3.0.567" />
<dependency id="NLog" version="3.1.0.0" /> <dependency id="NLog" version="3.1.0.0" />
<dependency id="SimpleInjector" version="2.6.1" /> <dependency id="SimpleInjector" version="2.6.1" />
</dependencies> </dependencies>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.566</version> <version>3.0.567</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Model.Signed</id> <id>MediaBrowser.Model.Signed</id>
<version>3.0.566</version> <version>3.0.567</version>
<title>MediaBrowser.Model - Signed Edition</title> <title>MediaBrowser.Model - Signed Edition</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.566</version> <version>3.0.567</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.566" /> <dependency id="MediaBrowser.Common" version="3.0.567" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
//[assembly: AssemblyVersion("3.0.*")] //[assembly: AssemblyVersion("3.0.*")]
[assembly: AssemblyVersion("3.0.5518.1")] [assembly: AssemblyVersion("3.0.5518.2")]