mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-05-31 12:14:21 -04:00
continue with tuner discovery
This commit is contained in:
parent
a9b61af154
commit
a0934e6226
@ -2543,6 +2543,20 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
|||||||
public CancellationTokenSource CancellationTokenSource { get; set; }
|
public CancellationTokenSource CancellationTokenSource { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<List<TunerHostInfo>> DiscoverTuners(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var list = new List<TunerHostInfo>();
|
||||||
|
|
||||||
|
foreach (var host in _liveTvManager.TunerHosts)
|
||||||
|
{
|
||||||
|
var discoveredDevices = await DiscoverDevices(host, 3000, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
|
list.AddRange(discoveredDevices);
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
public async Task ScanForTunerDeviceChanges(CancellationToken cancellationToken)
|
public async Task ScanForTunerDeviceChanges(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
foreach (var host in _liveTvManager.TunerHosts)
|
foreach (var host in _liveTvManager.TunerHosts)
|
||||||
|
@ -160,6 +160,11 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Task<List<TunerHostInfo>> DiscoverTuners(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
return EmbyTV.EmbyTV.Current.DiscoverTuners(cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
void service_DataSourceChanged(object sender, EventArgs e)
|
void service_DataSourceChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
if (!_isDisposed)
|
if (!_isDisposed)
|
||||||
|
@ -706,6 +706,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
|||||||
var modelInfo = await GetModelInfo(hostInfo, false, cancellationToken).ConfigureAwait(false);
|
var modelInfo = await GetModelInfo(hostInfo, false, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
hostInfo.DeviceId = modelInfo.DeviceID;
|
hostInfo.DeviceId = modelInfo.DeviceID;
|
||||||
|
hostInfo.FriendlyName = modelInfo.FriendlyName;
|
||||||
|
|
||||||
return hostInfo;
|
return hostInfo;
|
||||||
}
|
}
|
||||||
|
@ -677,7 +677,14 @@ namespace MediaBrowser.Api.LiveTv
|
|||||||
[Authenticated]
|
[Authenticated]
|
||||||
public class GetTunerHostTypes : IReturn<List<NameIdPair>>
|
public class GetTunerHostTypes : IReturn<List<NameIdPair>>
|
||||||
{
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[Route("/LiveTv/Tuners/Discvover", "GET")]
|
||||||
|
[Authenticated]
|
||||||
|
public class DiscoverTuners : IReturn<List<TunerHostInfo>>
|
||||||
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class LiveTvService : BaseApiService
|
public class LiveTvService : BaseApiService
|
||||||
@ -730,6 +737,12 @@ namespace MediaBrowser.Api.LiveTv
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<object> Get(DiscoverTuners request)
|
||||||
|
{
|
||||||
|
var result = await _liveTvManager.DiscoverTuners(CancellationToken.None).ConfigureAwait(false);
|
||||||
|
return ToOptimizedResult(result);
|
||||||
|
}
|
||||||
|
|
||||||
public async Task<object> Get(GetLiveStreamFile request)
|
public async Task<object> Get(GetLiveStreamFile request)
|
||||||
{
|
{
|
||||||
var directStreamProvider = (await _liveTvManager.GetEmbyTvLiveStream(request.Id).ConfigureAwait(false)) as IDirectStreamProvider;
|
var directStreamProvider = (await _liveTvManager.GetEmbyTvLiveStream(request.Id).ConfigureAwait(false)) as IDirectStreamProvider;
|
||||||
|
@ -614,7 +614,8 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
Timestamp = i.Timestamp,
|
Timestamp = i.Timestamp,
|
||||||
Type = type,
|
Type = type,
|
||||||
PlayableStreamFileNames = i.PlayableStreamFileNames.ToList(),
|
PlayableStreamFileNames = i.PlayableStreamFileNames.ToList(),
|
||||||
SupportsDirectStream = i.VideoType == VideoType.VideoFile
|
SupportsDirectStream = i.VideoType == VideoType.VideoFile,
|
||||||
|
IsRemote = i.IsShortcut
|
||||||
};
|
};
|
||||||
|
|
||||||
if (info.Protocol == MediaProtocol.File)
|
if (info.Protocol == MediaProtocol.File)
|
||||||
|
@ -382,6 +382,7 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
List<IListingsProvider> ListingProviders { get; }
|
List<IListingsProvider> ListingProviders { get; }
|
||||||
|
|
||||||
List<NameIdPair> GetTunerHostTypes();
|
List<NameIdPair> GetTunerHostTypes();
|
||||||
|
Task<List<TunerHostInfo>> DiscoverTuners(CancellationToken cancellationToken);
|
||||||
|
|
||||||
event EventHandler<GenericEventArgs<TimerEventInfo>> SeriesTimerCancelled;
|
event EventHandler<GenericEventArgs<TimerEventInfo>> SeriesTimerCancelled;
|
||||||
event EventHandler<GenericEventArgs<TimerEventInfo>> TimerCancelled;
|
event EventHandler<GenericEventArgs<TimerEventInfo>> TimerCancelled;
|
||||||
|
@ -185,6 +185,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// obviously don't do this for strm files
|
||||||
|
if (string.Equals(container, "strm", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return container;
|
return container;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user