support mcm episodes
This commit is contained in:
parent
f29469c905
commit
60e2fd4d44
|
@ -1,4 +1,5 @@
|
||||||
using MediaBrowser.Controller.Providers;
|
using System.Linq;
|
||||||
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
@ -42,7 +43,18 @@ namespace MediaBrowser.Controller.Entities
|
||||||
|
|
||||||
public BookInfo GetLookupInfo()
|
public BookInfo GetLookupInfo()
|
||||||
{
|
{
|
||||||
return GetItemLookupInfo<BookInfo>();
|
var info = GetItemLookupInfo<BookInfo>();
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(SeriesName))
|
||||||
|
{
|
||||||
|
info.SeriesName = Parents.Select(i => i.Name).FirstOrDefault();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
info.SeriesName = SeriesName;
|
||||||
|
}
|
||||||
|
|
||||||
|
return info;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Model.LiveTv;
|
using MediaBrowser.Model.LiveTv;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.LiveTv
|
namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
|
@ -184,5 +187,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
{
|
{
|
||||||
return "Program";
|
return "Program";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Task UpdateToRepository(ItemUpdateType updateReason, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
// Avoid library manager and keep out of in-memory cache
|
||||||
|
// Not great that this class has to know about that, but we'll improve that later.
|
||||||
|
return ItemRepository.SaveItem(this, cancellationToken);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System.Threading;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Providers
|
namespace MediaBrowser.Controller.Providers
|
||||||
{
|
{
|
||||||
|
@ -17,7 +18,7 @@ namespace MediaBrowser.Controller.Providers
|
||||||
/// <param name="info">The information.</param>
|
/// <param name="info">The information.</param>
|
||||||
/// <param name="cancellationToken">The cancellation token.</param>
|
/// <param name="cancellationToken">The cancellation token.</param>
|
||||||
/// <returns>Task{MetadataResult{`0}}.</returns>
|
/// <returns>Task{MetadataResult{`0}}.</returns>
|
||||||
Task<MetadataResult<TItemType>> GetMetadata(ItemInfo info, CancellationToken cancellationToken);
|
Task<LocalMetadataResult<TItemType>> GetMetadata(ItemInfo info, CancellationToken cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ItemInfo
|
public class ItemInfo
|
||||||
|
@ -26,4 +27,18 @@ namespace MediaBrowser.Controller.Providers
|
||||||
|
|
||||||
public bool IsInMixedFolder { get; set; }
|
public bool IsInMixedFolder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LocalMetadataResult<T>
|
||||||
|
where T : IHasMetadata
|
||||||
|
{
|
||||||
|
public bool HasMetadata { get; set; }
|
||||||
|
public T Item { get; set; }
|
||||||
|
|
||||||
|
public List<LocalImageInfo> Images { get; set; }
|
||||||
|
|
||||||
|
public LocalMetadataResult()
|
||||||
|
{
|
||||||
|
Images = new List<LocalImageInfo>();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -147,7 +147,7 @@ namespace MediaBrowser.Controller.Providers
|
||||||
|
|
||||||
public class BookInfo : ItemLookupInfo
|
public class BookInfo : ItemLookupInfo
|
||||||
{
|
{
|
||||||
|
public string SeriesName { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SeasonInfo : ItemLookupInfo
|
public class SeasonInfo : ItemLookupInfo
|
||||||
|
|
|
@ -18,9 +18,9 @@ namespace MediaBrowser.Providers.AdultVideos
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(AdultVideo item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<AdultVideo> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new MovieXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new MovieXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Controller.Entities.Audio;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -28,6 +29,12 @@ namespace MediaBrowser.Providers.All
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Extracted images will be saved in here
|
||||||
|
if (item is Audio)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
var locationType = item.LocationType;
|
var locationType = item.LocationType;
|
||||||
|
|
||||||
if (locationType == LocationType.FileSystem ||
|
if (locationType == LocationType.FileSystem ||
|
||||||
|
|
|
@ -13,9 +13,9 @@ namespace MediaBrowser.Providers
|
||||||
{
|
{
|
||||||
protected IFileSystem FileSystem;
|
protected IFileSystem FileSystem;
|
||||||
|
|
||||||
public async Task<MetadataResult<T>> GetMetadata(ItemInfo info, CancellationToken cancellationToken)
|
public async Task<LocalMetadataResult<T>> GetMetadata(ItemInfo info, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var result = new MetadataResult<T>();
|
var result = new LocalMetadataResult<T>();
|
||||||
|
|
||||||
var file = GetXmlFile(info);
|
var file = GetXmlFile(info);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ namespace MediaBrowser.Providers
|
||||||
{
|
{
|
||||||
result.Item = new T();
|
result.Item = new T();
|
||||||
|
|
||||||
Fetch(result.Item, path, cancellationToken);
|
Fetch(result, path, cancellationToken);
|
||||||
result.HasMetadata = true;
|
result.HasMetadata = true;
|
||||||
}
|
}
|
||||||
catch (FileNotFoundException)
|
catch (FileNotFoundException)
|
||||||
|
@ -47,7 +47,7 @@ namespace MediaBrowser.Providers
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract void Fetch(T item, string path, CancellationToken cancellationToken);
|
protected abstract void Fetch(LocalMetadataResult<T> result, string path, CancellationToken cancellationToken);
|
||||||
|
|
||||||
protected BaseXmlProvider(IFileSystem fileSystem)
|
protected BaseXmlProvider(IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,9 +20,9 @@ namespace MediaBrowser.Providers.BoxSets
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(BoxSet item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<BoxSet> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<BoxSet>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<BoxSet>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -20,9 +20,9 @@ namespace MediaBrowser.Providers.Folders
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Folder item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Folder> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<Folder>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<Folder>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.Games
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(GameSystem item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<GameSystem> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new GameSystemXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new GameSystemXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.Games
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Game item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Game> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new GameXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new GameXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.LiveTv
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(LiveTvChannel item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<LiveTvChannel> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<LiveTvChannel>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<LiveTvChannel>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -345,6 +345,10 @@ namespace MediaBrowser.Providers.Manager
|
||||||
// None of the save local conditions passed, so store it in our internal folders
|
// None of the save local conditions passed, so store it in our internal folders
|
||||||
if (string.IsNullOrEmpty(path))
|
if (string.IsNullOrEmpty(path))
|
||||||
{
|
{
|
||||||
|
if (string.IsNullOrEmpty(filename))
|
||||||
|
{
|
||||||
|
filename = "folder";
|
||||||
|
}
|
||||||
path = Path.Combine(_config.ApplicationPaths.GetInternalMetadataPath(item.Id), filename + extension);
|
path = Path.Combine(_config.ApplicationPaths.GetInternalMetadataPath(item.Id), filename + extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -262,7 +262,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
return providers;
|
return providers;
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool MergeImages(IHasImages item, List<LocalImageInfo> images)
|
public bool MergeImages(IHasImages item, List<LocalImageInfo> images)
|
||||||
{
|
{
|
||||||
var changed = false;
|
var changed = false;
|
||||||
|
|
||||||
|
|
|
@ -111,7 +111,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
|
|
||||||
if (providers.Count > 0)
|
if (providers.Count > 0)
|
||||||
{
|
{
|
||||||
var result = await RefreshWithProviders(itemOfType, refreshOptions, providers, cancellationToken).ConfigureAwait(false);
|
var result = await RefreshWithProviders(itemOfType, refreshOptions, providers, itemImageProvider, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
updateType = updateType | result.UpdateType;
|
updateType = updateType | result.UpdateType;
|
||||||
refreshResult.AddStatus(result.Status, result.ErrorMessage);
|
refreshResult.AddStatus(result.Status, result.ErrorMessage);
|
||||||
|
@ -254,7 +254,7 @@ namespace MediaBrowser.Providers.Manager
|
||||||
return item is TItemType;
|
return item is TItemType;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual async Task<RefreshResult> RefreshWithProviders(TItemType item, MetadataRefreshOptions options, List<IMetadataProvider> providers, CancellationToken cancellationToken)
|
protected virtual async Task<RefreshResult> RefreshWithProviders(TItemType item, MetadataRefreshOptions options, List<IMetadataProvider> providers, ItemImageProvider imageService, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var refreshResult = new RefreshResult
|
var refreshResult = new RefreshResult
|
||||||
{
|
{
|
||||||
|
@ -285,6 +285,11 @@ namespace MediaBrowser.Providers.Manager
|
||||||
|
|
||||||
if (localItem.HasMetadata)
|
if (localItem.HasMetadata)
|
||||||
{
|
{
|
||||||
|
if (imageService.MergeImages(item, localItem.Images))
|
||||||
|
{
|
||||||
|
refreshResult.UpdateType = refreshResult.UpdateType | ItemUpdateType.MetadataImport;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(localItem.Item.Name))
|
if (!string.IsNullOrEmpty(localItem.Item.Name))
|
||||||
{
|
{
|
||||||
MergeData(localItem.Item, temp, new List<MetadataFields>(), !options.ReplaceAllMetadata, true);
|
MergeData(localItem.Item, temp, new List<MetadataFields>(), !options.ReplaceAllMetadata, true);
|
||||||
|
|
|
@ -215,11 +215,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
|
|
||||||
foreach (var whitelistArtist in GetSplitWhitelist())
|
foreach (var whitelistArtist in GetSplitWhitelist())
|
||||||
{
|
{
|
||||||
if (val.IndexOf(whitelistArtist, StringComparison.OrdinalIgnoreCase) != -1)
|
var originalVal = val;
|
||||||
{
|
val = val.Replace(whitelistArtist, "|", StringComparison.OrdinalIgnoreCase);
|
||||||
val = val.Replace(whitelistArtist, "|", StringComparison.OrdinalIgnoreCase);
|
|
||||||
|
|
||||||
// TODO: Preserve casing from original tag
|
if (!string.Equals(originalVal, val, StringComparison.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
// TODO: Preserve casing from original value
|
||||||
artistsFound.Add(whitelistArtist);
|
artistsFound.Add(whitelistArtist);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,6 +71,10 @@ namespace MediaBrowser.Providers.Movies
|
||||||
name = name.Replace(".", " ");
|
name = name.Replace(".", " ");
|
||||||
name = name.Replace("_", " ");
|
name = name.Replace("_", " ");
|
||||||
name = name.Replace("-", " ");
|
name = name.Replace("-", " ");
|
||||||
|
name = name.Replace("!", " ");
|
||||||
|
name = name.Replace("?", " ");
|
||||||
|
|
||||||
|
name = name.Trim();
|
||||||
|
|
||||||
// Search again if the new name is different
|
// Search again if the new name is different
|
||||||
if (!string.Equals(name, originalName))
|
if (!string.Equals(name, originalName))
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.Movies
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Movie item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Movie> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new MovieXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new MovieXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.Movies
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Trailer item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Trailer> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new MovieXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new MovieXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.Music
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(MusicAlbum item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<MusicAlbum> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<MusicAlbum>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<MusicAlbum>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.Music
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(MusicArtist item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<MusicArtist> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<MusicArtist>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<MusicArtist>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -19,9 +19,9 @@ namespace MediaBrowser.Providers.Music
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(MusicVideo item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<MusicVideo> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new MusicVideoXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new MusicVideoXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Providers.Omdb
|
||||||
|
|
||||||
public string Name
|
public string Name
|
||||||
{
|
{
|
||||||
get { return "OMDb"; }
|
get { return "IMDb via The Open Movie Database"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public Task<ItemUpdateType> FetchAsync(Series item, CancellationToken cancellationToken)
|
public Task<ItemUpdateType> FetchAsync(Series item, CancellationToken cancellationToken)
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.People
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Person item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Person> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<Person>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<Person>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -3,6 +3,7 @@ using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -15,14 +16,18 @@ namespace MediaBrowser.Providers.TV
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EpisodeXmlParser : BaseItemXmlParser<Episode>
|
public class EpisodeXmlParser : BaseItemXmlParser<Episode>
|
||||||
{
|
{
|
||||||
|
private List<LocalImageInfo> _imagesFound;
|
||||||
|
|
||||||
public EpisodeXmlParser(ILogger logger)
|
public EpisodeXmlParser(ILogger logger)
|
||||||
: base(logger)
|
: base(logger)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public void FetchAsync(Episode item, string metadataFile, CancellationToken cancellationToken)
|
public void Fetch(Episode item, List<LocalImageInfo> images, string metadataFile, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
Fetch(item, metadataFile, cancellationToken);
|
_imagesFound = images;
|
||||||
|
|
||||||
|
Fetch(item, metadataFile, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
private static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||||
|
@ -66,17 +71,22 @@ namespace MediaBrowser.Providers.TV
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(filename))
|
if (!string.IsNullOrWhiteSpace(filename))
|
||||||
{
|
{
|
||||||
//// Strip off everything but the filename. Some metadata tools like MetaBrowser v1.0 will have an 'episodes' prefix
|
// Strip off everything but the filename. Some metadata tools like MetaBrowser v1.0 will have an 'episodes' prefix
|
||||||
//// even though it's actually using the metadata folder.
|
// even though it's actually using the metadata folder.
|
||||||
//filename = Path.GetFileName(filename);
|
filename = Path.GetFileName(filename);
|
||||||
|
|
||||||
//var seasonFolder = Path.GetDirectoryName(item.Path);
|
var parentFolder = Path.GetDirectoryName(item.Path);
|
||||||
//filename = Path.Combine(seasonFolder, "metadata", filename);
|
filename = Path.Combine(parentFolder, "metadata", filename);
|
||||||
|
var file = new FileInfo(filename);
|
||||||
|
|
||||||
//if (File.Exists(filename))
|
if (file.Exists)
|
||||||
//{
|
{
|
||||||
// item.SetImagePath(ImageType.Primary, 0, filename);
|
_imagesFound.Add(new LocalImageInfo
|
||||||
//}
|
{
|
||||||
|
Type = ImageType.Primary,
|
||||||
|
FileInfo = file
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,9 +17,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Episode item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Episode> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new EpisodeXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new EpisodeXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -20,9 +20,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Season item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Season> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new BaseItemXmlParser<Season>(_logger).Fetch(item, path, cancellationToken);
|
new BaseItemXmlParser<Season>(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -20,9 +20,9 @@ namespace MediaBrowser.Providers.TV
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Fetch(Series item, string path, CancellationToken cancellationToken)
|
protected override void Fetch(LocalMetadataResult<Series> result, string path, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
new SeriesXmlParser(_logger).Fetch(item, path, cancellationToken);
|
new SeriesXmlParser(_logger).Fetch(result.Item, path, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override FileInfo GetXmlFile(ItemInfo info)
|
protected override FileInfo GetXmlFile(ItemInfo info)
|
||||||
|
|
|
@ -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.322</version>
|
<version>3.0.324</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.322" />
|
<dependency id="MediaBrowser.Common" version="3.0.324" />
|
||||||
<dependency id="NLog" version="2.1.0" />
|
<dependency id="NLog" version="2.1.0" />
|
||||||
<dependency id="SimpleInjector" version="2.4.1" />
|
<dependency id="SimpleInjector" version="2.4.1" />
|
||||||
<dependency id="sharpcompress" version="0.10.2" />
|
<dependency id="sharpcompress" version="0.10.2" />
|
||||||
|
|
|
@ -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.322</version>
|
<version>3.0.324</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.322</version>
|
<version>3.0.324</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.322" />
|
<dependency id="MediaBrowser.Common" version="3.0.324" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user