implement fetcher priority adjustment
This commit is contained in:
parent
17bf59dfe3
commit
16bc3a6d77
|
@ -1,7 +1,8 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public class AdultVideo : Video, IHasPreferredMetadataLanguage
|
||||
public class AdultVideo : Video, IHasPreferredMetadataLanguage, IHasTaglines
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets the preferred metadata language.
|
||||
|
@ -14,5 +15,12 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// </summary>
|
||||
/// <value>The preferred metadata country code.</value>
|
||||
public string PreferredMetadataCountryCode { get; set; }
|
||||
|
||||
public List<string> Taglines { get; set; }
|
||||
|
||||
public AdultVideo()
|
||||
{
|
||||
Taglines = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,10 +59,10 @@ namespace MediaBrowser.Controller.Entities
|
|||
|
||||
protected override IEnumerable<FileSystemInfo> GetFileSystemChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return CreateResolveArgs().FileSystemChildren;
|
||||
return CreateResolveArgs(directoryService).FileSystemChildren;
|
||||
}
|
||||
|
||||
private ItemResolveArgs CreateResolveArgs()
|
||||
private ItemResolveArgs CreateResolveArgs(IDirectoryService directoryService)
|
||||
{
|
||||
var path = ContainingFolderPath;
|
||||
|
||||
|
@ -81,7 +81,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
// When resolving the root, we need it's grandchildren (children of user views)
|
||||
var flattenFolderDepth = isPhysicalRoot ? 2 : 0;
|
||||
|
||||
var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
|
||||
var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
|
||||
|
||||
// Need to remove subpaths that may have been resolved from shortcuts
|
||||
// Example: if \\server\movies exists, then strip out \\server\movies\action
|
||||
|
|
|
@ -63,10 +63,10 @@ namespace MediaBrowser.Controller.Entities
|
|||
|
||||
protected override IEnumerable<FileSystemInfo> GetFileSystemChildren(IDirectoryService directoryService)
|
||||
{
|
||||
return CreateResolveArgs().FileSystemChildren;
|
||||
return CreateResolveArgs(directoryService).FileSystemChildren;
|
||||
}
|
||||
|
||||
private ItemResolveArgs CreateResolveArgs()
|
||||
private ItemResolveArgs CreateResolveArgs(IDirectoryService directoryService)
|
||||
{
|
||||
var path = ContainingFolderPath;
|
||||
|
||||
|
@ -85,7 +85,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
// When resolving the root, we need it's grandchildren (children of user views)
|
||||
var flattenFolderDepth = isPhysicalRoot ? 2 : 0;
|
||||
|
||||
var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
|
||||
var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, FileSystem, Logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
|
||||
|
||||
// Need to remove subpaths that may have been resolved from shortcuts
|
||||
// Example: if \\server\movies exists, then strip out \\server\movies\action
|
||||
|
@ -123,7 +123,7 @@ namespace MediaBrowser.Controller.Entities
|
|||
/// <returns>Task.</returns>
|
||||
protected override Task ValidateChildrenInternal(IProgress<double> progress, CancellationToken cancellationToken, bool recursive, bool refreshChildMetadata, MetadataRefreshOptions refreshOptions, IDirectoryService directoryService)
|
||||
{
|
||||
CreateResolveArgs();
|
||||
CreateResolveArgs(directoryService);
|
||||
ResetDynamicChildren();
|
||||
|
||||
return NullTaskResult;
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
@ -15,16 +16,16 @@ namespace MediaBrowser.Controller.IO
|
|||
/// <summary>
|
||||
/// Gets the filtered file system entries.
|
||||
/// </summary>
|
||||
/// <param name="directoryService">The directory service.</param>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <param name="fileSystem">The file system.</param>
|
||||
/// <param name="logger">The logger.</param>
|
||||
/// <param name="args">The args.</param>
|
||||
/// <param name="searchPattern">The search pattern.</param>
|
||||
/// <param name="flattenFolderDepth">The flatten folder depth.</param>
|
||||
/// <param name="resolveShortcuts">if set to <c>true</c> [resolve shortcuts].</param>
|
||||
/// <returns>Dictionary{System.StringFileSystemInfo}.</returns>
|
||||
/// <exception cref="System.ArgumentNullException">path</exception>
|
||||
public static Dictionary<string, FileSystemInfo> GetFilteredFileSystemEntries(string path, IFileSystem fileSystem, ILogger logger, ItemResolveArgs args, string searchPattern = "*", int flattenFolderDepth = 0, bool resolveShortcuts = true)
|
||||
public static Dictionary<string, FileSystemInfo> GetFilteredFileSystemEntries(IDirectoryService directoryService, string path, IFileSystem fileSystem, ILogger logger, ItemResolveArgs args, int flattenFolderDepth = 0, bool resolveShortcuts = true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
|
@ -35,7 +36,7 @@ namespace MediaBrowser.Controller.IO
|
|||
throw new ArgumentNullException("args");
|
||||
}
|
||||
|
||||
var entries = new DirectoryInfo(path).EnumerateFileSystemInfos(searchPattern, SearchOption.TopDirectoryOnly);
|
||||
var entries = directoryService.GetFileSystemEntries(path);
|
||||
|
||||
if (!resolveShortcuts && flattenFolderDepth == 0)
|
||||
{
|
||||
|
@ -79,7 +80,7 @@ namespace MediaBrowser.Controller.IO
|
|||
}
|
||||
else if (flattenFolderDepth > 0 && isDirectory)
|
||||
{
|
||||
foreach (var child in GetFilteredFileSystemEntries(fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts))
|
||||
foreach (var child in GetFilteredFileSystemEntries(directoryService, fullName, fileSystem, logger, args, flattenFolderDepth: flattenFolderDepth - 1, resolveShortcuts: resolveShortcuts))
|
||||
{
|
||||
dict[child.Key] = child.Value;
|
||||
}
|
||||
|
|
|
@ -96,18 +96,6 @@ namespace MediaBrowser.Controller.Library
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is system file.
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if this instance is system file; otherwise, <c>false</c>.</value>
|
||||
public bool IsSystemFile
|
||||
{
|
||||
get
|
||||
{
|
||||
return (FileInfo.Attributes & FileAttributes.System) == FileAttributes.System;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this instance is vf.
|
||||
/// </summary>
|
||||
|
@ -237,22 +225,6 @@ namespace MediaBrowser.Controller.Library
|
|||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the meta file by path.
|
||||
/// </summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns>FileSystemInfo.</returns>
|
||||
/// <exception cref="System.ArgumentNullException"></exception>
|
||||
public FileSystemInfo GetMetaFileByPath(string path)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
throw new ArgumentNullException();
|
||||
}
|
||||
|
||||
return GetFileSystemEntryByPath(path);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the meta file by.
|
||||
/// </summary>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
using System;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using MediaBrowser.Model.Logging;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
|
@ -34,7 +34,15 @@ namespace MediaBrowser.Controller.Providers
|
|||
{
|
||||
//_logger.Debug("Getting files for " + path);
|
||||
|
||||
entries = new DirectoryInfo(path).EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly).ToList();
|
||||
try
|
||||
{
|
||||
entries = new DirectoryInfo(path).EnumerateFileSystemInfos("*", SearchOption.TopDirectoryOnly).ToList();
|
||||
}
|
||||
catch (DirectoryNotFoundException)
|
||||
{
|
||||
entries = new List<FileSystemInfo>();
|
||||
}
|
||||
|
||||
_cache.Add(path, entries);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
@ -60,7 +61,22 @@ namespace MediaBrowser.Controller.Providers
|
|||
|
||||
public void SetFormatFromMimeType(string mimeType)
|
||||
{
|
||||
|
||||
if (mimeType.EndsWith("gif", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Format = ImageFormat.Gif;
|
||||
}
|
||||
else if (mimeType.EndsWith("bmp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Format = ImageFormat.Bmp;
|
||||
}
|
||||
else if (mimeType.EndsWith("png", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
Format = ImageFormat.Png;
|
||||
}
|
||||
else
|
||||
{
|
||||
Format = ImageFormat.Jpg;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,8 @@ namespace MediaBrowser.Providers.Manager
|
|||
|
||||
var providersHadChanges = updateType > ItemUpdateType.None;
|
||||
|
||||
if (refreshOptions.ForceSave || providersHadChanges)
|
||||
// Save if changes were made, or it's never been saved before
|
||||
if (refreshOptions.ForceSave || providersHadChanges || item.DateLastSaved == default(DateTime))
|
||||
{
|
||||
// Save to database
|
||||
await SaveItem(itemOfType, updateType, cancellationToken);
|
||||
|
|
|
@ -32,16 +32,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is MusicAlbum;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is MusicAlbum && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -32,19 +32,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
if (item is MusicArtist)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is MusicArtist && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -32,16 +32,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is BoxSet;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is BoxSet && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -27,16 +27,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||
if ((wasMetadataEdited || wasMetadataDownloaded))
|
||||
{
|
||||
return item is LiveTvChannel;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is LiveTvChannel && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
public string Name
|
||||
|
|
|
@ -36,16 +36,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is Episode;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is Episode && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
public string Name
|
||||
|
|
|
@ -34,24 +34,13 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var folder = item as Folder;
|
||||
|
||||
if (folder == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
if (item is Folder)
|
||||
{
|
||||
if (!(item is Series) && !(item is BoxSet) && !(item is MusicArtist) && !(item is MusicAlbum) &&
|
||||
!(item is Season) &&
|
||||
!(item is GameSystem))
|
||||
{
|
||||
return true;
|
||||
return updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Security;
|
||||
|
@ -32,16 +31,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is GameSystem;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is GameSystem && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -36,16 +36,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is Game;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is Game && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||
|
|
|
@ -46,15 +46,12 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
var video = item as Video;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
// Check parent for null to avoid running this against things like video backdrops
|
||||
if (video != null && !(item is Episode) && !video.IsOwnedItem)
|
||||
{
|
||||
var video = item as Video;
|
||||
// Check parent for null to avoid running this against things like video backdrops
|
||||
return video != null && !(item is Episode) && !video.IsOwnedItem;
|
||||
return updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
@ -36,16 +36,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||
if ((wasMetadataEdited || wasMetadataDownloaded))
|
||||
{
|
||||
return item is Person;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is Person && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -32,16 +32,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is Season;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is Season && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -33,16 +33,7 @@ namespace MediaBrowser.Providers.Savers
|
|||
return false;
|
||||
}
|
||||
|
||||
var wasMetadataEdited = (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit;
|
||||
var wasMetadataDownloaded = (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload;
|
||||
|
||||
// If new metadata has been downloaded and save local is on
|
||||
if (wasMetadataEdited || wasMetadataDownloaded)
|
||||
{
|
||||
return item is Series;
|
||||
}
|
||||
|
||||
return false;
|
||||
return item is Series && updateType >= ItemUpdateType.MetadataDownload;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -497,7 +497,9 @@ namespace MediaBrowser.Server.Implementations.Library
|
|||
// When resolving the root, we need it's grandchildren (children of user views)
|
||||
var flattenFolderDepth = isPhysicalRoot ? 2 : 0;
|
||||
|
||||
var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(args.Path, _fileSystem, _logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
|
||||
var directoryService = new DirectoryService(_logger);
|
||||
|
||||
var fileSystemDictionary = FileData.GetFilteredFileSystemEntries(directoryService, args.Path, _fileSystem, _logger, args, flattenFolderDepth: flattenFolderDepth, resolveShortcuts: isPhysicalRoot || args.IsVf);
|
||||
|
||||
// Need to remove subpaths that may have been resolved from shortcuts
|
||||
// Example: if \\server\movies exists, then strip out \\server\movies\action
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Serialization;
|
||||
|
||||
namespace MediaBrowser.Plugins.NextPvr
|
||||
{
|
||||
/// <summary>
|
||||
/// Class LiveTvService
|
||||
/// </summary>
|
||||
public class LiveTvService : ILiveTvService
|
||||
{
|
||||
private readonly ILogger _logger;
|
||||
|
||||
private IApplicationPaths _appPaths;
|
||||
private IJsonSerializer _json;
|
||||
private IHttpClient _httpClient;
|
||||
|
||||
public LiveTvService(ILogger logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the channels async.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{IEnumerable{ChannelInfo}}.</returns>
|
||||
public Task<IEnumerable<ChannelInfo>> GetChannelsAsync(CancellationToken cancellationToken)
|
||||
{
|
||||
//using (var stream = await _httpClient.Get(new HttpRequestOptions()
|
||||
// {
|
||||
// Url = "",
|
||||
// CancellationToken = cancellationToken
|
||||
// }))
|
||||
//{
|
||||
|
||||
//}
|
||||
_logger.Info("GetChannelsAsync");
|
||||
|
||||
var channels = new List<ChannelInfo>
|
||||
{
|
||||
new ChannelInfo
|
||||
{
|
||||
Name = "NBC",
|
||||
ServiceName = Name
|
||||
}
|
||||
};
|
||||
|
||||
return Task.FromResult<IEnumerable<ChannelInfo>>(channels);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name.
|
||||
/// </summary>
|
||||
/// <value>The name.</value>
|
||||
public string Name
|
||||
{
|
||||
get { return "Next Pvr"; }
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user