Merge pull request #2220 from MediaBrowser/dev

update live stream sharing
This commit is contained in:
Luke 2016-10-11 17:38:44 -04:00 committed by GitHub
commit 2abad94e21
13 changed files with 90 additions and 47 deletions

View File

@ -59,6 +59,15 @@ namespace MediaBrowser.Controller.Entities.Audio
AlbumArtists = new List<string>();
}
[IgnoreDataMember]
public override bool SupportsPlayedStatus
{
get
{
return true;
}
}
[IgnoreDataMember]
public override bool SupportsAddingToPlaylist
{

View File

@ -807,18 +807,6 @@ namespace MediaBrowser.Controller.Entities
return true;
}
if (query.HasThemeSong.HasValue)
{
Logger.Debug("Query requires post-filtering due to HasThemeSong");
return true;
}
if (query.HasThemeVideo.HasValue)
{
Logger.Debug("Query requires post-filtering due to HasThemeVideo");
return true;
}
// Filter by VideoType
if (query.VideoTypes.Length > 0)
{

View File

@ -16,8 +16,6 @@ namespace MediaBrowser.Controller.Entities
RemoteTrailers = new List<MediaUrl>();
LocalTrailerIds = new List<Guid>();
RemoteTrailerIds = new List<Guid>();
ThemeSongIds = new List<Guid>();
ThemeVideoIds = new List<Guid>();
}
public List<Guid> LocalTrailerIds { get; set; }

View File

@ -168,6 +168,8 @@ namespace MediaBrowser.Controller.Entities
switch (name)
{
case ItemFields.ThemeSongIds:
case ItemFields.ThemeVideoIds:
case ItemFields.ProductionLocations:
case ItemFields.Keywords:
case ItemFields.Taglines:

View File

@ -68,6 +68,15 @@ namespace MediaBrowser.Controller.Entities.Movies
set { TmdbCollectionName = value; }
}
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return false;
}
}
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
{
var hasChanges = await base.RefreshedOwnedItems(options, fileSystemChildren, cancellationToken).ConfigureAwait(false);

View File

@ -53,6 +53,15 @@ namespace MediaBrowser.Controller.Entities
}
}
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return true;
}
}
public override string CreatePresentationUniqueKey()
{
if (!string.IsNullOrWhiteSpace(PrimaryVersionId))

View File

@ -54,6 +54,15 @@ namespace MediaBrowser.Controller.LiveTv
}
}
[IgnoreDataMember]
protected override bool SupportsIsInMixedFolderDetection
{
get
{
return false;
}
}
[IgnoreDataMember]
public override bool SupportsPlayedStatus
{

View File

@ -207,15 +207,15 @@ namespace MediaBrowser.Controller.Playlists
public override bool IsVisible(User user)
{
if (base.IsVisible(user))
{
var userId = user.Id.ToString("N");
var userId = user.Id.ToString("N");
return Shares.Any(i => string.Equals(userId, i.UserId, StringComparison.OrdinalIgnoreCase)) ||
string.Equals(OwnerUserId, userId, StringComparison.OrdinalIgnoreCase);
}
return Shares.Any(i => string.Equals(userId, i.UserId, StringComparison.OrdinalIgnoreCase)) ||
string.Equals(OwnerUserId, userId, StringComparison.OrdinalIgnoreCase);
}
return false;
public override bool IsVisibleStandalone(User user)
{
return IsVisible(user);
}
}
}

View File

@ -260,6 +260,8 @@
/// <summary>
/// The service name
/// </summary>
ServiceName
ServiceName,
ThemeSongIds,
ThemeVideoIds
}
}

View File

@ -274,6 +274,10 @@ namespace MediaBrowser.Server.Implementations.Library
positionTicks = 0;
data.Played = false;
}
if (item is Audio)
{
positionTicks = 0;
}
data.PlaybackPositionTicks = positionTicks;

View File

@ -512,29 +512,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv.TunerHosts.HdHomerun
if (EnableLocalBuffer())
{
var liveStream = new HdHomerunLiveStream(mediaSource, streamId, _fileSystem, _httpClient, Logger, Config.ApplicationPaths, _appHost);
if (info.AllowHWTranscoding)
{
var model = await GetModelInfo(info, cancellationToken).ConfigureAwait(false);
if ((model ?? string.Empty).IndexOf("hdtc", StringComparison.OrdinalIgnoreCase) != -1)
{
liveStream.EnableStreamSharing = !info.AllowHWTranscoding;
}
else
{
liveStream.EnableStreamSharing = true;
}
}
else
{
liveStream.EnableStreamSharing = true;
}
liveStream.EnableStreamSharing = true;
return liveStream;
}
else
{
var liveStream = new LiveStream(mediaSource);
liveStream.EnableStreamSharing = false;
liveStream.EnableStreamSharing = true;
//liveStream.EnableStreamSharing = false;
return liveStream;
}
}

View File

@ -1875,17 +1875,23 @@ namespace MediaBrowser.Server.Implementations.Persistence
index++;
}
if (!reader.IsDBNull(index))
if (query.HasField(ItemFields.ThemeSongIds))
{
item.ThemeSongIds = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => new Guid(i)).ToList();
if (!reader.IsDBNull(index))
{
item.ThemeSongIds = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => new Guid(i)).ToList();
}
index++;
}
index++;
if (!reader.IsDBNull(index))
if (query.HasField(ItemFields.ThemeVideoIds))
{
item.ThemeVideoIds = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => new Guid(i)).ToList();
if (!reader.IsDBNull(index))
{
item.ThemeVideoIds = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => new Guid(i)).ToList();
}
index++;
}
index++;
if (string.IsNullOrWhiteSpace(item.Tagline))
{
@ -3826,6 +3832,28 @@ namespace MediaBrowser.Server.Implementations.Persistence
clause += ")";
whereClauses.Add(clause);
}
if (query.HasThemeSong.HasValue)
{
if (query.HasThemeSong.Value)
{
whereClauses.Add("ThemeSongIds not null");
}
else
{
whereClauses.Add("ThemeSongIds is null");
}
}
if (query.HasThemeVideo.HasValue)
{
if (query.HasThemeVideo.Value)
{
whereClauses.Add("ThemeVideoIds not null");
}
else
{
whereClauses.Add("ThemeVideoIds is null");
}
}
//var enableItemsByName = query.IncludeItemsByName ?? query.IncludeItemTypes.Length > 0;
var enableItemsByName = query.IncludeItemsByName ?? false;

View File

@ -17,7 +17,7 @@ namespace MediaBrowser.Server.Implementations.Playlists
public override bool IsVisible(User user)
{
return base.IsVisible(user);
return base.IsVisible(user) && GetChildren(user, true).Any();
}
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)