distinguish between metadata download and edit
This commit is contained in:
parent
58356619ff
commit
ab6a060163
|
@ -797,7 +797,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
await ((Folder)child).ValidateChildren(innerProgress, cancellationToken, recursive).ConfigureAwait(false);
|
await ((Folder)child).ValidateChildren(innerProgress, cancellationToken, recursive, forceRefreshMetadata).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,11 +9,12 @@ namespace MediaBrowser.Controller.Library
|
||||||
public interface IMetadataSaver
|
public interface IMetadataSaver
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
bool Supports(BaseItem item);
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
bool IsEnabledFor(BaseItem item, ItemUpdateType updateType);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the save path.
|
/// Gets the save path.
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace MediaBrowser.Controller.Library
|
||||||
Unspecified = 1,
|
Unspecified = 1,
|
||||||
MetadataImport = 2,
|
MetadataImport = 2,
|
||||||
ImageUpdate = 4,
|
ImageUpdate = 4,
|
||||||
|
MetadataDownload = 8,
|
||||||
MetadataEdit = 16
|
MetadataEdit = 16
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -706,7 +706,7 @@ namespace MediaBrowser.Controller.Providers
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(tag))
|
if (!string.IsNullOrWhiteSpace(tag))
|
||||||
{
|
{
|
||||||
item.AddTagline(tag);
|
item.AddTag(tag);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace MediaBrowser.Controller.Providers
|
||||||
|
|
||||||
public virtual ItemUpdateType ItemUpdateType
|
public virtual ItemUpdateType ItemUpdateType
|
||||||
{
|
{
|
||||||
get { return RequiresInternet ? ItemUpdateType.MetadataEdit : ItemUpdateType.MetadataImport; }
|
get { return RequiresInternet ? ItemUpdateType.MetadataDownload : ItemUpdateType.MetadataImport; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -71,7 +71,7 @@ namespace MediaBrowser.Providers.Movies
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataEdit;
|
return ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataDownload;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -21,20 +21,18 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
return item is MusicAlbum;
|
||||||
}
|
|
||||||
|
|
||||||
if (item is MusicAlbum)
|
|
||||||
{
|
|
||||||
return _config.Configuration.SaveLocalMeta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -21,23 +21,34 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (item is MusicArtist)
|
if (item is MusicArtist)
|
||||||
{
|
{
|
||||||
return _config.Configuration.SaveLocalMeta;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return item is Artist;
|
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||||
|
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
|
{
|
||||||
|
if (item is Artist)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -19,25 +19,23 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_config.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return item is BoxSet;
|
return item is BoxSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the specified item.
|
/// Saves the specified item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Entities;
|
|
||||||
using MediaBrowser.Providers.TV;
|
using MediaBrowser.Providers.TV;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
@ -18,18 +17,21 @@ namespace MediaBrowser.Providers.Savers
|
||||||
private readonly IServerConfigurationManager _config;
|
private readonly IServerConfigurationManager _config;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (!_config.Configuration.SaveLocalMeta || item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
return item is Episode;
|
||||||
}
|
}
|
||||||
|
|
||||||
return item is Episode;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||||
|
|
|
@ -21,34 +21,40 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (item.LocationType != LocationType.FileSystem)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(item is Folder))
|
if (!(item is Folder))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// For these we can proceed even if save local metadata is off
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
|
{
|
||||||
|
if (!(item is Series) && !(item is BoxSet) && !(item is MusicArtist) && !(item is MusicAlbum) &&
|
||||||
|
!(item is Season))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||||
|
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
|
{
|
||||||
if (item is AggregateFolder || item is UserRootFolder || item is CollectionFolder)
|
if (item is AggregateFolder || item is UserRootFolder || item is CollectionFolder)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_config.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return !(item is Series) && !(item is BoxSet) && !(item is MusicArtist) && !(item is MusicAlbum) && !(item is Season);
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -24,28 +24,31 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (!_config.Configuration.SaveLocalMeta || item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var trailer = item as Trailer;
|
var trailer = item as Trailer;
|
||||||
|
|
||||||
|
// Don't support local trailers
|
||||||
if (trailer != null)
|
if (trailer != null)
|
||||||
{
|
{
|
||||||
return !trailer.IsLocalTrailer;
|
return !trailer.IsLocalTrailer;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't support local trailers
|
|
||||||
return item is Movie || item is MusicVideo;
|
return item is Movie || item is MusicVideo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the specified item.
|
/// Saves the specified item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -15,18 +15,21 @@ namespace MediaBrowser.Providers.Savers
|
||||||
public class PersonXmlSaver : IMetadataSaver
|
public class PersonXmlSaver : IMetadataSaver
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded or metadata was manually edited, proceed
|
||||||
|
if ((updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
return item is Person;
|
||||||
}
|
}
|
||||||
|
|
||||||
return item is Person;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -19,25 +19,23 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!_config.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return item is Season;
|
return item is Season;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Saves the specified item.
|
/// Saves the specified item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
using System;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Configuration;
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
|
using MediaBrowser.Providers.TV;
|
||||||
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Security;
|
using System.Security;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using MediaBrowser.Providers.TV;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Savers
|
namespace MediaBrowser.Providers.Savers
|
||||||
{
|
{
|
||||||
|
@ -22,18 +22,21 @@ namespace MediaBrowser.Providers.Savers
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Supportses the specified item.
|
/// Determines whether [is enabled for] [the specified item].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns>
|
/// <param name="updateType">Type of the update.</param>
|
||||||
public bool Supports(BaseItem item)
|
/// <returns><c>true</c> if [is enabled for] [the specified item]; otherwise, <c>false</c>.</returns>
|
||||||
|
public bool IsEnabledFor(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
if (!_config.Configuration.SaveLocalMeta || item.LocationType != LocationType.FileSystem)
|
// If new metadata has been downloaded and save local is on, OR metadata was manually edited, proceed
|
||||||
|
if ((_config.Configuration.SaveLocalMeta && (updateType & ItemUpdateType.MetadataDownload) == ItemUpdateType.MetadataDownload)
|
||||||
|
|| (updateType & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
||||||
{
|
{
|
||||||
return false;
|
return item is Series;
|
||||||
}
|
}
|
||||||
|
|
||||||
return item is Series;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -65,7 +65,7 @@ namespace MediaBrowser.Providers.TV
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataEdit;
|
return ItemUpdateType.ImageUpdate | ItemUpdateType.MetadataDownload;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -358,14 +358,6 @@ namespace MediaBrowser.Providers.TV
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ConfigurationManager.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
//if (!Directory.Exists(episode.MetaLocation)) Directory.CreateDirectory(episode.MetaLocation);
|
|
||||||
//var ms = new MemoryStream();
|
|
||||||
//doc.Save(ms);
|
|
||||||
|
|
||||||
//await _providerManager.SaveToLibraryFilesystem(episode, Path.Combine(episode.MetaLocation, Path.GetFileNameWithoutExtension(episode.Path) + ".xml"), ms, cancellationToken).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
|
@ -258,6 +258,7 @@ namespace MediaBrowser.Providers.TV
|
||||||
seriesDoc.Load(seriesXmlPath);
|
seriesDoc.Load(seriesXmlPath);
|
||||||
|
|
||||||
FetchMainInfo(series, seriesDoc);
|
FetchMainInfo(series, seriesDoc);
|
||||||
|
|
||||||
if (!series.LockedFields.Contains(MetadataFields.Cast))
|
if (!series.LockedFields.Contains(MetadataFields.Cast))
|
||||||
{
|
{
|
||||||
var actorsDoc = new XmlDocument();
|
var actorsDoc = new XmlDocument();
|
||||||
|
@ -424,18 +425,6 @@ namespace MediaBrowser.Providers.TV
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
private void FetchActors(Series series, XmlDocument actorsDoc, XmlDocument seriesDoc)
|
private void FetchActors(Series series, XmlDocument actorsDoc, XmlDocument seriesDoc)
|
||||||
{
|
{
|
||||||
XmlNode actorsNode = null;
|
|
||||||
if (ConfigurationManager.Configuration.SaveLocalMeta)
|
|
||||||
{
|
|
||||||
//add to the main seriesDoc for saving
|
|
||||||
var seriesNode = seriesDoc.SelectSingleNode("//Series");
|
|
||||||
if (seriesNode != null)
|
|
||||||
{
|
|
||||||
actorsNode = seriesDoc.CreateNode(XmlNodeType.Element, "Persons", null);
|
|
||||||
seriesNode.AppendChild(actorsNode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var xmlNodeList = actorsDoc.SelectNodes("Actors/Actor");
|
var xmlNodeList = actorsDoc.SelectNodes("Actors/Actor");
|
||||||
|
|
||||||
if (xmlNodeList != null)
|
if (xmlNodeList != null)
|
||||||
|
@ -450,20 +439,6 @@ namespace MediaBrowser.Providers.TV
|
||||||
{
|
{
|
||||||
// Sometimes tvdb actors have leading spaces
|
// Sometimes tvdb actors have leading spaces
|
||||||
series.AddPerson(new PersonInfo { Type = PersonType.Actor, Name = actorName.Trim(), Role = actorRole });
|
series.AddPerson(new PersonInfo { Type = PersonType.Actor, Name = actorName.Trim(), Role = actorRole });
|
||||||
|
|
||||||
if (ConfigurationManager.Configuration.SaveLocalMeta && actorsNode != null)
|
|
||||||
{
|
|
||||||
//create in main seriesDoc
|
|
||||||
var personNode = seriesDoc.CreateNode(XmlNodeType.Element, "Person", null);
|
|
||||||
foreach (XmlNode subNode in p.ChildNodes)
|
|
||||||
personNode.AppendChild(seriesDoc.ImportNode(subNode, true));
|
|
||||||
//need to add the type
|
|
||||||
var typeNode = seriesDoc.CreateNode(XmlNodeType.Element, "Type", null);
|
|
||||||
typeNode.InnerText = PersonType.Actor;
|
|
||||||
personNode.AppendChild(typeNode);
|
|
||||||
actorsNode.AppendChild(personNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -347,7 +347,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
await UpdateItem(season, ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
|
await UpdateItem(season, ItemUpdateType.MetadataDownload, cancellationToken).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
@ -1311,10 +1311,9 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
|
|
||||||
UpdateItemInLibraryCache(item);
|
UpdateItemInLibraryCache(item);
|
||||||
|
|
||||||
// If metadata was downloaded or edited, save external metadata
|
if (item.LocationType == LocationType.FileSystem)
|
||||||
if ((updateReason & ItemUpdateType.MetadataEdit) == ItemUpdateType.MetadataEdit)
|
|
||||||
{
|
{
|
||||||
await SaveMetadata(item).ConfigureAwait(false);
|
await SaveMetadata(item, updateReason).ConfigureAwait(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ItemUpdated != null)
|
if (ItemUpdated != null)
|
||||||
|
@ -1365,10 +1364,11 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||||
/// Saves the metadata.
|
/// Saves the metadata.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
|
/// <param name="updateType">Type of the update.</param>
|
||||||
/// <returns>Task.</returns>
|
/// <returns>Task.</returns>
|
||||||
private async Task SaveMetadata(BaseItem item)
|
private async Task SaveMetadata(BaseItem item, ItemUpdateType updateType)
|
||||||
{
|
{
|
||||||
foreach (var saver in _savers.Where(i => i.Supports(item)))
|
foreach (var saver in _savers.Where(i => i.IsEnabledFor(item, updateType)))
|
||||||
{
|
{
|
||||||
var path = saver.GetSavePath(item);
|
var path = saver.GetSavePath(item);
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.131</version>
|
<version>3.0.132</version>
|
||||||
<title>MediaBrowser.Common.Internal</title>
|
<title>MediaBrowser.Common.Internal</title>
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
<description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.131" />
|
<dependency id="MediaBrowser.Common" version="3.0.132" />
|
||||||
<dependency id="NLog" version="2.0.1.2" />
|
<dependency id="NLog" version="2.0.1.2" />
|
||||||
<dependency id="ServiceStack.Text" version="3.9.45" />
|
<dependency id="ServiceStack.Text" version="3.9.45" />
|
||||||
<dependency id="SimpleInjector" version="2.2.3" />
|
<dependency id="SimpleInjector" version="2.2.3" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.131</version>
|
<version>3.0.132</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.131</version>
|
<version>3.0.132</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.131" />
|
<dependency id="MediaBrowser.Common" version="3.0.132" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user