Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
This commit is contained in:
commit
af0d855d58
|
@ -40,4 +40,5 @@
|
|||
- [mrwebsmith](https://github.com/mrwebsmith)
|
||||
- [rickster53](https://github.com/rickster53)
|
||||
- [Tharnax] (https://github.com/Tharnax)
|
||||
- [0sm0] (https://github.com/0sm0)
|
||||
- [0sm0] (https://github.com/0sm0)
|
||||
- [swhitmore](https://github.com/swhitmore)
|
|
@ -192,8 +192,6 @@ namespace MediaBrowser.Providers.Movies
|
|||
new Regex(@"(?<name>.*)") // last resort matches the whole string as the name
|
||||
};
|
||||
|
||||
public const string AltMetaFileName = "movie.xml";
|
||||
|
||||
protected override bool NeedsRefreshInternal(BaseItem item, BaseProviderInfo providerInfo)
|
||||
{
|
||||
if (HasAltMeta(item))
|
||||
|
@ -236,7 +234,10 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName("collection.xml");
|
||||
}
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName(AltMetaFileName);
|
||||
|
||||
var xmlFileName = MovieProviderFromXml.GetXmlFilename(item);
|
||||
|
||||
return item.LocationType == LocationType.FileSystem && item.ResolveArgs.ContainsMetaFileByName(xmlFileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -52,6 +52,13 @@ namespace MediaBrowser.Providers.Movies
|
|||
get { return MetadataProviderPriority.First; }
|
||||
}
|
||||
|
||||
internal static string GetXmlFilename(BaseItem item)
|
||||
{
|
||||
var filename = "movie.xml";
|
||||
|
||||
return Path.Combine(item.MetaLocation, filename);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Override this to return the date that should be compared to the last refresh date
|
||||
/// to determine if this provider should be re-fetched.
|
||||
|
@ -60,7 +67,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
/// <returns>DateTime.</returns>
|
||||
protected override DateTime CompareDate(BaseItem item)
|
||||
{
|
||||
var entry = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, "movie.xml"));
|
||||
var entry = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, GetXmlFilename(item)));
|
||||
return entry != null ? entry.LastWriteTimeUtc : DateTime.MinValue;
|
||||
}
|
||||
|
||||
|
@ -86,7 +93,7 @@ namespace MediaBrowser.Providers.Movies
|
|||
{
|
||||
cancellationToken.ThrowIfCancellationRequested();
|
||||
|
||||
var metadataFile = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, "movie.xml"));
|
||||
var metadataFile = item.ResolveArgs.GetMetaFileByPath(Path.Combine(item.MetaLocation, GetXmlFilename(item)));
|
||||
|
||||
if (metadataFile != null)
|
||||
{
|
||||
|
|
|
@ -119,11 +119,14 @@ namespace MediaBrowser.Providers.Savers
|
|||
|
||||
public string GetSavePath(BaseItem item)
|
||||
{
|
||||
var video = (Video)item;
|
||||
if (item.IsInMixedFolder)
|
||||
{
|
||||
return Path.ChangeExtension(item.Path, ".xml");
|
||||
}
|
||||
|
||||
return video.IsInMixedFolder ?
|
||||
Path.ChangeExtension(item.Path, ".xml") :
|
||||
Path.Combine(item.MetaLocation, "movie.xml");
|
||||
var filename = MovieProviderFromXml.GetXmlFilename(item);
|
||||
|
||||
return Path.Combine(item.MetaLocation, filename);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user