mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-03 12:23:27 +02:00
add movie prefix feature
This commit is contained in:
parent
420fa8bf7f
commit
70aebff444
|
@ -2134,7 +2134,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
MetadataCountryCode = GetPreferredMetadataCountryCode(),
|
MetadataCountryCode = GetPreferredMetadataCountryCode(),
|
||||||
MetadataLanguage = GetPreferredMetadataLanguage(),
|
MetadataLanguage = GetPreferredMetadataLanguage(),
|
||||||
Name = Name,
|
Name = GetNameForMetadataLookup(),
|
||||||
ProviderIds = ProviderIds,
|
ProviderIds = ProviderIds,
|
||||||
IndexNumber = IndexNumber,
|
IndexNumber = IndexNumber,
|
||||||
ParentIndexNumber = ParentIndexNumber,
|
ParentIndexNumber = ParentIndexNumber,
|
||||||
|
@ -2143,6 +2143,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual string GetNameForMetadataLookup()
|
||||||
|
{
|
||||||
|
return Name;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is called before any metadata refresh and returns true or false indicating if changes were made
|
/// This is called before any metadata refresh and returns true or false indicating if changes were made
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -4,9 +4,12 @@ using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.LiveTv;
|
using MediaBrowser.Model.LiveTv;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Providers;
|
using MediaBrowser.Model.Providers;
|
||||||
using MediaBrowser.Model.Serialization;
|
using MediaBrowser.Model.Serialization;
|
||||||
|
using MediaBrowser.Model.Extensions;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
|
@ -236,6 +239,40 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private LiveTvOptions GetConfiguration()
|
||||||
|
{
|
||||||
|
return ConfigurationManager.GetConfiguration<LiveTvOptions>("livetv");
|
||||||
|
}
|
||||||
|
|
||||||
|
private ListingsProviderInfo GetListingsProviderInfo()
|
||||||
|
{
|
||||||
|
if (string.Equals(ServiceName, "Emby", StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
var config = GetConfiguration();
|
||||||
|
|
||||||
|
return config.ListingProviders.FirstOrDefault(i => !string.IsNullOrWhiteSpace(i.MoviePrefix));
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override string GetNameForMetadataLookup()
|
||||||
|
{
|
||||||
|
var name = base.GetNameForMetadataLookup();
|
||||||
|
|
||||||
|
var listings = GetListingsProviderInfo();
|
||||||
|
|
||||||
|
if (listings != null)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(listings.MoviePrefix))
|
||||||
|
{
|
||||||
|
name = name.Replace(listings.MoviePrefix, string.Empty, StringComparison.OrdinalIgnoreCase).Trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
public override List<ExternalUrl> GetRelatedUrls()
|
public override List<ExternalUrl> GetRelatedUrls()
|
||||||
{
|
{
|
||||||
var list = base.GetRelatedUrls();
|
var list = base.GetRelatedUrls();
|
||||||
|
|
|
@ -83,6 +83,7 @@ namespace MediaBrowser.Model.LiveTv
|
||||||
public string[] KidsCategories { get; set; }
|
public string[] KidsCategories { get; set; }
|
||||||
public string[] MovieCategories { get; set; }
|
public string[] MovieCategories { get; set; }
|
||||||
public NameValuePair[] ChannelMappings { get; set; }
|
public NameValuePair[] ChannelMappings { get; set; }
|
||||||
|
public string MoviePrefix { get; set; }
|
||||||
|
|
||||||
public ListingsProviderInfo()
|
public ListingsProviderInfo()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue