Skip to content

Commit 9101634

Browse files
Merge pull request #3316 from MediaBrowser/dev
3.4.1.14
2 parents 6d5fbe7 + c3d39d5 commit 9101634

File tree

126 files changed

+554
-627
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

126 files changed

+554
-627
lines changed

BDInfo/BDInfo.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
</PropertyGroup>
3535
<ItemGroup>
3636
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
37-
<HintPath>..\packages\MediaBrowser.Common.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
37+
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
3838
</Reference>
3939
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
40-
<HintPath>..\packages\MediaBrowser.Common.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
40+
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
4141
</Reference>
4242
<Reference Include="System" />
4343
<Reference Include="System.Configuration" />

BDInfo/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="MediaBrowser.Common" version="3.3.47-beta" targetFramework="net47" />
3+
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
44
</packages>

DvdLib/DvdLib.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@
4949
<Compile Include="Ifo\VideoAttributes.cs" />
5050
<Compile Include="Properties\AssemblyInfo.cs" />
5151
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
52-
<HintPath>..\packages\MediaBrowser.Common.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
52+
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
5353
</Reference>
5454
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
55-
<HintPath>..\packages\MediaBrowser.Common.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
55+
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
5656
</Reference>
5757
<Reference Include="System" />
5858
<Reference Include="System.Configuration" />

DvdLib/packages.config

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="MediaBrowser.Common" version="3.3.47-beta" targetFramework="net47" />
3+
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
44
</packages>

Emby.Dlna/ContentDirectory/ControlHandler.cs

