don't save metadata when video content type is unset

This commit is contained in:
Luke Pulverenti
2015-01-04 00:55:34 -05:00
parent 36295aa833
commit e27040f61b
16 changed files with 81 additions and 30 deletions

View File

@@ -1,6 +1,4 @@
using System.Net;
using System.Text;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.Extensions;
using MediaBrowser.Common.IO;
using MediaBrowser.Common.Net;
using MediaBrowser.Controller.Channels;
@@ -10,7 +8,6 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Model.Channels;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Entities;
@@ -24,9 +21,10 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Server.Implementations.Library;
namespace MediaBrowser.Server.Implementations.Channels
{
@@ -1293,16 +1291,16 @@ namespace MediaBrowser.Server.Implementations.Channels
}
}
private async Task RefreshIfNeeded(BaseItem program, CancellationToken cancellationToken)
private readonly Task _cachedTask = Task.FromResult(true);
private Task RefreshIfNeeded(BaseItem program, CancellationToken cancellationToken)
{
if (_refreshedItems.ContainsKey(program.Id))
if (!_refreshedItems.ContainsKey(program.Id))
{
return;
_refreshedItems.TryAdd(program.Id, true);
return program.RefreshMetadata(cancellationToken);
}
await program.RefreshMetadata(cancellationToken).ConfigureAwait(false);
_refreshedItems.TryAdd(program.Id, true);
return _cachedTask;
}
internal IChannel GetChannelProvider(Channel channel)

View File

@@ -309,16 +309,16 @@ namespace MediaBrowser.Server.Implementations.LiveTv
return Task.FromResult(true);
}
private async Task RefreshIfNeeded(LiveTvProgram program, CancellationToken cancellationToken)
private readonly Task _cachedTask = Task.FromResult(true);
private Task RefreshIfNeeded(LiveTvProgram program, CancellationToken cancellationToken)
{
if (_refreshedPrograms.ContainsKey(program.Id))
if (!_refreshedPrograms.ContainsKey(program.Id))
{
return;
_refreshedPrograms.TryAdd(program.Id, true);
return program.RefreshMetadata(cancellationToken);
}
_refreshedPrograms.TryAdd(program.Id, true);
await program.RefreshMetadata(cancellationToken).ConfigureAwait(false);
return _cachedTask;
}
public async Task<ILiveTvRecording> GetInternalRecording(string id, CancellationToken cancellationToken)

View File

@@ -294,7 +294,7 @@
"LabelNewProgram": "NEW",
"LabelPremiereProgram": "PREMIERE",
"LabelHDProgram": "HD",
"HeaderChangeFolderType": "Change Folder Type",
"HeaderChangeFolderType": "Change Content Type",
"HeaderChangeFolderTypeHelp": "To change the type, please remove and rebuild the folder with the new type.",
"HeaderAlert": "Alert",
"MessagePleaseRestart": "Please restart to finish updating.",
@@ -627,7 +627,7 @@
"MessageInvitationSentToUser": "An email has been sent to {0}, inviting them to accept your sharing invitation.",
"MessageInvitationSentToNewUser": "An email has been sent to {0} inviting them to sign up with Media Browser.",
"HeaderConnectionFailure": "Connection Failure",
"MessageUnableToConnectToServer": "We're unable to connect to the selected server right now. Please try again later.",
"MessageUnableToConnectToServer": "We're unable to connect to the selected server right now. Please ensure it is running and try again.",
"ButtonSelectServer": "Select server",
"MessagePluginConfigurationRequiresLocalAccess": "To configure this plugin please sign in to your local server directly.",
"MessageLoggedOutParentalControl": "Access is currently restricted. Please try again later.",

View File

@@ -241,10 +241,12 @@
"VisitMediaBrowserWebsite": "Visit the Media Browser Web Site",
"VisitMediaBrowserWebsiteLong": "Visit the Media Browser Web site to catch the latest news and keep up with the developer blog.",
"OptionHideUser": "Hide this user from login screens",
"OptionHideUserFromLoginHelp": "Useful for private or hidden administrator accounts. The user will need to sign in manually by entering their username and password.",
"OptionDisableUser": "Disable this user",
"OptionDisableUserHelp": "If disabled the server will not allow any connections from this user. Existing connections will be abruptly terminated.",
"HeaderAdvancedControl": "Advanced Control",
"LabelName": "Name:",
"ButtonHelp": "Help",
"OptionAllowUserToManageServer": "Allow this user to manage the server",
"HeaderFeatureAccess": "Feature Access",
"OptionAllowMediaPlayback": "Allow media playback",