Просмотр исходного кода

Merge pull request #2018 from MediaBrowser/beta

Beta
Luke 9 лет назад
Родитель
Сommit
87d7a7d85a
100 измененных файлов с 352 добавлено и 418 удалено
  1. 1 4
      MediaBrowser.Api/LiveTv/LiveTvService.cs
  2. 13 0
      MediaBrowser.Api/Playback/BaseStreamingService.cs
  3. 0 1
      MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
  4. 0 2
      MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs
  5. 0 2
      MediaBrowser.Api/UserLibrary/ArtistsService.cs
  6. 4 2
      MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs
  7. 0 2
      MediaBrowser.Api/UserLibrary/GameGenresService.cs
  8. 0 1
      MediaBrowser.Api/UserLibrary/GenresService.cs
  9. 1 2
      MediaBrowser.Api/UserLibrary/ItemsService.cs
  10. 0 2
      MediaBrowser.Api/UserLibrary/MusicGenresService.cs
  11. 1 4
      MediaBrowser.Controller/Channels/Channel.cs
  12. 4 2
      MediaBrowser.Controller/Channels/ChannelMediaInfo.cs
  13. 5 16
      MediaBrowser.Controller/Dto/IDtoService.cs
  14. 1 5
      MediaBrowser.Controller/Entities/Folder.cs
  15. 1 2
      MediaBrowser.Controller/Entities/IHasImages.cs
  16. 1 2
      MediaBrowser.Controller/Entities/IItemByName.cs
  17. 2 0
      MediaBrowser.Controller/Entities/InternalPeopleQuery.cs
  18. 0 1
      MediaBrowser.Controller/Entities/MusicVideo.cs
  19. 0 1
      MediaBrowser.Controller/Entities/TV/Season.cs
  20. 0 2
      MediaBrowser.Controller/Entities/Trailer.cs
  21. 0 2
      MediaBrowser.Controller/Entities/UserRootFolder.cs
  22. 0 3
      MediaBrowser.Controller/Entities/UserViewBuilder.cs
  23. 0 6
      MediaBrowser.Controller/Library/ILibraryManager.cs
  24. 0 1
      MediaBrowser.Controller/LiveTv/LiveTvProgram.cs
  25. 0 1
      MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs
  26. 1 7
      MediaBrowser.Controller/LiveTv/TimerEventInfo.cs
  27. 1 7
      MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs
  28. 1 2
      MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
  29. 0 1
      MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs
  30. 1 1
      MediaBrowser.Controller/Sync/ISyncManager.cs
  31. 3 2
      MediaBrowser.Controller/Sync/ISyncRepository.cs
  32. 1 1
      MediaBrowser.Controller/Sync/SyncedItemProgress.cs
  33. 1 17
      MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs
  34. 1 1
      MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
  35. 56 54
      MediaBrowser.Dlna/DlnaManager.cs
  36. 5 5
      MediaBrowser.Dlna/Main/DlnaEntryPoint.cs
  37. 1 1
      MediaBrowser.Dlna/Profiles/LgTvProfile.cs
  38. 3 3
      MediaBrowser.Dlna/Profiles/Xml/BubbleUPnp.xml
  39. 3 3
      MediaBrowser.Dlna/Profiles/Xml/Default.xml
  40. 3 3
      MediaBrowser.Dlna/Profiles/Xml/Denon AVR.xml
  41. 4 2
      MediaBrowser.Dlna/Profiles/Xml/DirecTV HD-DVR.xml
  42. 7 3
      MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml
  43. 3 3
      MediaBrowser.Dlna/Profiles/Xml/Kodi.xml
  44. 6 3
      MediaBrowser.Dlna/Profiles/Xml/LG Smart TV.xml
  45. 3 3
      MediaBrowser.Dlna/Profiles/Xml/Linksys DMA2100.xml
  46. 3 3
      MediaBrowser.Dlna/Profiles/Xml/MediaMonkey.xml
  47. 4 3
      MediaBrowser.Dlna/Profiles/Xml/Panasonic Viera.xml
  48. 8 3
      MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml
  49. 8 3
      MediaBrowser.Dlna/Profiles/Xml/Samsung Smart TV.xml
  50. 5 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml
  51. 6 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player.xml
  52. 9 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml
  53. 9 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml
  54. 6 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml
  55. 5 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml
  56. 5 3
      MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2014).xml
  57. 7 3
      MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 3.xml
  58. 7 3
      MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 4.xml
  59. 3 3
      MediaBrowser.Dlna/Profiles/Xml/Vlc.xml
  60. 5 3
      MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml
  61. 8 3
      MediaBrowser.Dlna/Profiles/Xml/Xbox 360.xml
  62. 9 3
      MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml
  63. 3 3
      MediaBrowser.Dlna/Profiles/Xml/foobar2000.xml
  64. 0 1
      MediaBrowser.Dlna/Ssdp/SsdpHandler.cs
  65. 0 1
      MediaBrowser.LocalMetadata/BaseXmlProvider.cs
  66. 1 1
      MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs
  67. 1 1
      MediaBrowser.LocalMetadata/Savers/FolderXmlSaver.cs
  68. 1 1
      MediaBrowser.LocalMetadata/Savers/GameSystemXmlSaver.cs
  69. 1 1
      MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs
  70. 0 1
      MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs
  71. 27 18
      MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs
  72. 7 3
      MediaBrowser.Model/Dlna/StreamBuilder.cs
  73. 0 1
      MediaBrowser.Model/Dto/BaseItemDto.cs
  74. 1 2
      MediaBrowser.Model/Dto/BaseItemPerson.cs
  75. 1 0
      MediaBrowser.Model/Dto/IHasSyncInfo.cs
  76. 0 1
      MediaBrowser.Model/Dto/UserDto.cs
  77. 0 1
      MediaBrowser.Model/Dto/UserItemDataDto.cs
  78. 0 1
      MediaBrowser.Model/LiveTv/ChannelInfoDto.cs
  79. 1 0
      MediaBrowser.Model/Querying/ItemFields.cs
  80. 0 1
      MediaBrowser.Model/Session/SessionInfoDto.cs
  81. 1 5
      MediaBrowser.Providers/Folders/CollectionFolderMetadataService.cs
  82. 1 7
      MediaBrowser.Providers/Manager/MetadataService.cs
  83. 0 1
      MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs
  84. 0 1
      MediaBrowser.Providers/Movies/MovieDbProvider.cs
  85. 0 1
      MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs
  86. 0 1
      MediaBrowser.Providers/Music/FanArtAlbumProvider.cs
  87. 0 2
      MediaBrowser.Providers/Omdb/OmdbImageProvider.cs
  88. 0 1
      MediaBrowser.Providers/Omdb/OmdbProvider.cs
  89. 2 6
      MediaBrowser.Providers/TV/MissingEpisodeProvider.cs
  90. 0 1
      MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs
  91. 0 1
      MediaBrowser.Providers/TV/SeriesPostScanTask.cs
  92. 0 1
      MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs
  93. 0 1
      MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs
  94. 2 2
      MediaBrowser.Server.Implementations/Channels/ChannelManager.cs
  95. 55 95
      MediaBrowser.Server.Implementations/Dto/DtoService.cs
  96. 0 2
      MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
  97. 0 3
      MediaBrowser.Server.Implementations/EntryPoints/RecordingNotifier.cs
  98. 2 1
      MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
  99. 0 2
      MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs
  100. 0 7
      MediaBrowser.Server.Implementations/Library/LibraryManager.cs

+ 1 - 4
MediaBrowser.Api/LiveTv/LiveTvService.cs

