diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-18 01:03:01 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-04-18 01:03:01 -0400 |
| commit | 7f320ce0638cd3c26b45bb75184d526f03b18651 (patch) | |
| tree | 7af43a7b7006f10ae78e933c79df6b66978c49c3 /MediaBrowser.Server.Implementations/Dto | |
| parent | 818d7990915ef8970a95a226aa4be1851ba3b9e6 (diff) | |
add basic dlna server browsing
Diffstat (limited to 'MediaBrowser.Server.Implementations/Dto')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Dto/DtoService.cs | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/MediaBrowser.Server.Implementations/Dto/DtoService.cs b/MediaBrowser.Server.Implementations/Dto/DtoService.cs index b625c2d511..166d26b3c6 100644 --- a/MediaBrowser.Server.Implementations/Dto/DtoService.cs +++ b/MediaBrowser.Server.Implementations/Dto/DtoService.cs @@ -1234,15 +1234,21 @@ namespace MediaBrowser.Server.Implementations.Dto Path = GetMappedPath(i), RunTimeTicks = i.RunTimeTicks, Video3DFormat = i.Video3DFormat, - VideoType = i.VideoType + VideoType = i.VideoType, + Container = i.Container, + Size = i.Size, + Formats = (i.FormatName ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() }; - if (i.VideoType == VideoType.VideoFile || i.VideoType == VideoType.Iso) + if (string.IsNullOrEmpty(info.Container)) { - var locationType = i.LocationType; - if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual) + if (i.VideoType == VideoType.VideoFile || i.VideoType == VideoType.Iso) { - info.Container = Path.GetExtension(i.Path).TrimStart('.'); + var locationType = i.LocationType; + if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual) + { + info.Container = Path.GetExtension(i.Path).TrimStart('.'); + } } } @@ -1265,13 +1271,19 @@ namespace MediaBrowser.Server.Implementations.Dto MediaStreams = _itemRepo.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id }).ToList(), Name = i.Name, Path = GetMappedPath(i), - RunTimeTicks = i.RunTimeTicks + RunTimeTicks = i.RunTimeTicks, + Container = i.Container, + Size = i.Size, + Formats = (i.FormatName ?? string.Empty).Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).ToList() }; - var locationType = i.LocationType; - if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual) + if (string.IsNullOrEmpty(info.Container)) { - info.Container = Path.GetExtension(i.Path).TrimStart('.'); + var locationType = i.LocationType; + if (!string.IsNullOrWhiteSpace(i.Path) && locationType != LocationType.Remote && locationType != LocationType.Virtual) + { + info.Container = Path.GetExtension(i.Path).TrimStart('.'); + } } var bitrate = info.MediaStreams.Where(m => m.Type == MediaStreamType.Audio).Select(m => m.BitRate ?? 0).Sum(); |
