mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-03 06:18:28 +01:00
added movie, series, folder and episode xml saving support
This commit is contained in:
@@ -314,7 +314,7 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
throw new IOException("Unable to retrieve file system info for " + path);
|
||||
}
|
||||
|
||||
|
||||
var args = new ItemResolveArgs(ConfigurationManager.ApplicationPaths)
|
||||
{
|
||||
FileInfo = pathInfo,
|
||||
@@ -464,6 +464,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
/// <value>The official rating.</value>
|
||||
public virtual string OfficialRating { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the official rating description.
|
||||
/// </summary>
|
||||
/// <value>The official rating description.</value>
|
||||
public string OfficialRatingDescription { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the custom rating.
|
||||
/// </summary>
|
||||
|
||||
@@ -152,16 +152,13 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="itemComparers">The item comparers.</param>
|
||||
/// <param name="prescanTasks">The prescan tasks.</param>
|
||||
/// <param name="postscanTasks">The postscan tasks.</param>
|
||||
/// <param name="savers">The savers.</param>
|
||||
/// <param name="?">The ?.</param>
|
||||
void AddParts(IEnumerable<IResolverIgnoreRule> rules,
|
||||
IEnumerable<IVirtualFolderCreator> pluginFolders,
|
||||
IEnumerable<IItemResolver> resolvers,
|
||||
IEnumerable<IIntroProvider> introProviders,
|
||||
IEnumerable<IBaseItemComparer> itemComparers,
|
||||
IEnumerable<ILibraryPrescanTask> prescanTasks,
|
||||
IEnumerable<ILibraryPostScanTask> postscanTasks,
|
||||
IEnumerable<IMetadataSaver> savers);
|
||||
IEnumerable<ILibraryPostScanTask> postscanTasks);
|
||||
|
||||
/// <summary>
|
||||
/// Sorts the specified items.
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
@@ -29,6 +28,6 @@ namespace MediaBrowser.Controller.Library
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task Save(BaseItem item, CancellationToken cancellationToken);
|
||||
void Save(BaseItem item, CancellationToken cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
|
||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Fetches metadata from one Xml Element
|
||||
/// </summary>
|
||||
@@ -205,6 +205,17 @@ namespace MediaBrowser.Controller.Providers
|
||||
break;
|
||||
}
|
||||
|
||||
case "MPAADescription":
|
||||
{
|
||||
var rating = reader.ReadElementContentAsString();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(rating))
|
||||
{
|
||||
item.OfficialRatingDescription = rating;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case "CustomRating":
|
||||
{
|
||||
var val = reader.ReadElementContentAsString();
|
||||
@@ -306,7 +317,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
|
||||
var actors = reader.ReadInnerXml();
|
||||
|
||||
|
||||
if (actors.Contains("<"))
|
||||
{
|
||||
// This is one of the mis-named "Actors" full nodes created by MB2
|
||||
@@ -378,7 +389,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
float val;
|
||||
// All external meta is saving this as '.' for decimal I believe...but just to be sure
|
||||
if (float.TryParse(rating.Replace(',','.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out val))
|
||||
if (float.TryParse(rating.Replace(',', '.'), NumberStyles.AllowDecimalPoint, CultureInfo.InvariantCulture, out val))
|
||||
{
|
||||
item.CommunityRating = val;
|
||||
}
|
||||
@@ -412,6 +423,14 @@ namespace MediaBrowser.Controller.Providers
|
||||
}
|
||||
break;
|
||||
|
||||
case "CollectionNumber":
|
||||
var tmdbCollection = reader.ReadElementContentAsString();
|
||||
if (!string.IsNullOrWhiteSpace(tmdbCollection))
|
||||
{
|
||||
item.SetProviderId(MetadataProviders.TmdbCollection, tmdbCollection);
|
||||
}
|
||||
break;
|
||||
|
||||
case "TVcomId":
|
||||
var TVcomId = reader.ReadElementContentAsString();
|
||||
if (!string.IsNullOrWhiteSpace(TVcomId))
|
||||
@@ -602,8 +621,8 @@ namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
switch (reader.Name)
|
||||
{
|
||||
// Removed support for "Value" tag as it conflicted with MPAA rating but leaving this function for possible
|
||||
// future support of "Description" -ebr
|
||||
// Removed support for "Value" tag as it conflicted with MPAA rating but leaving this function for possible
|
||||
// future support of "Description" -ebr
|
||||
|
||||
default:
|
||||
reader.Skip();
|
||||
@@ -679,7 +698,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
|
||||
// Only split by comma if there is no pipe in the string
|
||||
// We have to be careful to not split names like Matthew, Jr.
|
||||
var separator = value.IndexOf('|') == -1 ? ',' : '|';
|
||||
var separator = value.IndexOf('|') == -1 && value.IndexOf(';') == -1 ? new[] { ',' } : new[] { '|', ';' };
|
||||
|
||||
value = value.Trim().Trim(separator);
|
||||
|
||||
@@ -690,12 +709,12 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// Provides an additional overload for string.split
|
||||
/// </summary>
|
||||
/// <param name="val">The val.</param>
|
||||
/// <param name="separator">The separator.</param>
|
||||
/// <param name="separators">The separators.</param>
|
||||
/// <param name="options">The options.</param>
|
||||
/// <returns>System.String[][].</returns>
|
||||
private static string[] Split(string val, char separator, StringSplitOptions options)
|
||||
private static string[] Split(string val, char[] separators, StringSplitOptions options)
|
||||
{
|
||||
return val.Split(new[] { separator }, options);
|
||||
return val.Split(separators, options);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
@@ -6,6 +7,9 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace MediaBrowser.Controller.Providers
|
||||
{
|
||||
/// <summary>
|
||||
/// Interface IProviderManager
|
||||
/// </summary>
|
||||
public interface IProviderManager
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,8 +25,17 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// <exception cref="System.ArgumentNullException">item</exception>
|
||||
Task<string> DownloadAndSaveImage(BaseItem item, string source, string targetName, bool saveLocally, SemaphoreSlim resourcePool, CancellationToken cancellationToken);
|
||||
|
||||
/// <summary>
|
||||
/// Saves the image.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="source">The source.</param>
|
||||
/// <param name="targetName">Name of the target.</param>
|
||||
/// <param name="saveLocally">if set to <c>true</c> [save locally].</param>
|
||||
/// <param name="cancellationToken">The cancellation token.</param>
|
||||
/// <returns>Task{System.String}.</returns>
|
||||
Task<string> SaveImage(BaseItem item, Stream source, string targetName, bool saveLocally, CancellationToken cancellationToken);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Saves to library filesystem.
|
||||
/// </summary>
|
||||
@@ -48,7 +61,9 @@ namespace MediaBrowser.Controller.Providers
|
||||
/// Adds the metadata providers.
|
||||
/// </summary>
|
||||
/// <param name="providers">The providers.</param>
|
||||
void AddMetadataProviders(IEnumerable<BaseMetadataProvider> providers);
|
||||
/// <param name="savers">The savers.</param>
|
||||
void AddParts(IEnumerable<BaseMetadataProvider> providers,
|
||||
IEnumerable<IMetadataSaver> savers);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the save path.
|
||||
|
||||
Reference in New Issue
Block a user