@@ -997,10 +997,7 @@ namespace MediaBrowser.Api.LiveTv
 
         public async Task<object> Get(GetRecordingGroup request)
         {
-            var result = await _liveTvManager.GetRecordingGroups(new RecordingGroupQuery
-            {
-
-            }, CancellationToken.None).ConfigureAwait(false);
+            var result = await _liveTvManager.GetRecordingGroups(new RecordingGroupQuery(), CancellationToken.None).ConfigureAwait(false);
 
             var group = result.Items.FirstOrDefault(i => string.Equals(i.Id, request.Id, StringComparison.OrdinalIgnoreCase));
 

+ 13 - 0
MediaBrowser.Api/Playback/BaseStreamingService.cs

@@ -1788,6 +1788,19 @@ namespace MediaBrowser.Api.Playback
             {
                 state.OutputAudioCodec = "copy";
             }
+            else
+            {
+                // If the user doesn't have access to transcoding, then force stream copy, regardless of whether it will be compatible or not
+                var auth = AuthorizationContext.GetAuthorizationInfo(Request);
+                if (!string.IsNullOrWhiteSpace(auth.UserId))
+                {
+                    var user = UserManager.GetUserById(auth.UserId);
+                    if (!user.Policy.EnableAudioPlaybackTranscoding)
+                    {
+                        state.OutputAudioCodec = "copy";
+                    }
+                }
+            }
         }
 
         private void AttachMediaSourceInfo(StreamState state,

+ 0 - 1
MediaBrowser.Api/Playback/Hls/BaseHlsService.cs

@@ -3,7 +3,6 @@ using MediaBrowser.Controller.Devices;
 using MediaBrowser.Controller.Dlna;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.MediaEncoding;
-using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Extensions;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.Net;

+ 0 - 2
MediaBrowser.Api/Playback/Progressive/ProgressiveStreamWriter.cs

@@ -1,7 +1,5 @@
 using MediaBrowser.Model.Logging;
-using ServiceStack.Web;
 using System;
-using System.Collections.Generic;
 using System.IO;
 using System.Threading;
 using System.Threading.Tasks;

+ 0 - 2
MediaBrowser.Api/UserLibrary/ArtistsService.cs

@@ -8,8 +8,6 @@ using MediaBrowser.Controller.Persistence;
 using MediaBrowser.Model.Dto;
 using ServiceStack;
 using System.Collections.Generic;
-using System.Linq;
-using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Querying;
 
 namespace MediaBrowser.Api.UserLibrary

+ 4 - 2
MediaBrowser.Api/UserLibrary/BaseItemsByNameService.cs

@@ -180,9 +180,10 @@ namespace MediaBrowser.Api.UserLibrary
 
             var result = GetItems(request, query);
 
+            var syncProgess = DtoService.GetSyncedItemProgress(dtoOptions);
             var dtos = result.Items.Select(i =>
             {
-                var dto = DtoService.GetItemByNameDto(i.Item1, dtoOptions, null, user);
+                var dto = DtoService.GetItemByNameDto(i.Item1, dtoOptions, null, syncProgess, user);
 
                 if (!string.IsNullOrWhiteSpace(request.IncludeItemTypes))
                 {
@@ -325,7 +326,8 @@ namespace MediaBrowser.Api.UserLibrary
                 tuples = ibnItems.Select(i => new Tuple<BaseItem, List<BaseItem>>(i, new List<BaseItem>()));
             }
 
-            var dtos = tuples.Select(i => DtoService.GetItemByNameDto(i.Item1, dtoOptions, i.Item2, user));
+            var syncProgess = DtoService.GetSyncedItemProgress(dtoOptions);
+            var dtos = tuples.Select(i => DtoService.GetItemByNameDto(i.Item1, dtoOptions, i.Item2, syncProgess, user));
 
             result.Items = dtos.Where(i => i != null).ToArray();
 

+ 0 - 2
MediaBrowser.Api/UserLibrary/GameGenresService.cs

@@ -4,11 +4,9 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Net;
 using MediaBrowser.Controller.Persistence;
 using MediaBrowser.Model.Dto;
-using MediaBrowser.Model.Entities;
 using ServiceStack;
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MediaBrowser.Model.Querying;
 
 namespace MediaBrowser.Api.UserLibrary

+ 0 - 1
MediaBrowser.Api/UserLibrary/GenresService.cs

@@ -8,7 +8,6 @@ using MediaBrowser.Model.Entities;
 using ServiceStack;
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using MediaBrowser.Model.Querying;
 
 namespace MediaBrowser.Api.UserLibrary

+ 1 - 2
MediaBrowser.Api/UserLibrary/ItemsService.cs

@@ -1,5 +1,4 @@
-using MediaBrowser.Controller.Collections;
-using MediaBrowser.Controller.Dto;
+using MediaBrowser.Controller.Dto;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Localization;

+ 0 - 2
MediaBrowser.Api/UserLibrary/MusicGenresService.cs

@@ -8,8 +8,6 @@ using MediaBrowser.Controller.Persistence;
 using MediaBrowser.Model.Dto;
 using ServiceStack;
 using System.Collections.Generic;
-using System.Linq;
-using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Querying;
 
 namespace MediaBrowser.Api.UserLibrary

+ 1 - 4
MediaBrowser.Controller/Channels/Channel.cs

@@ -57,10 +57,7 @@ namespace MediaBrowser.Controller.Channels
             catch
             {
                 // Already logged at lower levels
-                return new QueryResult<BaseItem>
-                {
-
-                };
+                return new QueryResult<BaseItem>();
             }
         }
 

+ 4 - 2
MediaBrowser.Controller/Channels/ChannelMediaInfo.cs

@@ -83,8 +83,7 @@ namespace MediaBrowser.Controller.Channels
         {
             var list = new List<MediaStream>();
 
-            if (!string.IsNullOrWhiteSpace(info.VideoCodec) &&
-                !string.IsNullOrWhiteSpace(info.AudioCodec))
+            if (!string.IsNullOrWhiteSpace(info.VideoCodec))
             {
                 list.Add(new MediaStream
                 {
@@ -99,7 +98,10 @@ namespace MediaBrowser.Controller.Channels
                     BitRate = info.VideoBitrate,
                     AverageFrameRate = info.Framerate
                 });
+            }
 
+            if (!string.IsNullOrWhiteSpace(info.AudioCodec))
+            {
                 list.Add(new MediaStream
                 {
                     Type = MediaStreamType.Audio,

+ 5 - 16
MediaBrowser.Controller/Dto/IDtoService.cs

@@ -1,9 +1,9 @@
-using System;
-using MediaBrowser.Controller.Entities;
+using MediaBrowser.Controller.Entities;
 using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.Querying;
 using System.Collections.Generic;
 using System.Threading.Tasks;
+using MediaBrowser.Controller.Sync;
 
 namespace MediaBrowser.Controller.Dto
 {
@@ -43,14 +43,6 @@ namespace MediaBrowser.Controller.Dto
         /// <returns>Task{BaseItemDto}.</returns>
         BaseItemDto GetBaseItemDto(BaseItem item, List<ItemFields> fields, User user = null, BaseItem owner = null);
 
-        /// <summary>
-        /// Fills the synchronize information.
-        /// </summary>
-        /// <param name="tuples">The tuples.</param>
-        /// <param name="options">The options.</param>
-        /// <param name="user">The user.</param>
-        void FillSyncInfo(IEnumerable<Tuple<BaseItem, BaseItemDto>> tuples, DtoOptions options, User user);
-
         /// <summary>
         /// Gets the base item dto.
         /// </summary>
@@ -89,11 +81,8 @@ namespace MediaBrowser.Controller.Dto
         /// <summary>
         /// Gets the item by name dto.
         /// </summary>
-        /// <param name="item">The item.</param>
-        /// <param name="options">The options.</param>
-        /// <param name="taggedItems">The tagged items.</param>
-        /// <param name="user">The user.</param>
-        /// <returns>BaseItemDto.</returns>
-        BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null);
+        BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, Dictionary<string, SyncedItemProgress> syncProgress, User user = null);
+
+        Dictionary<string, SyncedItemProgress> GetSyncedItemProgress(DtoOptions options);
     }
 }

+ 1 - 5
MediaBrowser.Controller/Entities/Folder.cs

@@ -1,5 +1,4 @@
 using MediaBrowser.Common.Progress;
-using MediaBrowser.Controller.Entities.TV;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Dto;
@@ -919,10 +918,7 @@ namespace MediaBrowser.Controller.Entities
                 catch
                 {
                     // Already logged at lower levels
-                    return new QueryResult<BaseItem>
-                    {
-
-                    };
+                    return new QueryResult<BaseItem>();
                 }
             }
 

+ 1 - 2
MediaBrowser.Controller/Entities/IHasImages.cs

@@ -1,5 +1,4 @@
-using System;
-using MediaBrowser.Controller.Providers;
+using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Entities;
 using System.Collections.Generic;
 using System.Threading;

+ 1 - 2
MediaBrowser.Controller/Entities/IItemByName.cs

@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
 
 namespace MediaBrowser.Controller.Entities
 {

+ 2 - 0
MediaBrowser.Controller/Entities/InternalPeopleQuery.cs

@@ -11,11 +11,13 @@ namespace MediaBrowser.Controller.Entities
         public int? MaxListOrder { get; set; }
         public Guid AppearsInItemId { get; set; }
         public string NameContains { get; set; }
+        public SourceType[] SourceTypes { get; set; }
 
         public InternalPeopleQuery()
         {
             PersonTypes = new List<string>();
             ExcludePersonTypes = new List<string>();
+            SourceTypes = new SourceType[] { };
         }
     }
 }

+ 0 - 1
MediaBrowser.Controller/Entities/MusicVideo.cs

@@ -1,7 +1,6 @@
 using MediaBrowser.Controller.Entities.Audio;
 using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Configuration;
-using MediaBrowser.Model.Entities;
 using System.Collections.Generic;
 using System.Runtime.Serialization;
 

+ 0 - 1
MediaBrowser.Controller/Entities/TV/Season.cs

@@ -1,6 +1,5 @@
 using System;
 using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Querying;
 using MediaBrowser.Model.Users;
 using MoreLinq;

+ 0 - 2
MediaBrowser.Controller/Entities/Trailer.cs

@@ -2,9 +2,7 @@
 using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Entities;
 using System.Collections.Generic;
-using System.Globalization;
 using System.Runtime.Serialization;
-using MediaBrowser.Controller.Entities.Movies;
 using MediaBrowser.Model.Providers;
 
 namespace MediaBrowser.Controller.Entities

+ 0 - 2
MediaBrowser.Controller/Entities/UserRootFolder.cs

@@ -1,6 +1,5 @@
 using System.Runtime.Serialization;
 using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.Library;
 using MediaBrowser.Model.Querying;
 using System;
@@ -8,7 +7,6 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
-using MediaBrowser.Controller.Library;
 
 namespace MediaBrowser.Controller.Entities
 {

+ 0 - 3
MediaBrowser.Controller/Entities/UserViewBuilder.cs

@@ -1,5 +1,4 @@
 using MediaBrowser.Controller.Channels;
-using MediaBrowser.Controller.Collections;
 using MediaBrowser.Controller.Entities.Audio;
 using MediaBrowser.Controller.Entities.Movies;
 using MediaBrowser.Controller.Entities.TV;
@@ -14,12 +13,10 @@ using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Querying;
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Model.Configuration;
 using MoreLinq;
 
 namespace MediaBrowser.Controller.Entities

+ 0 - 6
MediaBrowser.Controller/Library/ILibraryManager.cs

@@ -474,12 +474,6 @@ namespace MediaBrowser.Controller.Library
         /// <returns>List&lt;Person&gt;.</returns>
         List<Person> GetPeopleItems(InternalPeopleQuery query);
 
-        /// <summary>
-        /// Gets all people names.
-        /// </summary>
-        /// <returns>List&lt;System.String&gt;.</returns>
-        List<PersonInfo> GetAllPeople();
-
         /// <summary>
         /// Updates the people.
         /// </summary>

+ 0 - 1
MediaBrowser.Controller/LiveTv/LiveTvProgram.cs

@@ -1,5 +1,4 @@
 using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Entities.Movies;
 using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.LiveTv;

+ 0 - 1
MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs

@@ -1,5 +1,4 @@
 using MediaBrowser.Controller.Entities;
-using MediaBrowser.Controller.Entities.Movies;
 using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.Entities;

+ 1 - 7
MediaBrowser.Controller/LiveTv/TimerEventInfo.cs

@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MediaBrowser.Controller.LiveTv
+namespace MediaBrowser.Controller.LiveTv
 {
     public class TimerEventInfo
     {

+ 1 - 7
MediaBrowser.Controller/LiveTv/TunerChannelMapping.cs

@@ -1,10 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace MediaBrowser.Controller.LiveTv
+namespace MediaBrowser.Controller.LiveTv
 {
     public class TunerChannelMapping
     {

+ 1 - 2
MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs

@@ -1,5 +1,4 @@
-using System.Linq;
-using MediaBrowser.Model.Dlna;
+using MediaBrowser.Model.Dlna;
 
 namespace MediaBrowser.Controller.MediaEncoding
 {

+ 0 - 1
MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs

@@ -1,7 +1,6 @@
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.MediaInfo;
 using System;
-using System.IO;
 using System.Threading;
 using System.Threading.Tasks;
 using MediaBrowser.Model.Dlna;

+ 1 - 1
MediaBrowser.Controller/Sync/ISyncManager.cs

@@ -151,7 +151,7 @@ namespace MediaBrowser.Controller.Sync
         /// </summary>
         /// <param name="query">The query.</param>
         /// <returns>QueryResult&lt;System.String&gt;.</returns>
-        QueryResult<SyncedItemProgress> GetSyncedItemProgresses(SyncJobItemQuery query);
+        Dictionary<string, SyncedItemProgress> GetSyncedItemProgresses(SyncJobItemQuery query);
 
         /// <summary>
         /// Reports the synchronize job item transfer beginning.

+ 3 - 2
MediaBrowser.Controller/Sync/ISyncRepository.cs

@@ -1,4 +1,5 @@
-using MediaBrowser.Model.Querying;
+using System.Collections.Generic;
+using MediaBrowser.Model.Querying;
 using MediaBrowser.Model.Sync;
 using System.Threading.Tasks;
 
@@ -74,6 +75,6 @@ namespace MediaBrowser.Controller.Sync
         /// </summary>
         /// <param name="query">The query.</param>
         /// <returns>QueryResult&lt;System.String&gt;.</returns>
-        QueryResult<SyncedItemProgress> GetSyncedItemProgresses(SyncJobItemQuery query);
+        Dictionary<string, SyncedItemProgress> GetSyncedItemProgresses(SyncJobItemQuery query);
     }
 }

+ 1 - 1
MediaBrowser.Controller/Sync/SyncedItemProgress.cs

@@ -4,7 +4,7 @@ namespace MediaBrowser.Controller.Sync
 {
     public class SyncedItemProgress
     {
-        public string ItemId { get; set; }
+        public double Progress { get; set; }
         public SyncJobItemStatus Status { get; set; }
     }
 }

+ 1 - 17
MediaBrowser.Dlna/Channels/DlnaChannelFactory.cs

@@ -1,20 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using System.Threading.Tasks;
-using MediaBrowser.Common.Net;
-using MediaBrowser.Controller.Channels;
-using MediaBrowser.Controller.Configuration;
-using MediaBrowser.Controller.Dlna;
-using MediaBrowser.Controller.Providers;
-using MediaBrowser.Dlna.ContentDirectory;
-using MediaBrowser.Dlna.PlayTo;
-using MediaBrowser.Model.Channels;
-using MediaBrowser.Model.Entities;
-using MediaBrowser.Model.Logging;
-
-namespace MediaBrowser.Dlna.Channels
+namespace MediaBrowser.Dlna.Channels
 {
     //public class DlnaChannel : IChannel, IDisposable
     //{

+ 1 - 1
MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs

@@ -602,7 +602,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
                 id = id.Substring(paramsIndex + paramsSrch.Length);
 
                 var parts = id.Split(';');
-                id = parts[24];
+                id = parts[23];
             }
 
             if (id.StartsWith("folder_", StringComparison.OrdinalIgnoreCase))

+ 56 - 54
MediaBrowser.Dlna/DlnaManager.cs

@@ -29,7 +29,7 @@ namespace MediaBrowser.Dlna
         private readonly IJsonSerializer _jsonSerializer;
         private readonly IServerApplicationHost _appHost;
 
-        private readonly Dictionary<string, DeviceProfile> _profiles = new Dictionary<string, DeviceProfile>(StringComparer.Ordinal);
+        private readonly Dictionary<string, Tuple<InternalProfileInfo, DeviceProfile>> _profiles = new Dictionary<string, Tuple<InternalProfileInfo, DeviceProfile>>(StringComparer.Ordinal);
 
         public DlnaManager(IXmlSerializer xmlSerializer,
             IFileSystem fileSystem,
@@ -45,50 +45,40 @@ namespace MediaBrowser.Dlna
             _appHost = appHost;
         }
 
-        public IEnumerable<DeviceProfile> GetProfiles()
+        public void InitProfiles()
         {
-            ExtractProfilesIfNeeded();
+            try
+            {
+                ExtractSystemProfiles();
+                LoadProfiles();
+            }
+            catch (Exception ex)
+            {
+                _logger.ErrorException("Error extracting DLNA profiles.", ex);
+            }
+        }
 
+        private void LoadProfiles()
+        {
             var list = GetProfiles(UserProfilesPath, DeviceProfileType.User)
                 .OrderBy(i => i.Name)
                 .ToList();
 
             list.AddRange(GetProfiles(SystemProfilesPath, DeviceProfileType.System)
                 .OrderBy(i => i.Name));
-
-            return list;
         }
 
-        private bool _extracted;
-        private readonly object _syncLock = new object();
-        private void ExtractProfilesIfNeeded()
+        public IEnumerable<DeviceProfile> GetProfiles()
         {
-            if (!_extracted)
+            lock (_profiles)
             {
-                lock (_syncLock)
-                {
-                    if (!_extracted)
-                    {
-                        try
-                        {
-                            ExtractSystemProfiles();
-                        }
-                        catch (Exception ex)
-                        {
-                            _logger.ErrorException("Error extracting DLNA profiles.", ex);
-                        }
-
-                        _extracted = true;
-                    }
-
-                }
+                var list = _profiles.Values.ToList();
+                return list.Select(i => i.Item2).OrderBy(i => i.Name);
             }
         }
 
         public DeviceProfile GetDefaultProfile()
         {
-            ExtractProfilesIfNeeded();
-
             return new DefaultProfile();
         }
 
@@ -304,20 +294,20 @@ namespace MediaBrowser.Dlna
         {
             lock (_profiles)
             {
-                DeviceProfile profile;
-                if (_profiles.TryGetValue(path, out profile))
+                Tuple<InternalProfileInfo, DeviceProfile> profileTuple;
+                if (_profiles.TryGetValue(path, out profileTuple))
                 {
-                    return profile;
+                    return profileTuple.Item2;
                 }
 
                 try
                 {
-                    profile = (DeviceProfile)_xmlSerializer.DeserializeFromFile(typeof(DeviceProfile), path);
+                    var profile = (DeviceProfile)_xmlSerializer.DeserializeFromFile(typeof(DeviceProfile), path);
 
                     profile.Id = path.ToLower().GetMD5().ToString("N");
                     profile.ProfileType = type;
 
-                    _profiles[path] = profile;
+                    _profiles[path] = new Tuple<InternalProfileInfo, DeviceProfile>(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile);
 
                     return profile;
                 }
@@ -344,12 +334,14 @@ namespace MediaBrowser.Dlna
 
         private IEnumerable<InternalProfileInfo> GetProfileInfosInternal()
         {
-            ExtractProfilesIfNeeded();
-
-            return GetProfileInfos(UserProfilesPath, DeviceProfileType.User)
-                .Concat(GetProfileInfos(SystemProfilesPath, DeviceProfileType.System))
-                .OrderBy(i => i.Info.Type == DeviceProfileType.User ? 0 : 1)
-                .ThenBy(i => i.Info.Name);
+            lock (_profiles)
+            {
+                var list = _profiles.Values.ToList();
+                return list
+                    .Select(i => i.Item1)
+                    .OrderBy(i => i.Info.Type == DeviceProfileType.User ? 0 : 1)
+                    .ThenBy(i => i.Info.Name);
+            }
         }
 
         public IEnumerable<DeviceProfileInfo> GetProfileInfos()
@@ -363,17 +355,7 @@ namespace MediaBrowser.Dlna
             {
                 return _fileSystem.GetFiles(path)
                     .Where(i => string.Equals(i.Extension, ".xml", StringComparison.OrdinalIgnoreCase))
-                    .Select(i => new InternalProfileInfo
-                    {
-                        Path = i.FullName,
-
-                        Info = new DeviceProfileInfo
-                        {
-                            Id = i.FullName.ToLower().GetMD5().ToString("N"),
-                            Name = _fileSystem.GetFileNameWithoutExtension(i),
-                            Type = type
-                        }
-                    })
+                    .Select(i => GetInternalProfileInfo(i, type))
                     .ToList();
             }
             catch (DirectoryNotFoundException)
@@ -382,6 +364,21 @@ namespace MediaBrowser.Dlna
             }
         }
 
+        private InternalProfileInfo GetInternalProfileInfo(FileSystemMetadata file, DeviceProfileType type)
+        {
+            return new InternalProfileInfo
+            {
+                Path = file.FullName,
+
+                Info = new DeviceProfileInfo
+                {
+                    Id = file.FullName.ToLower().GetMD5().ToString("N"),
+                    Name = _fileSystem.GetFileNameWithoutExtension(file),
+                    Type = type
+                }
+            };
+        }
+
         private void ExtractSystemProfiles()
         {
             var assembly = GetType().Assembly;
@@ -427,6 +424,11 @@ namespace MediaBrowser.Dlna
             }
 
             _fileSystem.DeleteFile(info.Path);
+
+            lock (_profiles)
+            {
+                _profiles.Remove(info.Path);
+            }
         }
 
         public void CreateProfile(DeviceProfile profile)
@@ -441,7 +443,7 @@ namespace MediaBrowser.Dlna
             var newFilename = _fileSystem.GetValidFilename(profile.Name) + ".xml";
             var path = Path.Combine(UserProfilesPath, newFilename);
 
-            SaveProfile(profile, path);
+            SaveProfile(profile, path, DeviceProfileType.User);
         }
 
         public void UpdateProfile(DeviceProfile profile)
@@ -468,14 +470,14 @@ namespace MediaBrowser.Dlna
                 _fileSystem.DeleteFile(current.Path);
             }
 
-            SaveProfile(profile, path);
+            SaveProfile(profile, path, DeviceProfileType.User);
         }
 
-        private void SaveProfile(DeviceProfile profile, string path)
+        private void SaveProfile(DeviceProfile profile, string path, DeviceProfileType type)
         {
             lock (_profiles)
             {
-                _profiles[path] = profile;
+                _profiles[path] = new Tuple<InternalProfileInfo, DeviceProfile>(GetInternalProfileInfo(_fileSystem.GetFileInfo(path), type), profile);
             }
             _xmlSerializer.SerializeToFile(profile, path);
         }

+ 5 - 5
MediaBrowser.Dlna/Main/DlnaEntryPoint.cs

@@ -14,10 +14,8 @@ using MediaBrowser.Dlna.Ssdp;
 using MediaBrowser.Model.Logging;
 using System;
 using System.Collections.Generic;
-using System.Linq;
 using System.Threading.Tasks;
 using MediaBrowser.Controller.MediaEncoding;
-using MediaBrowser.Dlna.Channels;
 
 namespace MediaBrowser.Dlna.Main
 {
@@ -82,6 +80,8 @@ namespace MediaBrowser.Dlna.Main
 
         public void Run()
         {
+            ((DlnaManager)_dlnaManager).InitProfiles();
+
             ReloadComponents();
 
             _config.ConfigurationUpdated += _config_ConfigurationUpdated;
@@ -242,9 +242,9 @@ namespace MediaBrowser.Dlna.Main
 
                 var services = new List<string>
                 {
-                    "upnp:rootdevice", 
-                    "urn:schemas-upnp-org:device:MediaServer:1", 
-                    "urn:schemas-upnp-org:service:ContentDirectory:1", 
+                    "upnp:rootdevice",
+                    "urn:schemas-upnp-org:device:MediaServer:1",
+                    "urn:schemas-upnp-org:service:ContentDirectory:1",
                     "urn:schemas-upnp-org:service:ConnectionManager:1",
                     "urn:microsoft.com:service:X_MS_MediaReceiverRegistrar:1",
                     "uuid:" + udn

+ 1 - 1
MediaBrowser.Dlna/Profiles/LgTvProfile.cs

@@ -38,7 +38,7 @@ namespace MediaBrowser.Dlna.Profiles
                new TranscodingProfile
                {
                    Container = "ts",
-                   AudioCodec = "ac3",
+                   AudioCodec = "ac3,aac,mp3",
                    VideoCodec = "h264",
                    Type = DlnaProfileType.Video
                },

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/BubbleUPnp.xml

@@ -40,9 +40,9 @@
     <DirectPlayProfile container="" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/Default.xml

@@ -33,9 +33,9 @@
     <DirectPlayProfile container="avi,mp4" type="Video" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/Denon AVR.xml

@@ -37,9 +37,9 @@
     <DirectPlayProfile container="mp3,flac,m4a,wma" type="Audio" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 4 - 2
MediaBrowser.Dlna/Profiles/Xml/DirecTV HD-DVR.xml

@@ -39,8 +39,8 @@
     <DirectPlayProfile container="jpeg,jpg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mpeg" type="Video" videoCodec="mpeg2video" audioCodec="mp2" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mpeg" type="Video" videoCodec="mpeg2video" audioCodec="mp2" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles>
@@ -51,11 +51,13 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="8192000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Audio" codec="mp2">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles />

+ 7 - 3
MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml

@@ -43,9 +43,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="mp4" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="mp4" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles>
@@ -57,6 +57,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video">
       <Conditions>
@@ -65,16 +66,19 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3,he-aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/Kodi.xml

@@ -40,9 +40,9 @@
     <DirectPlayProfile container="" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 6 - 3
MediaBrowser.Dlna/Profiles/Xml/LG Smart TV.xml

@@ -42,9 +42,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3,aac,mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -61,6 +61,7 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="h264">
       <Conditions>
@@ -69,11 +70,13 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3,aac,mp3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles />

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/Linksys DMA2100.xml

@@ -37,9 +37,9 @@
     <DirectPlayProfile container="avi,mp4,mkv,ts" type="Video" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/MediaMonkey.xml

@@ -43,9 +43,9 @@
     <DirectPlayProfile container="ogg" audioCodec="vorbis" type="Audio" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 4 - 3
MediaBrowser.Dlna/Profiles/Xml/Panasonic Viera.xml

@@ -50,9 +50,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -69,6 +69,7 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 8 - 3
MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml

@@ -38,9 +38,9 @@
     <DirectPlayProfile container="jpeg,gif,bmp,png" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="mp4" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="mp4" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles>
@@ -51,6 +51,7 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video">
       <Conditions>
@@ -58,22 +59,26 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Audio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Audio" codec="mp3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="AudioBitrate" value="320000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles />

+ 8 - 3
MediaBrowser.Dlna/Profiles/Xml/Samsung Smart TV.xml

@@ -50,9 +50,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="true" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="true" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -70,6 +70,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="30720000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="mpeg4">
       <Conditions>
@@ -78,6 +79,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="8192000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="h264">
       <Conditions>
@@ -87,6 +89,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="37500000" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="wmv2,wmv3,vc1">
       <Conditions>
@@ -95,11 +98,13 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="25600000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3,wmav2,dca,aac,mp3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 5 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player 2013.xml

@@ -48,9 +48,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -67,11 +67,13 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles />

+ 6 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Blu-ray Player.xml

@@ -47,9 +47,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="mpeg2video" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="mpeg2video" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -68,16 +68,19 @@
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 9 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml

@@ -45,9 +45,9 @@
     <DirectPlayProfile container="mp3" audioCodec="mp3" type="Audio" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -66,6 +66,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="mpeg2video">
       <Conditions>
@@ -74,6 +75,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video">
       <Conditions>
@@ -81,22 +83,26 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
         <ProfileCondition condition="NotEquals" property="AudioProfile" value="he-aac" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="mp3,mp2">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 9 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml

@@ -48,9 +48,9 @@
     <DirectPlayProfile container="asf" audioCodec="wmav2,wmapro,wmavoice" type="Audio" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -69,6 +69,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="mpeg2video">
       <Conditions>
@@ -77,6 +78,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video">
       <Conditions>
@@ -84,22 +86,26 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
         <ProfileCondition condition="NotEquals" property="AudioProfile" value="he-aac" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="mp3,mp2">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 6 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2012).xml

@@ -50,9 +50,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -69,16 +69,19 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="mp3,mp2">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 5 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2013).xml

@@ -55,9 +55,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -74,11 +74,13 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="mp3,mp2">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 5 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2014).xml

@@ -55,9 +55,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3" estimateContentLength="false" enableMpegtsM2TsMode="true" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -74,11 +74,13 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="mp3,mp2">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 7 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 3.xml

@@ -45,9 +45,9 @@
     <DirectPlayProfile container="jpeg,png,gif,bmp,tiff" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3,aac,mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="ac3,aac,mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -66,22 +66,26 @@
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="AudioBitrate" value="640000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="wmapro">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="NotEquals" property="AudioProfile" value="he-aac" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 7 - 3
MediaBrowser.Dlna/Profiles/Xml/Sony PlayStation 4.xml

@@ -45,9 +45,9 @@
     <DirectPlayProfile container="jpeg,png,gif,bmp,tiff" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -66,22 +66,26 @@
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="AudioBitrate" value="640000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="wmapro">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="NotEquals" property="AudioProfile" value="he-aac" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/Vlc.xml

@@ -40,9 +40,9 @@
     <DirectPlayProfile container="" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 5 - 3
MediaBrowser.Dlna/Profiles/Xml/WDTV Live.xml

@@ -51,9 +51,9 @@
     <DirectPlayProfile container="jpeg,png,gif,bmp,tiff" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Photo">
@@ -70,11 +70,13 @@
         <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="true" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 8 - 3
MediaBrowser.Dlna/Profiles/Xml/Xbox 360.xml

@@ -46,9 +46,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="asf" type="Video" videoCodec="wmv2" audioCodec="wmav2" estimateContentLength="true" enableMpegtsM2TsMode="false" transcodeSeekInfo="Bytes" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="asf" type="Video" videoCodec="wmv2" audioCodec="wmav2" estimateContentLength="true" enableMpegtsM2TsMode="false" transcodeSeekInfo="Bytes" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Video" container="mp4,mov">
@@ -71,6 +71,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="5120000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="h264">
       <Conditions>
@@ -79,6 +80,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="10240000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="wmv2,wmv3,vc1">
       <Conditions>
@@ -87,17 +89,20 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3,wmav2,wmapro">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
         <ProfileCondition condition="Equals" property="AudioProfile" value="lc" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 9 - 3
MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml

@@ -46,9 +46,9 @@
     <DirectPlayProfile container="jpeg" type="Photo" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" videoCodec="jpeg" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" videoCodec="jpeg" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles>
     <ContainerProfile type="Video" container="mp4,mov">
@@ -67,6 +67,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="5120000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="h264">
       <Conditions>
@@ -77,6 +78,7 @@
         <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" />
         <ProfileCondition condition="EqualsAny" property="VideoProfile" value="high|main|baseline|constrained baseline" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video" codec="wmv2,wmv3,vc1">
       <Conditions>
@@ -87,23 +89,27 @@
         <ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="Video">
       <Conditions>
         <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
         <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="ac3,wmav2,wmapro">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
     <CodecProfile type="VideoAudio" codec="aac">
       <Conditions>
         <ProfileCondition condition="LessThanEqual" property="AudioChannels" value="2" isRequired="false" />
         <ProfileCondition condition="Equals" property="AudioProfile" value="lc" isRequired="false" />
       </Conditions>
+      <ApplyConditions />
     </CodecProfile>
   </CodecProfiles>
   <ResponseProfiles>

+ 3 - 3
MediaBrowser.Dlna/Profiles/Xml/foobar2000.xml

@@ -43,9 +43,9 @@
     <DirectPlayProfile container="ogg" audioCodec="vorbis" type="Audio" />
   </DirectPlayProfiles>
   <TranscodingProfiles>
-    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
-    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" />
+    <TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
+    <TranscodingProfile container="jpeg" type="Photo" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" copyTimestamps="false" context="Streaming" forceLiveStream="false" enableSubtitlesInManifest="false" />
   </TranscodingProfiles>
   <ContainerProfiles />
   <CodecProfiles />

+ 0 - 1
MediaBrowser.Dlna/Ssdp/SsdpHandler.cs

@@ -6,7 +6,6 @@ using MediaBrowser.Controller.Dlna;
 using MediaBrowser.Dlna.Server;
 using MediaBrowser.Model.Logging;
 using System;
-using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;

+ 0 - 1
MediaBrowser.LocalMetadata/BaseXmlProvider.cs

@@ -1,6 +1,5 @@
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Providers;
-using System;
 using System.IO;
 using System.Threading;
 using System.Threading.Tasks;

+ 1 - 1
MediaBrowser.LocalMetadata/Savers/BoxSetXmlSaver.cs

@@ -65,7 +65,7 @@ namespace MediaBrowser.LocalMetadata.Savers
 
             var xmlFilePath = GetSavePath(item);
 
-            XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { }, _config, _fileSystem);
+            XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>(), _config, _fileSystem);
         }
 
         /// <summary>

