Skip to content

Commit

Permalink
Merge pull request #3032 from MediaBrowser/beta
Browse files Browse the repository at this point in the history
Beta
  • Loading branch information
LukePulverenti authored Nov 20, 2017
2 parents e63840d + 21db7ac commit 57623a2
Show file tree
Hide file tree
Showing 324 changed files with 4,085 additions and 4,067 deletions.
53 changes: 41 additions & 12 deletions Emby.Dlna/ContentDirectory/ControlHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -491,18 +491,27 @@ private QueryResult<ServerItem> GetUserItems(BaseItem item, StubType? stubType,
return GetGenreItems(item, null, user, sort, startIndex, limit);
}

var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
if (!stubType.HasValue || stubType.Value != StubType.Folder)
{
return GetMusicFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.Movies, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMovieFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.TvShows, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetTvFolders(item, user, stubType, sort, startIndex, limit);
var collectionFolder = item as ICollectionFolder;
if (collectionFolder != null && string.Equals(CollectionType.Music, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMusicFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.Movies, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetMovieFolders(item, user, stubType, sort, startIndex, limit);
}
if (collectionFolder != null && string.Equals(CollectionType.TvShows, collectionFolder.CollectionType, StringComparison.OrdinalIgnoreCase))
{
return GetTvFolders(item, user, stubType, sort, startIndex, limit);
}

var userView = item as UserView;
if (userView != null && string.Equals(CollectionType.Folders, userView.ViewType, StringComparison.OrdinalIgnoreCase))
{
return GetFolders(item, user, stubType, sort, startIndex, limit);
}
}

if (stubType.HasValue)
Expand All @@ -513,7 +522,10 @@ private QueryResult<ServerItem> GetUserItems(BaseItem item, StubType? stubType,
return GetItemsFromPerson(person, user, startIndex, limit);
}

return ApplyPaging(new QueryResult<ServerItem>(), startIndex, limit);
if (stubType.Value != StubType.Folder)
{
return ApplyPaging(new QueryResult<ServerItem>(), startIndex, limit);
}
}

var folder = (Folder)item;
Expand Down Expand Up @@ -733,6 +745,23 @@ private QueryResult<ServerItem> GetMovieFolders(BaseItem item, User user, StubTy
};
}

private QueryResult<ServerItem> GetFolders(BaseItem item, User user, StubType? stubType, SortCriteria sort, int? startIndex, int? limit)
{
var folders = user.RootFolder.GetChildren(user, true)
.OrderBy(i => i.SortName)
.Select(i => new ServerItem(i)
{
StubType = StubType.Folder
})
.ToArray();

return new QueryResult<ServerItem>
{
Items = folders,
TotalRecordCount = folders.Length
};
}

private QueryResult<ServerItem> GetTvFolders(BaseItem item, User user, StubType? stubType, SortCriteria sort, int? startIndex, int? limit)
{
var query = new InternalItemsQuery(user)
Expand Down
1 change: 0 additions & 1 deletion Emby.Dlna/DlnaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,6 @@ private void DumpProfiles()
var list = new List<DeviceProfile>
{
new SamsungSmartTvProfile(),
new Xbox360Profile(),
new XboxOneProfile(),
new SonyPs3Profile(),
new SonyPs4Profile(),
Expand Down
2 changes: 0 additions & 2 deletions Emby.Dlna/Emby.Dlna.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@
<Compile Include="Profiles\SonyPs3Profile.cs" />
<Compile Include="Profiles\SonyPs4Profile.cs" />
<Compile Include="Profiles\WdtvLiveProfile.cs" />
<Compile Include="Profiles\Xbox360Profile.cs" />
<Compile Include="Profiles\XboxOneProfile.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Server\DescriptionXmlBuilder.cs" />
Expand Down Expand Up @@ -175,7 +174,6 @@
<EmbeddedResource Include="Profiles\Xml\Sony PlayStation 3.xml" />
<EmbeddedResource Include="Profiles\Xml\Sony PlayStation 4.xml" />
<EmbeddedResource Include="Profiles\Xml\WDTV Live.xml" />
<EmbeddedResource Include="Profiles\Xml\Xbox 360.xml" />
<EmbeddedResource Include="Profiles\Xml\Xbox One.xml" />
</ItemGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Emby.Dlna/PlayTo/PlayToController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ public async Task SendPlayCommand(PlayRequest command, CancellationToken cancell
{
if (isFirst && command.StartPositionTicks.HasValue)
{
playlist.Add(CreatePlaylistItem(item, user, command.StartPositionTicks.Value, null, null, null));
playlist.Add(CreatePlaylistItem(item, user, command.StartPositionTicks.Value, command.MediaSourceId, command.AudioStreamIndex, command.SubtitleStreamIndex));
isFirst = false;
}
else
Expand Down
6 changes: 4 additions & 2 deletions Emby.Dlna/Profiles/DefaultProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,15 @@ public DefaultProfile()
{
new DirectPlayProfile
{
Container = "m4v,mpegts,ts,3gp,mov,xvid,vob,mkv,wmv,asf,ogm,ogv,m2v,avi,mpg,mpeg,mp4,webm,wtv,m2ts,dvr-ms",
// play all
Container = "",
Type = DlnaProfileType.Video
},

new DirectPlayProfile
{
Container = "aac,mp3,mpa,wav,wma,mp2,ogg,oga,webma,ape,opus,flac,m4a",
// play all
Container = "",
Type = DlnaProfileType.Audio
}
};
Expand Down
10 changes: 5 additions & 5 deletions Emby.Dlna/Profiles/WdtvLiveProfile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,39 +58,39 @@ public WdtvLiveProfile()
Container = "avi",
Type = DlnaProfileType.Video,
VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
AudioCodec = "ac3,dca,mp2,mp3,pcm,dts"
AudioCodec = "ac3,eac3,dca,mp2,mp3,pcm,dts"
},

new DirectPlayProfile
{
Container = "mpeg",
Type = DlnaProfileType.Video,
VideoCodec = "mpeg1video,mpeg2video",
AudioCodec = "ac3,dca,mp2,mp3,pcm,dts"
AudioCodec = "ac3,eac3,dca,mp2,mp3,pcm,dts"
},

new DirectPlayProfile
{
Container = "mkv",
Type = DlnaProfileType.Video,
VideoCodec = "mpeg1video,mpeg2video,mpeg4,h264,vc1",
AudioCodec = "ac3,dca,aac,mp2,mp3,pcm,dts"
AudioCodec = "ac3,eac3,dca,aac,mp2,mp3,pcm,dts"
},

new DirectPlayProfile
{
Container = "ts,m2ts",
Type = DlnaProfileType.Video,
VideoCodec = "mpeg1video,mpeg2video,h264,vc1",
AudioCodec = "ac3,dca,mp2,mp3,aac,dts"
AudioCodec = "ac3,eac3,dca,mp2,mp3,aac,dts"
},

new DirectPlayProfile
{
Container = "mp4,mov,m4v",
Type = DlnaProfileType.Video,
VideoCodec = "h264,mpeg4",
AudioCodec = "ac3,aac,mp2,mp3,dca,dts"
AudioCodec = "ac3,eac3,aac,mp2,mp3,dca,dts"
},

new DirectPlayProfile
Expand Down
Loading

0 comments on commit 57623a2

Please sign in to comment.