mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c8cdc6099a
@ -1368,7 +1368,7 @@ namespace MediaBrowser.Api.Playback
|
|||||||
mediaUrl = streamInfo.Url;
|
mediaUrl = streamInfo.Url;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(path) && File.Exists(path))
|
if (!string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
state.MediaPath = path;
|
state.MediaPath = path;
|
||||||
state.IsRemote = false;
|
state.IsRemote = false;
|
||||||
@ -1381,7 +1381,7 @@ namespace MediaBrowser.Api.Playback
|
|||||||
|
|
||||||
state.RunTimeTicks = recording.RunTimeTicks;
|
state.RunTimeTicks = recording.RunTimeTicks;
|
||||||
|
|
||||||
if (recording.RecordingInfo.Status == RecordingStatus.InProgress && !state.IsRemote)
|
if (recording.RecordingInfo.Status == RecordingStatus.InProgress)
|
||||||
{
|
{
|
||||||
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
|
await Task.Delay(1000, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
@ -1404,7 +1404,7 @@ namespace MediaBrowser.Api.Playback
|
|||||||
|
|
||||||
state.LiveTvStreamId = streamInfo.Id;
|
state.LiveTvStreamId = streamInfo.Id;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(streamInfo.Path) && File.Exists(streamInfo.Path))
|
if (!string.IsNullOrEmpty(streamInfo.Path))
|
||||||
{
|
{
|
||||||
state.MediaPath = streamInfo.Path;
|
state.MediaPath = streamInfo.Path;
|
||||||
state.IsRemote = false;
|
state.IsRemote = false;
|
||||||
@ -1749,11 +1749,11 @@ namespace MediaBrowser.Api.Playback
|
|||||||
|
|
||||||
if (isStaticallyStreamed)
|
if (isStaticallyStreamed)
|
||||||
{
|
{
|
||||||
flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_BYTE_BASED_SEEK;
|
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_BYTE_BASED_SEEK;
|
||||||
}
|
}
|
||||||
else if (state.RunTimeTicks.HasValue)
|
else if (state.RunTimeTicks.HasValue)
|
||||||
{
|
{
|
||||||
flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
|
//flagValue = flagValue | DlnaFlags.DLNA_ORG_FLAG_TIME_BASED_SEEK;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}000000000000000000000000",
|
var dlnaflags = string.Format(";DLNA.ORG_FLAGS={0}000000000000000000000000",
|
||||||
|
@ -15,14 +15,12 @@ namespace MediaBrowser.Api.UserLibrary
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class GetArtists
|
/// Class GetArtists
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Route("/Artists", "GET")]
|
[Route("/Artists", "GET", Summary = "Gets all artists from a given item, folder, or the entire library")]
|
||||||
[Api(Description = "Gets all artists from a given item, folder, or the entire library")]
|
|
||||||
public class GetArtists : GetItemsByName
|
public class GetArtists : GetItemsByName
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
[Route("/Artists/{Name}", "GET")]
|
[Route("/Artists/{Name}", "GET", Summary = "Gets an artist, by name")]
|
||||||
[Api(Description = "Gets an artist, by name")]
|
|
||||||
public class GetArtist : IReturn<BaseItemDto>
|
public class GetArtist : IReturn<BaseItemDto>
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -112,7 +110,8 @@ namespace MediaBrowser.Api.UserLibrary
|
|||||||
protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
|
protected override IEnumerable<MusicArtist> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
|
||||||
{
|
{
|
||||||
return items
|
return items
|
||||||
.OfType<Audio>()
|
.OfType<IHasArtist>()
|
||||||
|
.Where(i => !(i is MusicAlbum))
|
||||||
.SelectMany(i => i.AllArtists)
|
.SelectMany(i => i.AllArtists)
|
||||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||||
.Select(name =>
|
.Select(name =>
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities.Audio
|
namespace MediaBrowser.Controller.Entities.Audio
|
||||||
{
|
{
|
||||||
public interface IHasAlbumArtist
|
public interface IHasAlbumArtist
|
||||||
@ -9,5 +10,7 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
public interface IHasArtist
|
public interface IHasArtist
|
||||||
{
|
{
|
||||||
bool HasArtist(string name);
|
bool HasArtist(string name);
|
||||||
|
|
||||||
|
List<string> AllArtists { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,6 +31,23 @@ namespace MediaBrowser.Controller.Entities.Audio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public List<string> AllArtists
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var list = new List<string>();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(AlbumArtist))
|
||||||
|
{
|
||||||
|
list.Add(AlbumArtist);
|
||||||
|
}
|
||||||
|
list.AddRange(Artists);
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the tags.
|
/// Gets or sets the tags.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -3,7 +3,9 @@ using MediaBrowser.Controller.Providers;
|
|||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Runtime.Serialization;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Entities
|
namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
@ -33,6 +35,23 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
/// <value>The revenue.</value>
|
/// <value>The revenue.</value>
|
||||||
public double? Revenue { get; set; }
|
public double? Revenue { get; set; }
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public List<string> AllArtists
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
var list = new List<string>();
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(Artist))
|
||||||
|
{
|
||||||
|
list.Add(Artist);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether the specified name has artist.
|
/// Determines whether the specified name has artist.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -167,6 +167,10 @@ namespace MediaBrowser.Dlna.PlayTo
|
|||||||
if (_currentItem == null || _device.IsStopped)
|
if (_currentItem == null || _device.IsStopped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
|
||||||
|
|
||||||
|
if (playlistItem != null)
|
||||||
|
{
|
||||||
if (!_playbackStarted)
|
if (!_playbackStarted)
|
||||||
{
|
{
|
||||||
await _sessionManager.OnPlaybackStart(new PlaybackInfo
|
await _sessionManager.OnPlaybackStart(new PlaybackInfo
|
||||||
@ -174,7 +178,10 @@ namespace MediaBrowser.Dlna.PlayTo
|
|||||||
Item = _currentItem,
|
Item = _currentItem,
|
||||||
SessionId = _session.Id,
|
SessionId = _session.Id,
|
||||||
CanSeek = true,
|
CanSeek = true,
|
||||||
QueueableMediaTypes = new List<string> { _currentItem.MediaType }
|
QueueableMediaTypes = new List<string> { _currentItem.MediaType },
|
||||||
|
MediaSourceId = playlistItem.MediaSourceId,
|
||||||
|
AudioStreamIndex = playlistItem.AudioStreamIndex,
|
||||||
|
SubtitleStreamIndex = playlistItem.SubtitleStreamIndex
|
||||||
|
|
||||||
}).ConfigureAwait(false);
|
}).ConfigureAwait(false);
|
||||||
|
|
||||||
@ -182,10 +189,6 @@ namespace MediaBrowser.Dlna.PlayTo
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ((_device.IsPlaying || _device.IsPaused))
|
if ((_device.IsPlaying || _device.IsPaused))
|
||||||
{
|
|
||||||
var playlistItem = Playlist.FirstOrDefault(p => p.PlayState == 1);
|
|
||||||
|
|
||||||
if (playlistItem != null)
|
|
||||||
{
|
{
|
||||||
var ticks = _device.Position.Ticks;
|
var ticks = _device.Position.Ticks;
|
||||||
|
|
||||||
|
@ -178,20 +178,9 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||||||
|
|
||||||
using (var source = SourceStream)
|
using (var source = SourceStream)
|
||||||
{
|
{
|
||||||
// If the requested range is "0-", we can optimize by just doing a stream copy
|
//Since we've already set the postion of the sourcestream, just copy the remains to the output
|
||||||
if (RangeEnd == TotalContentLength - 1)
|
|
||||||
{
|
|
||||||
await source.CopyToAsync(responseStream).ConfigureAwait(false);
|
await source.CopyToAsync(responseStream).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Read the bytes we need
|
|
||||||
var buffer = new byte[Convert.ToInt32(RangeLength)];
|
|
||||||
await source.ReadAsync(buffer, 0, buffer.Length).ConfigureAwait(false);
|
|
||||||
|
|
||||||
await responseStream.WriteAsync(buffer, 0, Convert.ToInt32(RangeLength)).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ContentType { get; set; }
|
public string ContentType { get; set; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user