+ 1 - 1
MediaBrowser.LocalMetadata/Savers/FolderXmlSaver.cs

@@ -79,7 +79,7 @@ namespace MediaBrowser.LocalMetadata.Savers
 
             var xmlFilePath = GetSavePath(item);
 
-            XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { }, _config, _fileSystem);
+            XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>(), _config, _fileSystem);
         }
 
         /// <summary>

+ 1 - 1
MediaBrowser.LocalMetadata/Savers/GameSystemXmlSaver.cs

@@ -72,7 +72,7 @@ namespace MediaBrowser.LocalMetadata.Savers
 
             var xmlFilePath = GetSavePath(item);
 
-            XmlSaverHelpers.Save(builder, xmlFilePath, new List<string> { }, _config, _fileSystem);
+            XmlSaverHelpers.Save(builder, xmlFilePath, new List<string>(), _config, _fileSystem);
         }
 
         /// <summary>

+ 1 - 1
MediaBrowser.MediaEncoding/BdInfo/BdInfoExaminer.cs

@@ -40,7 +40,7 @@ namespace MediaBrowser.MediaEncoding.BdInfo
 
             outputStream.RunTimeTicks = TimeSpan.FromSeconds(playlist.TotalLength).Ticks;
 
-            var mediaStreams = new List<MediaStream> { };
+            var mediaStreams = new List<MediaStream>();
 
             foreach (var stream in playlist.SortedStreams)
             {

+ 0 - 1
MediaBrowser.MediaEncoding/Encoder/EncoderValidator.cs

@@ -1,7 +1,6 @@
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
-using System.IO;
 using MediaBrowser.Model.Logging;
 
 namespace MediaBrowser.MediaEncoding.Encoder

+ 27 - 18
MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs

@@ -500,7 +500,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     // Must consume both or ffmpeg may hang due to deadlocks. See comments below.   
                     RedirectStandardOutput = true,
                     //RedirectStandardError = true,
-                    RedirectStandardInput = true,
+                    RedirectStandardInput = false,
                     FileName = FFProbePath,
                     Arguments = string.Format(args,
                     probeSizeArgument, inputPath).Trim(),
@@ -514,7 +514,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
 
             _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
 
-            using (var processWrapper = new ProcessWrapper(process, this, _logger))
+            using (var processWrapper = new ProcessWrapper(process, this, _logger, false))
             {
                 await _ffProbeResourcePool.WaitAsync(cancellationToken).ConfigureAwait(false);
 
@@ -630,7 +630,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     // Must consume both or ffmpeg may hang due to deadlocks. See comments below.   
                     //RedirectStandardOutput = true,
                     RedirectStandardError = true,
-                    RedirectStandardInput = true,
+                    RedirectStandardInput = false,
                     FileName = FFMpegPath,
                     Arguments = string.Format(args, probeSizeArgument, inputPath, videoStream.Index.ToString(CultureInfo.InvariantCulture)).Trim(),
 
@@ -644,7 +644,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
             _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
             var idetFoundInterlaced = false;
 
-            using (var processWrapper = new ProcessWrapper(process, this, _logger))
+            using (var processWrapper = new ProcessWrapper(process, this, _logger, false))
             {
                 try
                 {
@@ -898,14 +898,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     FileName = FFMpegPath,
                     Arguments = args,
                     WindowStyle = ProcessWindowStyle.Hidden,
-                    ErrorDialog = false,
-                    RedirectStandardInput = true
+                    ErrorDialog = false
                 }
             };
 
             _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments);
 
-            using (var processWrapper = new ProcessWrapper(process, this, _logger))
+            using (var processWrapper = new ProcessWrapper(process, this, _logger, false))
             {
                 await resourcePool.WaitAsync(cancellationToken).ConfigureAwait(false);
 
@@ -1010,7 +1009,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
 
             bool ranToCompletion = false;
 
-            using (var processWrapper = new ProcessWrapper(process, this, _logger))
+            using (var processWrapper = new ProcessWrapper(process, this, _logger, true))
             {
                 try
                 {
@@ -1118,13 +1117,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
             {
                 _logger.Info("Killing ffmpeg process");
 
-                try
+                if (process.IsRedirectingStdin)
                 {
-                    process.Process.StandardInput.WriteLine("q");
-                }
-                catch (Exception)
-                {
-                    _logger.Error("Error sending q command to process");
+                    try
+                    {
+                        process.Process.StandardInput.WriteLine("q");
+                    }
+                    catch (Exception)
+                    {
+                        _logger.Error("Error sending q command to process");
+                    }
                 }
 
                 try
@@ -1201,13 +1203,15 @@ namespace MediaBrowser.MediaEncoding.Encoder
             public int? ExitCode;
             private readonly MediaEncoder _mediaEncoder;
             private readonly ILogger _logger;
+            public bool IsRedirectingStdin { get; private set; }
 
-            public ProcessWrapper(Process process, MediaEncoder mediaEncoder, ILogger logger)
+            public ProcessWrapper(Process process, MediaEncoder mediaEncoder, ILogger logger, bool isRedirectingStdin)
             {
                 Process = process;
                 _mediaEncoder = mediaEncoder;
                 _logger = logger;
                 Process.Exited += Process_Exited;
+                IsRedirectingStdin = isRedirectingStdin;
             }
 
             void Process_Exited(object sender, EventArgs e)
@@ -1220,7 +1224,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                 {
                     ExitCode = process.ExitCode;
                 }
-                catch (Exception ex)
+                catch
                 {
                 }
 
@@ -1229,11 +1233,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
                     _mediaEncoder._runningProcesses.Remove(this);
                 }
 
+                DisposeProcess(process);
+            }
+
+            private void DisposeProcess(Process process)
+            {
                 try
                 {
                     process.Dispose();
                 }
-                catch (Exception ex)
+                catch
                 {
                 }
             }
@@ -1249,7 +1258,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
                         if (Process != null)
                         {
                             Process.Exited -= Process_Exited;
-                            Process.Dispose();
+                            DisposeProcess(Process);
                         }
                     }
 

+ 7 - 3
MediaBrowser.Model/Dlna/StreamBuilder.cs

@@ -600,18 +600,22 @@ namespace MediaBrowser.Model.Dlna
             {
                 defaultBitrate = 192000;
             }
+            if (!string.IsNullOrEmpty(targetAudioCodec) && audioStream != null && StringHelper.EqualsIgnoreCase(audioStream.Codec, targetAudioCodec))
+            {
+                defaultBitrate = audioStream.BitRate ?? defaultBitrate;
+            }
 
             if (targetAudioChannels.HasValue)
             {
-                if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 2000000)
+                if (targetAudioChannels.Value >= 5 && (maxTotalBitrate ?? 0) >= 1500000)
                 {
                     if (StringHelper.EqualsIgnoreCase(targetAudioCodec, "ac3"))
                     {
-                        defaultBitrate = 448000;
+                        defaultBitrate = Math.Max(448000, defaultBitrate);
                     }
                     else
                     {
-                        defaultBitrate = 320000;
+                        defaultBitrate = Math.Max(320000, defaultBitrate);
                     }
                 }
             }

+ 0 - 1
MediaBrowser.Model/Dto/BaseItemDto.cs

@@ -7,7 +7,6 @@ using MediaBrowser.Model.Providers;
 using MediaBrowser.Model.Sync;
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.Diagnostics;
 using System.Runtime.Serialization;
 

+ 1 - 2
MediaBrowser.Model/Dto/BaseItemPerson.cs

@@ -1,5 +1,4 @@
-using System.ComponentModel;
-using System.Diagnostics;
+using System.Diagnostics;
 using System.Runtime.Serialization;
 
 namespace MediaBrowser.Model.Dto

+ 1 - 0
MediaBrowser.Model/Dto/IHasSyncInfo.cs

@@ -7,6 +7,7 @@ namespace MediaBrowser.Model.Dto
         string Id { get; }
         bool? SupportsSync { get; set; }
         bool? HasSyncJob { get; set; }
+        double? SyncPercent { get; set; }
         bool? IsSynced { get; set; }
         SyncJobItemStatus? SyncStatus { get; set; }
     }

