aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-03 19:38:23 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-05-03 19:38:23 -0400
commitf031bb744b00d139a71036678abd6586e6595cb5 (patch)
tree11d7df9ef93724305ead973f05afb7a11b801039 /MediaBrowser.Server.Implementations
parentac2c1563d574fdbaa3529b68b6dd3100377ecf8a (diff)
add new web client sidebar
Diffstat (limited to 'MediaBrowser.Server.Implementations')
-rw-r--r--MediaBrowser.Server.Implementations/Channels/ChannelManager.cs27
-rw-r--r--MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs12
-rw-r--r--MediaBrowser.Server.Implementations/Localization/Server/server.json5
3 files changed, 34 insertions, 10 deletions
diff --git a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
index e028065c3..dc3a04769 100644
--- a/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
+++ b/MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
@@ -23,6 +23,7 @@ namespace MediaBrowser.Server.Implementations.Channels
public class ChannelManager : IChannelManager
{
private IChannel[] _channels;
+ private IChannelFactory[] _factories;
private List<Channel> _channelEntities = new List<Channel>();
private readonly IUserManager _userManager;
@@ -44,9 +45,29 @@ namespace MediaBrowser.Server.Implementations.Channels
_userDataManager = userDataManager;
}
- public void AddParts(IEnumerable<IChannel> channels)
+ public void AddParts(IEnumerable<IChannel> channels, IEnumerable<IChannelFactory> factories)
{
_channels = channels.ToArray();
+ _factories = factories.ToArray();
+ }
+
+ private IEnumerable<IChannel> GetAllChannels()
+ {
+ return _factories
+ .SelectMany(i =>
+ {
+ try
+ {
+ return i.GetChannels().ToList();
+ }
+ catch (Exception ex)
+ {
+ _logger.ErrorException("Error getting channel list", ex);
+ return new List<IChannel>();
+ }
+ })
+ .Concat(_channels)
+ .OrderBy(i => i.Name);
}
public Task<QueryResult<BaseItemDto>> GetChannels(ChannelQuery query, CancellationToken cancellationToken)
@@ -82,7 +103,7 @@ namespace MediaBrowser.Server.Implementations.Channels
public async Task RefreshChannels(IProgress<double> progress, CancellationToken cancellationToken)
{
- var allChannelsList = _channels.ToList();
+ var allChannelsList = GetAllChannels().ToList();
var list = new List<Channel>();
@@ -380,7 +401,7 @@ namespace MediaBrowser.Server.Implementations.Channels
internal IChannel GetChannelProvider(Channel channel)
{
- return _channels.First(i => string.Equals(i.Name, channel.OriginalChannelName, StringComparison.OrdinalIgnoreCase));
+ return GetAllChannels().First(i => string.Equals(i.Name, channel.OriginalChannelName, StringComparison.OrdinalIgnoreCase));
}
private IEnumerable<BaseItem> ApplyFilters(IEnumerable<BaseItem> items, IEnumerable<ItemFilter> filters, User user)
diff --git a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs
index 1e3f8b0b0..cc3221711 100644
--- a/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs
+++ b/MediaBrowser.Server.Implementations/EntryPoints/Notifications/Notifier.cs
@@ -81,7 +81,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
notification.Variables["Version"] = e.Argument.versionStr;
notification.Variables["ReleaseNotes"] = e.Argument.description;
-
+
await SendNotification(notification).ConfigureAwait(false);
}
@@ -164,7 +164,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
var item = e.MediaInfo;
- if (e.Item !=null && e.Item.Parent == null)
+ if (e.Item != null && e.Item.Parent == null)
{
// Don't report theme song or local trailer playback
// TODO: This will also cause movie specials to not be reported
@@ -185,7 +185,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
await SendNotification(notification).ConfigureAwait(false);
}
-
+
private string GetPlaybackNotificationType(string mediaType)
{
if (string.Equals(mediaType, MediaType.Audio, StringComparison.OrdinalIgnoreCase))
@@ -218,7 +218,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
};
notification.Variables["Name"] = item.Name;
-
+
await SendNotification(notification).ConfigureAwait(false);
}
}
@@ -260,7 +260,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
async void _installationManager_PluginUninstalled(object sender, GenericEventArgs<IPlugin> e)
{
var type = NotificationType.PluginUninstalled.ToString();
-
+
var plugin = e.Argument;
var notification = new NotificationRequest
@@ -270,7 +270,7 @@ namespace MediaBrowser.Server.Implementations.EntryPoints.Notifications
notification.Variables["Name"] = plugin.Name;
notification.Variables["Version"] = plugin.Version.ToString();
-
+
await SendNotification(notification).ConfigureAwait(false);
}
diff --git a/MediaBrowser.Server.Implementations/Localization/Server/server.json b/MediaBrowser.Server.Implementations/Localization/Server/server.json
index 8e2fa18b9..0c99b3a57 100644
--- a/MediaBrowser.Server.Implementations/Localization/Server/server.json
+++ b/MediaBrowser.Server.Implementations/Localization/Server/server.json
@@ -624,5 +624,8 @@
"ButtonMute": "Mute",
"HeaderLatestMedia": "Latest Media",
"OptionNoSubtitles": "No Subtitles",
- "OptionSpecialFeatures": "Special Features"
+ "OptionSpecialFeatures": "Special Features",
+ "HeaderCollections": "Collections",
+ "HeaderChannels": "Channels",
+ "HeaderMyLibrary": "My Library"
} \ No newline at end of file