This commit is contained in:
Eric Reed 2013-08-26 13:11:51 -04:00
commit af0d855d58
4 changed files with 22 additions and 10 deletions

View File

@ -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)

View File

@ -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>

View File

@ -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)
{

View File

@ -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);
}
}
}