+ 0 - 1
MediaBrowser.Model/Dto/UserDto.cs

@@ -2,7 +2,6 @@
 using MediaBrowser.Model.Connect;
 using MediaBrowser.Model.Users;
 using System;
-using System.ComponentModel;
 using System.Diagnostics;
 using System.Runtime.Serialization;
 

+ 0 - 1
MediaBrowser.Model/Dto/UserItemDataDto.cs

@@ -1,5 +1,4 @@
 using System;
-using System.ComponentModel;
 
 namespace MediaBrowser.Model.Dto
 {

+ 0 - 1
MediaBrowser.Model/LiveTv/ChannelInfoDto.cs

@@ -2,7 +2,6 @@
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Library;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.Diagnostics;
 using System.Runtime.Serialization;
 

+ 1 - 0
MediaBrowser.Model/Querying/ItemFields.cs

@@ -219,6 +219,7 @@
         /// </summary>
         Studios,
 
+        BasicSyncInfo,
         /// <summary>
         /// The synchronize information
         /// </summary>

+ 0 - 1
MediaBrowser.Model/Session/SessionInfoDto.cs

@@ -1,7 +1,6 @@
 using MediaBrowser.Model.Entities;
 using System;
 using System.Collections.Generic;
-using System.ComponentModel;
 using System.Diagnostics;
 
 namespace MediaBrowser.Model.Session

+ 1 - 5
MediaBrowser.Providers/Folders/CollectionFolderMetadataService.cs

@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
 using CommonIO;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Entities;

+ 1 - 7
MediaBrowser.Providers/Manager/MetadataService.cs

@@ -138,7 +138,7 @@ namespace MediaBrowser.Providers.Manager
                 }
             }
 