+13-13
Original file line numberDiff line numberDiff line change
@@ -481,17 +481,17 @@ private QueryResult<ServerItem> GetUserItems(BaseItem item, StubType? stubType,
481481
{
482482
if (item is MusicGenre)
483483
{
484-
return GetMusicGenreItems(item, null, user, sort, startIndex, limit);
484+
return GetMusicGenreItems(item, Guid.Empty, user, sort, startIndex, limit);
485485
}
486486

487487
if (item is MusicArtist)
488488
{
489-
return GetMusicArtistItems(item, null, user, sort, startIndex, limit);
489+
return GetMusicArtistItems(item, Guid.Empty, user, sort, startIndex, limit);
490490
}
491491

492492
if (item is Genre)
493493
{
494-
return GetGenreItems(item, null, user, sort, startIndex, limit);
494+
return GetGenreItems(item, Guid.Empty, user, sort, startIndex, limit);
495495
}
496496

497497
if (!stubType.HasValue || stubType.Value != StubType.Folder)
@@ -1124,10 +1124,10 @@ private QueryResult<ServerItem> GetMusicLatest(BaseItem parent, User user, Inter
11241124

11251125
var items = _userViewManager.GetLatestItems(new LatestItemsQuery
11261126
{
1127-
UserId = user.Id.ToString("N"),
1127+
UserId = user.Id,
11281128
Limit = 50,
11291129
IncludeItemTypes = new[] { typeof(Audio).Name },
1130-
ParentId = parent == null ? null : parent.Id.ToString("N"),
1130+
ParentId = parent == null ? Guid.Empty : parent.Id,
11311131
GroupItems = true
11321132

11331133
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToArray();
@@ -1143,7 +1143,7 @@ private QueryResult<ServerItem> GetNextUp(BaseItem parent, User user, InternalIt
11431143
{
11441144
Limit = query.Limit,
11451145
StartIndex = query.StartIndex,
1146-
UserId = query.User.Id.ToString("N")
1146+
UserId = query.User.Id
11471147

11481148
}, new [] { parent }, query.DtoOptions);
11491149

@@ -1156,10 +1156,10 @@ private QueryResult<ServerItem> GetTvLatest(BaseItem parent, User user, Internal
11561156

11571157
var items = _userViewManager.GetLatestItems(new LatestItemsQuery
11581158
{
1159-
UserId = user.Id.ToString("N"),
1159+
UserId = user.Id,
11601160
Limit = 50,
11611161
IncludeItemTypes = new[] { typeof(Episode).Name },
1162-
ParentId = parent == null ? null : parent.Id.ToString("N"),
1162+
ParentId = parent == null ? Guid.Empty : parent.Id,
11631163
GroupItems = false
11641164

11651165
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToArray();
@@ -1173,18 +1173,18 @@ private QueryResult<ServerItem> GetMovieLatest(BaseItem parent, User user, Inter
11731173

11741174
var items = _userViewManager.GetLatestItems(new LatestItemsQuery
11751175
{
1176-
UserId = user.Id.ToString("N"),
1176+
UserId = user.Id,
11771177
Limit = 50,
11781178
IncludeItemTypes = new[] { typeof(Movie).Name },
1179-
ParentId = parent == null ? null : parent.Id.ToString("N"),
1179+
ParentId = parent == null ? Guid.Empty : parent.Id,
11801180
GroupItems = true
11811181

11821182
}, query.DtoOptions).Select(i => i.Item1 ?? i.Item2.FirstOrDefault()).Where(i => i != null).ToArray();
11831183

11841184
return ToResult(items);
11851185
}
11861186

1187-
private QueryResult<ServerItem> GetMusicArtistItems(BaseItem item, Guid? parentId, User user, SortCriteria sort, int? startIndex, int? limit)
1187+
private QueryResult<ServerItem> GetMusicArtistItems(BaseItem item, Guid parentId, User user, SortCriteria sort, int? startIndex, int? limit)
11881188
{
11891189
var query = new InternalItemsQuery(user)
11901190
{
@@ -1204,7 +1204,7 @@ private QueryResult<ServerItem> GetMusicArtistItems(BaseItem item, Guid? parentI
12041204
return ToResult(result);
12051205
}
12061206

1207-
private QueryResult<ServerItem> GetGenreItems(BaseItem item, Guid? parentId, User user, SortCriteria sort, int? startIndex, int? limit)
1207+
private QueryResult<ServerItem> GetGenreItems(BaseItem item, Guid parentId, User user, SortCriteria sort, int? startIndex, int? limit)
12081208
{
12091209
var query = new InternalItemsQuery(user)
12101210
{
@@ -1224,7 +1224,7 @@ private QueryResult<ServerItem> GetGenreItems(BaseItem item, Guid? parentId, Use
12241224
return ToResult(result);
12251225
}
12261226

1227-
private QueryResult<ServerItem> GetMusicGenreItems(BaseItem item, Guid? parentId, User user, SortCriteria sort, int? startIndex, int? limit)
1227+
private QueryResult<ServerItem> GetMusicGenreItems(BaseItem item, Guid parentId, User user, SortCriteria sort, int? startIndex, int? limit)
12281228
{
12291229
var query = new InternalItemsQuery(user)
12301230
{

Emby.Dlna/Didl/DidlBuilder.cs

+9-16
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ public void WriteItemElement(DlnaOptions options,
142142
else
143143
{
144144
var parent = item.DisplayParentId;
145-
if (parent.HasValue)
145+
if (!parent.Equals(Guid.Empty))
146146
{
147-
writer.WriteAttributeString("parentID", GetClientId(parent.Value, null));
147+
writer.WriteAttributeString("parentID", GetClientId(parent, null));
148148
}
149149
}
150150

@@ -204,7 +204,7 @@ private void AddVideoResource(DlnaOptions options, XmlWriter writer, BaseItem vi
204204

205205
streamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger(options)).BuildVideoItem(new VideoOptions
206206
{
207-
ItemId = GetClientId(video),
207+
ItemId = video.Id,
208208
MediaSources = sources.ToArray(sources.Count),
209209
Profile = _profile,
210210
DeviceId = deviceId,
@@ -517,7 +517,7 @@ private void AddAudioResource(DlnaOptions options, XmlWriter writer, BaseItem au
517517

518518
streamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger(options)).BuildAudioItem(new AudioOptions
519519
{
520-
ItemId = GetClientId(audio),
520+
ItemId = audio.Id,
521521
MediaSources = sources.ToArray(sources.Count),
522522
Profile = _profile,
523523
DeviceId = deviceId
@@ -641,13 +641,13 @@ public void WriteFolderElement(XmlWriter writer, BaseItem folder, StubType? stub
641641
else
642642
{
643643
var parent = folder.DisplayParentId;
644-
if (!parent.HasValue)
644+
if (parent.Equals(Guid.Empty))
645645
{
646646
writer.WriteAttributeString("parentID", "0");
647647
}
648648
else
649649
{
650-
writer.WriteAttributeString("parentID", GetClientId(parent.Value, null));
650+
writer.WriteAttributeString("parentID", GetClientId(parent, null));
651651
}
652652
}
653653
}
@@ -1138,7 +1138,7 @@ private ImageDownloadInfo GetImageInfo(BaseItem item, ImageType type)
11381138

11391139
return new ImageDownloadInfo
11401140
{
1141-
ItemId = item.Id.ToString("N"),
1141+
ItemId = item.Id,
11421142
Type = type,
11431143
ImageTag = tag,
11441144
Width = width,
@@ -1150,7 +1150,7 @@ private ImageDownloadInfo GetImageInfo(BaseItem item, ImageType type)
11501150

11511151
class ImageDownloadInfo
11521152
{
1153-
internal string ItemId;
1153+
internal Guid ItemId;
11541154
internal string ImageTag;
11551155
internal ImageType Type;
11561156

@@ -1189,18 +1189,11 @@ public static string GetClientId(Guid idValue, StubType? stubType)
11891189
return id;
11901190
}
11911191

1192-
public static string GetClientId(BaseItem item)
1193-
{
1194-
var id = item.Id.ToString("N");
1195-
1196-
return id;
1197-
}
1198-
11991192
private ImageUrlInfo GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, string format)
12001193
{
12011194
var url = string.Format("{0}/Items/{1}/Images/{2}/0/{3}/{4}/{5}/{6}/0/0",
12021195
_serverAddress,
1203-
info.ItemId,
1196+
info.ItemId.ToString("N"),
12041197
info.Type,
12051198
info.ImageTag,
12061199
format,

Emby.Dlna/Emby.Dlna.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -174,13 +174,13 @@
174174
</ItemGroup>
175175
<ItemGroup>
176176
<Reference Include="MediaBrowser.Common, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
177-
<HintPath>..\packages\MediaBrowser.Common.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
177+
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Common.dll</HintPath>
178178
</Reference>
179179
<Reference Include="MediaBrowser.Controller, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
180-
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
180+
<HintPath>..\packages\MediaBrowser.Server.Core.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Controller.dll</HintPath>
181181
</Reference>
182182
<Reference Include="MediaBrowser.Model, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
183-
<HintPath>..\packages\MediaBrowser.Common.3.3.47-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
183+
<HintPath>..\packages\MediaBrowser.Common.3.3.48-beta\lib\netstandard2.0\MediaBrowser.Model.dll</HintPath>
184184
</Reference>
185185
<Reference Include="System" />
186186
<Reference Include="System.Configuration" />

Emby.Dlna/PlayTo/PlayToController.cs

+16-20
Original file line numberDiff line numberDiff line change
@@ -321,12 +321,12 @@ public async Task SendPlayCommand(PlayRequest command, CancellationToken cancell
321321
{
322322
_logger.Debug("{0} - Received PlayRequest: {1}", this._session.DeviceName, command.PlayCommand);
323323

324-
var user = String.IsNullOrEmpty(command.ControllingUserId) ? null : _userManager.GetUserById(command.ControllingUserId);
324+
var user = command.ControllingUserId.Equals(Guid.Empty) ? null : _userManager.GetUserById(command.ControllingUserId);
325325

326326
var items = new List<BaseItem>();
327-
foreach (string id in command.ItemIds)
327+
foreach (var id in command.ItemIds)
328328
{
329-
AddItemFromId(Guid.Parse(id), items);
329+
AddItemFromId(id, items);
330330
}
331331

332332
var startIndex = command.StartIndex ?? 0;
@@ -362,9 +362,9 @@ public async Task SendPlayCommand(PlayRequest command, CancellationToken cancell
362362
Playlist.AddRange(playlist);
363363
}
364364

365-
if (!String.IsNullOrEmpty(command.ControllingUserId))
365+
if (!command.ControllingUserId.Equals(Guid.Empty))
366366
{
367-
_sessionManager.LogSessionActivity(_session.AppName, _session.ApplicationVersion, _session.DeviceId,
367+
_sessionManager.LogSessionActivity(_session.Client, _session.ApplicationVersion, _session.DeviceId,
368368
_session.DeviceName, _session.RemoteEndPoint, user);
369369
}
370370

@@ -413,7 +413,7 @@ private async Task Seek(long newPosition)
413413

414414
if (info.Item != null && !EnableClientSideSeek(info))
415415
{
416-
var user = _session.UserId.HasValue ? _userManager.GetUserById(_session.UserId.Value) : null;
416+
var user = !_session.UserId.Equals(Guid.Empty) ? _userManager.GetUserById(_session.UserId) : null;
417417
var newItem = CreatePlaylistItem(info.Item, user, newPosition, info.MediaSourceId, info.AudioStreamIndex, info.SubtitleStreamIndex);
418418

419419
await _device.SetAvTransport(newItem.StreamUrl, GetDlnaHeaders(newItem), newItem.Didl, CancellationToken.None).ConfigureAwait(false);
@@ -550,7 +550,7 @@ private PlaylistItem GetPlaylistItem(BaseItem item, List<MediaSourceInfo> mediaS
550550
{
551551
StreamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger()).BuildVideoItem(new VideoOptions
552552
{
553-
ItemId = item.Id.ToString("N"),
553+
ItemId = item.Id,
554554
MediaSources = mediaSources.ToArray(mediaSources.Count),
555555
Profile = profile,
556556
DeviceId = deviceId,
@@ -570,7 +570,7 @@ private PlaylistItem GetPlaylistItem(BaseItem item, List<MediaSourceInfo> mediaS
570570
{
571571
StreamInfo = new StreamBuilder(_mediaEncoder, GetStreamBuilderLogger()).BuildAudioItem(new AudioOptions
572572
{
573-
ItemId = item.Id.ToString("N"),
573+
ItemId = item.Id,
574574
MediaSources = mediaSources.ToArray(mediaSources.Count),
575575
Profile = profile,
576576
DeviceId = deviceId,
@@ -741,7 +741,7 @@ private async Task SetAudioStreamIndex(int? newIndex)
741741
{
742742
var newPosition = GetProgressPositionTicks(media, info) ?? 0;
743743

744-
var user = _session.UserId.HasValue ? _userManager.GetUserById(_session.UserId.Value) : null;
744+
var user = !_session.UserId.Equals(Guid.Empty) ? _userManager.GetUserById(_session.UserId) : null;
745745
var newItem = CreatePlaylistItem(info.Item, user, newPosition, info.MediaSourceId, newIndex, info.SubtitleStreamIndex);
746746

747747
await _device.SetAvTransport(newItem.StreamUrl, GetDlnaHeaders(newItem), newItem.Didl, CancellationToken.None).ConfigureAwait(false);
@@ -766,7 +766,7 @@ private async Task SetSubtitleStreamIndex(int? newIndex)
766766
{
767767
var newPosition = GetProgressPositionTicks(media, info) ?? 0;
768768

769-
var user = _session.UserId.HasValue ? _userManager.GetUserById(_session.UserId.Value) : null;
769+
var user = !_session.UserId.Equals(Guid.Empty) ? _userManager.GetUserById(_session.UserId) : null;
770770
var newItem = CreatePlaylistItem(info.Item, user, newPosition, info.MediaSourceId, info.AudioStreamIndex, newIndex);
771771

772772
await _device.SetAvTransport(newItem.StreamUrl, GetDlnaHeaders(newItem), newItem.Didl, CancellationToken.None).ConfigureAwait(false);
@@ -795,7 +795,7 @@ private async Task SeekAfterTransportChange(long positionTicks, CancellationToke
795795

796796
private class StreamParams
797797
{
798-
public string ItemId { get; set; }
798+
public Guid ItemId { get; set; }
799799

800800
public bool IsDirectStream { get; set; }
801801

@@ -835,7 +835,7 @@ public async Task<MediaSourceInfo> GetMediaSource(CancellationToken cancellation
835835
return MediaSource;
836836
}
837837

838-
private static string GetItemId(string url)
838+
private static Guid GetItemId(string url)
839839
{
840840
if (string.IsNullOrEmpty(url))
841841
{
@@ -853,12 +853,12 @@ private static string GetItemId(string url)
853853
{
854854
if (parts.Length > i + 1)
855855
{
856-
return parts[i + 1];
856+
return Guid.Parse(parts[i + 1]);
857857
}
858858
}
859859
}
860860

861-
return null;
861+
return Guid.Empty;
862862
}
863863

864864
public static StreamParams ParseFromUrl(string url, ILibraryManager libraryManager, IMediaSourceManager mediaSourceManager)
@@ -873,9 +873,7 @@ public static StreamParams ParseFromUrl(string url, ILibraryManager libraryManag
873873
ItemId = GetItemId(url)
874874
};
875875

876-
Guid parsedId;
877-
878-
if (string.IsNullOrWhiteSpace(request.ItemId) || !Guid.TryParse(request.ItemId, out parsedId))
876+
if (request.ItemId.Equals(Guid.Empty))
879877
{
880878
return request;
881879
}
@@ -896,9 +894,7 @@ public static StreamParams ParseFromUrl(string url, ILibraryManager libraryManag
896894
request.SubtitleStreamIndex = GetIntValue(values, "SubtitleStreamIndex");
897895
request.StartPositionTicks = GetLongValue(values, "StartPositionTicks");
898896

899-
request.Item = string.IsNullOrEmpty(request.ItemId)
900-
? null
901-
: libraryManager.GetItemById(parsedId);
897+
request.Item = libraryManager.GetItemById(request.ItemId);
902898

903899
request._mediaSourceManager = mediaSourceManager;
904900

Emby.Dlna/PlayTo/PlaylistItemFactory.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public PlaylistItem Create(Photo item, DeviceProfile profile)
1818
{
1919
StreamInfo = new StreamInfo
2020
{
21-
ItemId = item.Id.ToString("N"),
21+
ItemId = item.Id,
2222
MediaType = DlnaProfileType.Photo,
2323
DeviceProfile = profile
2424
},

Emby.Dlna/packages.config

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="MediaBrowser.Common" version="3.3.47-beta" targetFramework="net47" />
4-
<package id="MediaBrowser.Server.Core" version="3.3.47-beta" targetFramework="net47" />
3+
<package id="MediaBrowser.Common" version="3.3.48-beta" targetFramework="net47" />
4+
<package id="MediaBrowser.Server.Core" version="3.3.48-beta" targetFramework="net47" />
55
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.0" targetFramework="net47" />
66
</packages>

0 commit comments

Comments
 (0)