From 82c65f37885eb204f09b08d495c8666bbc68bdf3 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 13 Jan 2017 22:48:42 -0500 Subject: [PATCH] update playlist creation --- Emby.Server.Implementations/Playlists/PlaylistManager.cs | 2 +- MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Emby.Server.Implementations/Playlists/PlaylistManager.cs b/Emby.Server.Implementations/Playlists/PlaylistManager.cs index 9583141e0..386da73c6 100644 --- a/Emby.Server.Implementations/Playlists/PlaylistManager.cs +++ b/Emby.Server.Implementations/Playlists/PlaylistManager.cs @@ -100,7 +100,7 @@ namespace Emby.Server.Implementations.Playlists if (string.IsNullOrWhiteSpace(options.MediaType)) { - throw new ArgumentException("A playlist media type is required."); + options.MediaType = "Audio"; } var user = _userManager.GetUserById(options.UserId); diff --git a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs index 9caf94da6..e4037f2ef 100644 --- a/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs +++ b/MediaBrowser.XbmcMetadata/Parsers/BaseNfoParser.cs @@ -964,13 +964,14 @@ namespace MediaBrowser.XbmcMetadata.Parsers } default: - var providerId = reader.Name; - if (_validProviderIds.ContainsKey(providerId)) + string readerName = reader.Name; + string providerIdValue; + if (_validProviderIds.TryGetValue(readerName, out providerIdValue)) { var id = reader.ReadElementContentAsString(); if (!string.IsNullOrWhiteSpace(id)) { - item.SetProviderId(_validProviderIds[providerId], id); + item.SetProviderId(providerIdValue, id); } } else