-            var isFirstRefresh = GetLastRefreshDate(item) == default(DateTime);
+            var isFirstRefresh = item.DateLastRefreshed == default(DateTime);
 
             var beforeSaveResult = await BeforeSave(itemOfType, isFirstRefresh || refreshOptions.ReplaceAllMetadata || refreshOptions.MetadataRefreshMode == MetadataRefreshMode.FullRefresh || requiresRefresh, updateType).ConfigureAwait(false);
             updateType = updateType | beforeSaveResult;
@@ -193,11 +193,6 @@ namespace MediaBrowser.Providers.Manager
             lookupInfo.Year = result.ProductionYear;
         }
 
-        private DateTime GetLastRefreshDate(IHasMetadata item)
-        {
-            return item.DateLastRefreshed;
-        }
-
         protected async Task SaveItem(MetadataResult<TItemType> result, ItemUpdateType reason, CancellationToken cancellationToken)
         {
             if (result.Item.SupportsPeople && result.People != null)
@@ -652,7 +647,6 @@ namespace MediaBrowser.Providers.Manager
                     }
                     else
                     {
-                        refreshResult.Failures++;
                         Logger.Debug("{0} returned no metadata for {1}", providerName, logName);
                     }
                 }

+ 0 - 1
MediaBrowser.Providers/MediaInfo/VideoImageProvider.cs

