mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 17:14:42 +01:00
#712 - Support grouping multiple versions of a movie
This commit is contained in:
@@ -111,6 +111,7 @@ namespace MediaBrowser.Server.Implementations.Collections
|
||||
}
|
||||
|
||||
var list = new List<LinkedChild>();
|
||||
var currentLinkedChildren = collection.GetLinkedChildren().ToList();
|
||||
|
||||
foreach (var itemId in ids)
|
||||
{
|
||||
@@ -121,7 +122,7 @@ namespace MediaBrowser.Server.Implementations.Collections
|
||||
throw new ArgumentException("No item exists with the supplied Id");
|
||||
}
|
||||
|
||||
if (collection.LinkedChildren.Any(i => i.ItemId.HasValue && i.ItemId == itemId))
|
||||
if (currentLinkedChildren.Any(i => i.Id == itemId))
|
||||
{
|
||||
throw new ArgumentException("Item already exists in collection");
|
||||
}
|
||||
|
||||
@@ -1082,7 +1082,12 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
dto.IsHD = video.IsHD;
|
||||
|
||||
dto.PartCount = video.AdditionalPartIds.Count + 1;
|
||||
dto.HasAlternateVersions = video.HasAlternateVersions;
|
||||
dto.AlternateVersionCount = video.AlternateVersionCount;
|
||||
|
||||
if (video.PrimaryVersionId.HasValue)
|
||||
{
|
||||
dto.PrimaryVersionId = video.PrimaryVersionId.Value.ToString("N");
|
||||
}
|
||||
|
||||
if (fields.Contains(ItemFields.Chapters))
|
||||
{
|
||||
|
||||
@@ -410,7 +410,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(filenamePrefix))
|
||||
{
|
||||
if (sortedMovies.All(i => Path.GetFileNameWithoutExtension(i.Path).StartsWith(filenamePrefix, StringComparison.OrdinalIgnoreCase)))
|
||||
if (sortedMovies.Skip(1).All(i => Path.GetFileNameWithoutExtension(i.Path).StartsWith(filenamePrefix + " - ", StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
firstMovie.HasLocalAlternateVersions = true;
|
||||
|
||||
|
||||
@@ -690,6 +690,11 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
}
|
||||
}
|
||||
|
||||
if (session.UserId.HasValue)
|
||||
{
|
||||
command.ControllingUserId = session.UserId.Value.ToString("N");
|
||||
}
|
||||
|
||||
return session.SessionController.SendPlayCommand(command, cancellationToken);
|
||||
}
|
||||
|
||||
@@ -723,6 +728,11 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
throw new ArgumentException(string.Format("Session {0} is unable to seek.", session.Id));
|
||||
}
|
||||
|
||||
if (session.UserId.HasValue)
|
||||
{
|
||||
command.ControllingUserId = session.UserId.Value.ToString("N");
|
||||
}
|
||||
|
||||
return session.SessionController.SendPlaystateCommand(command, cancellationToken);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user