mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
channel improvements
This commit is contained in:
@@ -47,5 +47,10 @@ namespace MediaBrowser.Controller.Channels
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetInternalMetadataPath(string basePath)
|
||||
{
|
||||
return System.IO.Path.Combine(basePath, "channels", Id.ToString("N"), "metadata");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace MediaBrowser.Controller.Channels
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public string ChannelId { get; set; }
|
||||
public string DataVersion { get; set; }
|
||||
|
||||
public ChannelItemType ChannelItemType { get; set; }
|
||||
|
||||
@@ -41,6 +42,11 @@ namespace MediaBrowser.Controller.Channels
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsSaveLocalMetadataEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public ChannelAudioItem()
|
||||
{
|
||||
ChannelMediaSources = new List<ChannelMediaInfo>();
|
||||
@@ -58,5 +64,10 @@ namespace MediaBrowser.Controller.Channels
|
||||
return base.LocationType;
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetInternalMetadataPath(string basePath)
|
||||
{
|
||||
return System.IO.Path.Combine(basePath, "channels", ChannelId, Id.ToString("N"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ namespace MediaBrowser.Controller.Channels
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public string ChannelId { get; set; }
|
||||
public string DataVersion { get; set; }
|
||||
|
||||
public ChannelItemType ChannelItemType { get; set; }
|
||||
public ChannelFolderType ChannelFolderType { get; set; }
|
||||
@@ -32,6 +33,11 @@ namespace MediaBrowser.Controller.Channels
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsSaveLocalMetadataEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
return ExternalId;
|
||||
@@ -63,5 +69,10 @@ namespace MediaBrowser.Controller.Channels
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected override string GetInternalMetadataPath(string basePath)
|
||||
{
|
||||
return System.IO.Path.Combine(basePath, "channels", ChannelId, Id.ToString("N"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ namespace MediaBrowser.Controller.Channels
|
||||
public ChannelFolderType FolderType { get; set; }
|
||||
|
||||
public ChannelMediaContentType ContentType { get; set; }
|
||||
public ExtraType ExtraType { get; set; }
|
||||
public TrailerType TrailerType { get; set; }
|
||||
|
||||
public Dictionary<string, string> ProviderIds { get; set; }
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace MediaBrowser.Controller.Channels
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
public string ChannelId { get; set; }
|
||||
public string DataVersion { get; set; }
|
||||
|
||||
public ChannelItemType ChannelItemType { get; set; }
|
||||
|
||||
@@ -28,13 +29,13 @@ namespace MediaBrowser.Controller.Channels
|
||||
|
||||
public override string GetUserDataKey()
|
||||
{
|
||||
if (ContentType == ChannelMediaContentType.Trailer)
|
||||
if (ContentType == ChannelMediaContentType.MovieExtra)
|
||||
{
|
||||
var key = this.GetProviderId(MetadataProviders.Tmdb) ?? this.GetProviderId(MetadataProviders.Tvdb) ?? this.GetProviderId(MetadataProviders.Imdb) ?? this.GetProviderId(MetadataProviders.Tvcom);
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(key))
|
||||
{
|
||||
key = key + "-trailer";
|
||||
key = key + "-" + ExtraType.ToString().ToLower();
|
||||
|
||||
// Make sure different trailers have their own data.
|
||||
if (RunTimeTicks.HasValue)
|
||||
@@ -62,6 +63,11 @@ namespace MediaBrowser.Controller.Channels
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsSaveLocalMetadataEnabled()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public ChannelVideoItem()
|
||||
{
|
||||
ChannelMediaSources = new List<ChannelMediaInfo>();
|
||||
@@ -94,8 +100,14 @@ namespace MediaBrowser.Controller.Channels
|
||||
var info = GetItemLookupInfo<ChannelItemLookupInfo>();
|
||||
|
||||
info.ContentType = ContentType;
|
||||
info.ExtraType = ExtraType;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
protected override string GetInternalMetadataPath(string basePath)
|
||||
{
|
||||
return System.IO.Path.Combine(basePath, "channels", ChannelId, Id.ToString("N"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,5 +11,7 @@ namespace MediaBrowser.Controller.Channels
|
||||
ChannelItemType ChannelItemType { get; set; }
|
||||
|
||||
string OriginalImageUrl { get; set; }
|
||||
|
||||
string DataVersion { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Model.Channels;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Channels
|
||||
{
|
||||
@@ -10,6 +11,8 @@ namespace MediaBrowser.Controller.Channels
|
||||
|
||||
ChannelMediaContentType ContentType { get; set; }
|
||||
|
||||
ExtraType ExtraType { get; set; }
|
||||
|
||||
List<ChannelMediaInfo> ChannelMediaSources { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,11 @@ namespace MediaBrowser.Controller.Channels
|
||||
/// Indicates if a sort ascending/descending toggle is supported or not.
|
||||
/// </summary>
|
||||
public bool SupportsSortOrderToggle { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the automatic refresh levels.
|
||||
/// </summary>
|
||||
/// <value>The automatic refresh levels.</value>
|
||||
public int? AutoRefreshLevels { get; set; }
|
||||
|
||||
public InternalChannelFeatures()
|
||||
{
|
||||
|
||||
@@ -351,6 +351,18 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public string GetInternalMetadataPath()
|
||||
{
|
||||
return GetInternalMetadataPath(ConfigurationManager.ApplicationPaths.InternalMetadataPath);
|
||||
}
|
||||
|
||||
protected virtual string GetInternalMetadataPath(string basePath)
|
||||
{
|
||||
var idString = Id.ToString("N");
|
||||
|
||||
return System.IO.Path.Combine(basePath, idString.Substring(0, 2), idString);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates the name of the sort.
|
||||
/// </summary>
|
||||
|
||||
@@ -160,6 +160,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// </summary>
|
||||
/// <value><c>true</c> if [supports remote image downloading]; otherwise, <c>false</c>.</value>
|
||||
bool SupportsRemoteImageDownloading { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal metadata path.
|
||||
/// </summary>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetInternalMetadataPath();
|
||||
}
|
||||
|
||||
public static class HasImagesExtensions
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
|
||||
namespace MediaBrowser.Controller
|
||||
{
|
||||
@@ -106,12 +105,5 @@ namespace MediaBrowser.Controller
|
||||
/// </summary>
|
||||
/// <value>The internal metadata path.</value>
|
||||
string InternalMetadataPath { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal metadata path.
|
||||
/// </summary>
|
||||
/// <param name="id">The identifier.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
string GetInternalMetadataPath(Guid id);
|
||||
}
|
||||
}
|
||||
@@ -241,5 +241,6 @@ namespace MediaBrowser.Controller.Providers
|
||||
public class ChannelItemLookupInfo : ItemLookupInfo
|
||||
{
|
||||
public ChannelMediaContentType ContentType { get; set; }
|
||||
public ExtraType ExtraType { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user