@@ -10,7 +10,6 @@ using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.MediaInfo;
 using System;
 using System.Collections.Generic;
-using System.IO;
 using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;

+ 0 - 1
MediaBrowser.Providers/Movies/MovieDbProvider.cs

@@ -6,7 +6,6 @@ using MediaBrowser.Controller.Entities.Movies;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Localization;
 using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Logging;
 using MediaBrowser.Model.Providers;

+ 0 - 1
MediaBrowser.Providers/Movies/MovieDbTrailerProvider.cs

@@ -2,7 +2,6 @@
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Providers;
-using System;
 using System.Collections.Generic;
 using System.Threading;
 using System.Threading.Tasks;

+ 0 - 1
MediaBrowser.Providers/Music/FanArtAlbumProvider.cs

@@ -6,7 +6,6 @@ using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Dto;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Providers;
-using MediaBrowser.Providers.TV;
 using System;
 using System.Collections.Generic;
 using System.Globalization;

+ 0 - 2
MediaBrowser.Providers/Omdb/OmdbImageProvider.cs

@@ -10,8 +10,6 @@ using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Providers;
 using MediaBrowser.Model.Serialization;
 using System.Collections.Generic;
-using System.IO;
-using System.Text;
 using System.Threading;
 using System.Threading.Tasks;
 

+ 0 - 1
MediaBrowser.Providers/Omdb/OmdbProvider.cs

@@ -1,5 +1,4 @@
 using CommonIO;
-using MediaBrowser.Common.Configuration;
 using MediaBrowser.Common.Net;
 using MediaBrowser.Controller.Configuration;
 using MediaBrowser.Controller.Entities;

+ 2 - 6
MediaBrowser.Providers/TV/MissingEpisodeProvider.cs

@@ -135,9 +135,7 @@ namespace MediaBrowser.Providers.TV
                 {
                     var directoryService = new DirectoryService(_fileSystem);
 
-                    await series.RefreshMetadata(new MetadataRefreshOptions(directoryService)
-                    {
-                    }, cancellationToken).ConfigureAwait(false);
+                    await series.RefreshMetadata(new MetadataRefreshOptions(directoryService), cancellationToken).ConfigureAwait(false);
 
                     await series.ValidateChildren(new Progress<double>(), cancellationToken, new MetadataRefreshOptions(directoryService), true)
                         .ConfigureAwait(false);
@@ -438,9 +436,7 @@ namespace MediaBrowser.Providers.TV
 
             await season.AddChild(episode, cancellationToken).ConfigureAwait(false);
 
-            await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem)
-            {
-            }, cancellationToken).ConfigureAwait(false);
+            await episode.RefreshMetadata(new MetadataRefreshOptions(_fileSystem), cancellationToken).ConfigureAwait(false);
         }
 
         /// <summary>

+ 0 - 1
MediaBrowser.Providers/TV/Omdb/OmdbEpisodeProvider.cs

@@ -10,7 +10,6 @@ using MediaBrowser.Model.Providers;
 using MediaBrowser.Model.Serialization;
 using MediaBrowser.Providers.Omdb;
 using System.Collections.Generic;
-using System.Linq;
 using System.Threading;
 using System.Threading.Tasks;
 

+ 0 - 1
MediaBrowser.Providers/TV/SeriesPostScanTask.cs

@@ -14,7 +14,6 @@ using CommonIO;
 using MediaBrowser.Common.ScheduledTasks;
 using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Plugins;
-using MediaBrowser.Model.Tasks;
 
 namespace MediaBrowser.Providers.TV
 {

+ 0 - 1
MediaBrowser.Providers/TV/TheTVDB/TvdbEpisodeImageProvider.cs

@@ -6,7 +6,6 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Providers;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.Providers;
-using System;
 using System.Collections.Generic;
 using System.Globalization;
 using System.Linq;

+ 0 - 1
MediaBrowser.Providers/TV/TheTVDB/TvdbSeriesProvider.cs

@@ -5,7 +5,6 @@ using MediaBrowser.Controller.Entities;
 using MediaBrowser.Controller.Entities.TV;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Providers;
-using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Entities;
 using MediaBrowser.Model.IO;
 using MediaBrowser.Model.Logging;

+ 2 - 2
MediaBrowser.Server.Implementations/Channels/ChannelManager.cs

@@ -657,7 +657,7 @@ namespace MediaBrowser.Server.Implementations.Channels
                             _logger.ErrorException("Error getting all media from {0}", ex, i.Name);
                         }
                     }
-                    return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult { });
+                    return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult());
                 });
 
             var results = await Task.WhenAll(tasks).ConfigureAwait(false);
@@ -811,7 +811,7 @@ namespace MediaBrowser.Server.Implementations.Channels
                             _logger.ErrorException("Error getting all media from {0}", ex, i.Name);
                         }
                     }
-                    return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult { });
+                    return new Tuple<IChannel, ChannelItemResult>(i, new ChannelItemResult());
                 });
 
             var results = await Task.WhenAll(tasks).ConfigureAwait(false);

+ 55 - 95
MediaBrowser.Server.Implementations/Dto/DtoService.cs

@@ -11,7 +11,6 @@ using MediaBrowser.Controller.Entities.TV;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Controller.Persistence;
-using MediaBrowser.Controller.Playlists;
 using MediaBrowser.Controller.Providers;
 using MediaBrowser.Controller.Sync;
 using MediaBrowser.Model.Drawing;
@@ -98,16 +97,15 @@ namespace MediaBrowser.Server.Implementations.Dto
                 throw new ArgumentNullException("options");
             }
 
-            var syncJobItems = GetSyncedItemProgress(options);
-            var syncDictionary = GetSyncedItemProgressDictionary(syncJobItems);
+            var syncDictionary = GetSyncedItemProgress(options);
 
             var list = new List<BaseItemDto>();
-            var programTuples = new List<Tuple<BaseItem, BaseItemDto>> { };
-            var channelTuples = new List<Tuple<BaseItemDto, LiveTvChannel>> { };
+            var programTuples = new List<Tuple<BaseItem, BaseItemDto>>();
+            var channelTuples = new List<Tuple<BaseItemDto, LiveTvChannel>>();
 
             foreach (var item in items)
             {
-                var dto = await GetBaseItemDtoInternal(item, options, syncDictionary, user, owner).ConfigureAwait(false);
+                var dto = await GetBaseItemDtoInternal(item, options, user, owner).ConfigureAwait(false);
 
                 var tvChannel = item as LiveTvChannel;
                 if (tvChannel != null)
@@ -134,7 +132,7 @@ namespace MediaBrowser.Server.Implementations.Dto
                     }
                 }
 
-                FillSyncInfo(dto, item, syncJobItems, options, user);
+                FillSyncInfo(dto, item, options, user, syncDictionary);
 
                 list.Add(dto);
             }
@@ -152,23 +150,11 @@ namespace MediaBrowser.Server.Implementations.Dto
             return list;
         }
 
-        private Dictionary<string, SyncedItemProgress> GetSyncedItemProgressDictionary(IEnumerable<SyncedItemProgress> items)
-        {
-            var dict = new Dictionary<string, SyncedItemProgress>();
-
-            foreach (var item in items)
-            {
-                dict[item.ItemId] = item;
-            }
-
-            return dict;
-        }
-
         public BaseItemDto GetBaseItemDto(BaseItem item, DtoOptions options, User user = null, BaseItem owner = null)
         {
-            var syncProgress = GetSyncedItemProgress(options);
+            var syncDictionary = GetSyncedItemProgress(options);
 
-            var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user, owner).Result;
+            var dto = GetBaseItemDtoInternal(item, options, user, owner).Result;
             var tvChannel = item as LiveTvChannel;
             if (tvChannel != null)
             {
@@ -191,11 +177,11 @@ namespace MediaBrowser.Server.Implementations.Dto
                     SetItemByNameInfo(item, dto, GetTaggedItems(byName, user), user);
                 }
 
-                FillSyncInfo(dto, item, options, user, syncProgress);
+                FillSyncInfo(dto, item, options, user, syncDictionary);
                 return dto;
             }
 
-            FillSyncInfo(dto, item, options, user, syncProgress);
+            FillSyncInfo(dto, item, options, user, syncDictionary);
 
             return dto;
         }
@@ -211,23 +197,24 @@ namespace MediaBrowser.Server.Implementations.Dto
             return items;
         }
 
-        private SyncedItemProgress[] GetSyncedItemProgress(DtoOptions options)
+        public Dictionary<string, SyncedItemProgress> GetSyncedItemProgress(DtoOptions options)
         {
-            if (!options.Fields.Contains(ItemFields.SyncInfo))
+            if (!options.Fields.Contains(ItemFields.BasicSyncInfo) &&
+                !options.Fields.Contains(ItemFields.SyncInfo))
             {
-                return new SyncedItemProgress[] { };
+                return new Dictionary<string, SyncedItemProgress>();
             }
 
             var deviceId = options.DeviceId;
             if (string.IsNullOrWhiteSpace(deviceId))
             {
-                return new SyncedItemProgress[] { };
+                return new Dictionary<string, SyncedItemProgress>();
             }
 
             var caps = _deviceManager().GetCapabilities(deviceId);
             if (caps == null || !caps.SupportsSync)
             {
-                return new SyncedItemProgress[] { };
+                return new Dictionary<string, SyncedItemProgress>();
             }
 
             return _syncManager.GetSyncedItemProgresses(new SyncJobItemQuery
@@ -241,12 +228,13 @@ namespace MediaBrowser.Server.Implementations.Dto
                     SyncJobItemStatus.ReadyToTransfer,
                     SyncJobItemStatus.Synced
                 }
-            }).Items;
+            });
         }
 
         public void FillSyncInfo(IEnumerable<Tuple<BaseItem, BaseItemDto>> tuples, DtoOptions options, User user)
         {
-            if (options.Fields.Contains(ItemFields.SyncInfo))
+            if (options.Fields.Contains(ItemFields.BasicSyncInfo) ||
+                options.Fields.Contains(ItemFields.SyncInfo))
             {
                 var syncProgress = GetSyncedItemProgress(options);
 
@@ -254,62 +242,45 @@ namespace MediaBrowser.Server.Implementations.Dto
                 {
                     var item = tuple.Item1;
 
-                    FillSyncInfo(tuple.Item2, item, syncProgress, options, user);
+                    FillSyncInfo(tuple.Item2, item, options, user, syncProgress);
                 }
             }
         }
 
-        private void FillSyncInfo(IHasSyncInfo dto, BaseItem item, DtoOptions options, User user, SyncedItemProgress[] syncProgress)
+        private void FillSyncInfo(IHasSyncInfo dto, BaseItem item, DtoOptions options, User user, Dictionary<string, SyncedItemProgress> syncProgress)
         {
-            if (options.Fields.Contains(ItemFields.SyncInfo))
-            {
-                var userCanSync = user != null && user.Policy.EnableSync;
-                dto.SupportsSync = userCanSync && _syncManager.SupportsSync(item);
-            }
+            var hasFullSyncInfo = options.Fields.Contains(ItemFields.SyncInfo);
 
-            if (dto.SupportsSync ?? false)
+            if (!options.Fields.Contains(ItemFields.BasicSyncInfo) &&
+                !hasFullSyncInfo)
             {
-                dto.HasSyncJob = syncProgress.Any(i => i.Status != SyncJobItemStatus.Synced && string.Equals(i.ItemId, dto.Id, StringComparison.OrdinalIgnoreCase));
-                dto.IsSynced = syncProgress.Any(i => i.Status == SyncJobItemStatus.Synced && string.Equals(i.ItemId, dto.Id, StringComparison.OrdinalIgnoreCase));
-
-                if (dto.IsSynced.Value)
-                {
-                    dto.SyncStatus = SyncJobItemStatus.Synced;
-                }
-
-                else if (dto.HasSyncJob.Value)
-                {
-                    dto.SyncStatus = syncProgress.Where(i => string.Equals(i.ItemId, dto.Id, StringComparison.OrdinalIgnoreCase)).Select(i => i.Status).Max();
-                }
-            }
-        }
-
-        private void FillSyncInfo(IHasSyncInfo dto, BaseItem item, SyncedItemProgress[] syncProgress, DtoOptions options, User user)
-        {
-            if (options.Fields.Contains(ItemFields.SyncInfo))
-            {
-                var userCanSync = user != null && user.Policy.EnableSync;
-                dto.SupportsSync = userCanSync && _syncManager.SupportsSync(item);
+                return;
             }
 
             if (dto.SupportsSync ?? false)
             {
-                dto.HasSyncJob = syncProgress.Any(i => i.Status != SyncJobItemStatus.Synced && string.Equals(i.ItemId, dto.Id, StringComparison.OrdinalIgnoreCase));
-                dto.IsSynced = syncProgress.Any(i => i.Status == SyncJobItemStatus.Synced && string.Equals(i.ItemId, dto.Id, StringComparison.OrdinalIgnoreCase));
-
-                if (dto.IsSynced.Value)
+                SyncedItemProgress syncStatus;
+                if (syncProgress.TryGetValue(dto.Id, out syncStatus))
                 {
-                    dto.SyncStatus = SyncJobItemStatus.Synced;
-                }
+                    if (syncStatus.Status == SyncJobItemStatus.Synced)
+                    {
+                        dto.SyncPercent = 100;
+                    }
+                    else
+                    {
+                        dto.SyncPercent = syncStatus.Progress;
+                    }
 
-                else if (dto.HasSyncJob.Value)
-                {
-                    dto.SyncStatus = syncProgress.Where(i => string.Equals(i.ItemId, dto.Id, StringComparison.OrdinalIgnoreCase)).Select(i => i.Status).Max();
+                    if (hasFullSyncInfo)
+                    {
+                        dto.HasSyncJob = true;
+                        dto.SyncStatus = syncStatus.Status;
+                    }
                 }
             }
         }
 
-        private async Task<BaseItemDto> GetBaseItemDtoInternal(BaseItem item, DtoOptions options, Dictionary<string, SyncedItemProgress> syncProgress, User user = null, BaseItem owner = null)
+        private async Task<BaseItemDto> GetBaseItemDtoInternal(BaseItem item, DtoOptions options, User user = null, BaseItem owner = null)
         {
             var fields = options.Fields;
 
@@ -358,7 +329,7 @@ namespace MediaBrowser.Server.Implementations.Dto
 
             if (user != null)
             {
-                await AttachUserSpecificInfo(dto, item, user, fields, syncProgress).ConfigureAwait(false);
+                await AttachUserSpecificInfo(dto, item, user, fields).ConfigureAwait(false);
             }
 
             var hasMediaSources = item as IHasMediaSources;
@@ -421,11 +392,9 @@ namespace MediaBrowser.Server.Implementations.Dto
             return dto;
         }
 
-        public BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, User user = null)
+        public BaseItemDto GetItemByNameDto(BaseItem item, DtoOptions options, List<BaseItem> taggedItems, Dictionary<string, SyncedItemProgress> syncProgress, User user = null)
         {
-            var syncProgress = GetSyncedItemProgress(options);
-
-            var dto = GetBaseItemDtoInternal(item, options, GetSyncedItemProgressDictionary(syncProgress), user).Result;
+            var dto = GetBaseItemDtoInternal(item, options, user).Result;
 
             if (taggedItems != null && options.Fields.Contains(ItemFields.ItemCounts))
             {
@@ -473,28 +442,13 @@ namespace MediaBrowser.Server.Implementations.Dto
         /// <param name="item">The item.</param>
         /// <param name="user">The user.</param>
         /// <param name="fields">The fields.</param>
-        /// <param name="syncProgress">The synchronize progress.</param>
-        private async Task AttachUserSpecificInfo(BaseItemDto dto, BaseItem item, User user, List<ItemFields> fields, Dictionary<string, SyncedItemProgress> syncProgress)
+        private async Task AttachUserSpecificInfo(BaseItemDto dto, BaseItem item, User user, List<ItemFields> fields)
         {
             if (item.IsFolder)
             {
                 var folder = (Folder)item;
 
-                if (item.SourceType == SourceType.Library && folder.SupportsUserDataFromChildren && fields.Contains(ItemFields.SyncInfo))
-                {
-                    // Skip the user data manager because we've already looped through the recursive tree and don't want to do it twice
-                    // TODO: Improve in future
-                    dto.UserData = GetUserItemDataDto(_userDataRepository.GetUserData(user, item));
-
-                    await SetSpecialCounts(folder, user, dto, fields, syncProgress).ConfigureAwait(false);
-
-                    dto.UserData.Played = dto.UserData.PlayedPercentage.HasValue &&
-                                          dto.UserData.PlayedPercentage.Value >= 100;
-                }
-                else
-                {
-                    dto.UserData = await _userDataRepository.GetUserDataDto(item, dto, user).ConfigureAwait(false);
-                }
+                dto.UserData = await _userDataRepository.GetUserDataDto(item, dto, user).ConfigureAwait(false);
 
                 if (item.SourceType == SourceType.Library)
                 {
@@ -519,6 +473,12 @@ namespace MediaBrowser.Server.Implementations.Dto
 
             dto.PlayAccess = item.GetPlayAccess(user);
 
+            if (fields.Contains(ItemFields.BasicSyncInfo) || fields.Contains(ItemFields.SyncInfo))
+            {
+                var userCanSync = user != null && user.Policy.EnableSync;
+                dto.SupportsSync = userCanSync && _syncManager.SupportsSync(item);
+            }
+
             if (fields.Contains(ItemFields.SeasonUserData))
             {
                 var episode = item as Episode;
@@ -1445,7 +1405,7 @@ namespace MediaBrowser.Server.Implementations.Dto
             BaseItem parent = null;
             var isFirst = true;
 
-            while (((!dto.HasLogo && logoLimit > 0) || (!dto.HasArtImage && artLimit > 0) || (!dto.HasThumb && thumbLimit > 0) || parent is Series) && 
+            while (((!dto.HasLogo && logoLimit > 0) || (!dto.HasArtImage && artLimit > 0) || (!dto.HasThumb && thumbLimit > 0) || parent is Series) &&
                 (parent = parent ?? (isFirst ? item.GetParent() ?? owner : parent)) != null)
             {
                 if (parent == null)
@@ -1552,7 +1512,7 @@ namespace MediaBrowser.Server.Implementations.Dto
         /// <param name="fields">The fields.</param>
         /// <param name="syncProgress">The synchronize progress.</param>
         /// <returns>Task.</returns>
-        private async Task SetSpecialCounts(Folder folder, User user, BaseItemDto dto, List<ItemFields> fields, Dictionary<string, SyncedItemProgress> syncProgress)
+        private async Task SetSpecialCounts(Folder folder, User user, BaseItemDto dto, List<ItemFields> fields, Dictionary<string, SyncJobItemStatus> syncProgress)
         {
             var recursiveItemCount = 0;
             var unplayed = 0;
@@ -1601,10 +1561,10 @@ namespace MediaBrowser.Server.Implementations.Dto
                 }
 
                 double percent = 0;
-                SyncedItemProgress syncItemProgress;
+                SyncJobItemStatus syncItemProgress;
                 if (syncProgress.TryGetValue(child.Id.ToString("N"), out syncItemProgress))
                 {
-                    switch (syncItemProgress.Status)
+                    switch (syncItemProgress)
                     {
                         case SyncJobItemStatus.Synced:
                             percent = 100;

+ 0 - 2
MediaBrowser.Server.Implementations/EntryPoints/ExternalPortForwarding.cs

@@ -7,9 +7,7 @@ using Mono.Nat;
 using System;
 using System.Collections.Generic;
 using System.Globalization;
-using System.IO;
 using System.Net;
-using System.Text;
 using MediaBrowser.Common.Threading;
 
 namespace MediaBrowser.Server.Implementations.EntryPoints

+ 0 - 3
MediaBrowser.Server.Implementations/EntryPoints/RecordingNotifier.cs

@@ -1,9 +1,6 @@
 using System;
-using System.Collections.Generic;
 using System.Linq;
-using System.Text;
 using System.Threading;
-using System.Threading.Tasks;
 using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.LiveTv;
 using MediaBrowser.Controller.Plugins;

+ 2 - 1
MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs

@@ -67,6 +67,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
         public override void Configure(Container container)
         {
             HostConfig.Instance.DefaultRedirectPath = DefaultRedirectPath;
+            HostConfig.Instance.LogUnobservedTaskExceptions = false;
 
             HostConfig.Instance.MapExceptionToStatusCode = new Dictionary<Type, int>
             {
@@ -80,7 +81,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
                 {typeof (ApplicationException), 500}
             };
 
-            HostConfig.Instance.DebugMode = true;
+            HostConfig.Instance.DebugMode = false;
 
             HostConfig.Instance.LogFactory = LogManager.LogFactory;
 

+ 0 - 2
MediaBrowser.Server.Implementations/IO/LibraryMonitor.cs

@@ -5,14 +5,12 @@ using MediaBrowser.Controller.Library;
 using MediaBrowser.Controller.Plugins;
 using MediaBrowser.Model.Configuration;
 using MediaBrowser.Model.Logging;
-using MediaBrowser.Server.Implementations.ScheduledTasks;
 using Microsoft.Win32;
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
 using System.IO;
 using System.Linq;
-using System.Threading;
 using System.Threading.Tasks;
 using CommonIO;
 using MediaBrowser.Controller;

+ 0 - 7
MediaBrowser.Server.Implementations/Library/LibraryManager.cs

@@ -2605,13 +2605,6 @@ namespace MediaBrowser.Server.Implementations.Library
             return ItemRepository.GetPeopleNames(query);
         }
 
-        public List<PersonInfo> GetAllPeople()
-        {
-            return GetPeople(new InternalPeopleQuery())
-                .DistinctBy(i => i.Name, StringComparer.OrdinalIgnoreCase)
-                .ToList();
-        }
-
         public Task UpdatePeople(BaseItem item, List<PersonInfo> people)
         {
             if (!item.SupportsPeople)

Некоторые файлы не были показаны из-за большого количества измененных файлов