have seasons refresh on series folder changes
This commit is contained in:
parent
de005051f8
commit
e23efc9a84
|
@ -325,6 +325,16 @@ namespace MediaBrowser.Controller.Providers
|
|||
return !item.ResolveArgs.IsDirectory;
|
||||
}
|
||||
|
||||
protected virtual IEnumerable<BaseItem> GetItemsForFileStampComparison(BaseItem item)
|
||||
{
|
||||
if (UseParentFileSystemStamp(item) && item.Parent != null)
|
||||
{
|
||||
return new[] { item.Parent };
|
||||
}
|
||||
|
||||
return new[] { item };
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the item's current file system stamp
|
||||
/// </summary>
|
||||
|
@ -332,12 +342,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <returns>Guid.</returns>
|
||||
private Guid GetCurrentFileSystemStamp(BaseItem item)
|
||||
{
|
||||
if (UseParentFileSystemStamp(item) && item.Parent != null)
|
||||
{
|
||||
return GetFileSystemStamp(item.Parent);
|
||||
}
|
||||
|
||||
return GetFileSystemStamp(item);
|
||||
return GetFileSystemStamp(GetItemsForFileStampComparison(item));
|
||||
}
|
||||
|
||||
private Dictionary<string, string> _fileStampExtensionsDictionary;
|
||||
|
@ -355,42 +360,36 @@ namespace MediaBrowser.Controller.Providers
|
|||
/// <summary>
|
||||
/// Gets the file system stamp.
|
||||
/// </summary>
|
||||
/// <param name="item">The item.</param>
|
||||
/// <param name="items">The items.</param>
|
||||
/// <returns>Guid.</returns>
|
||||
protected virtual Guid GetFileSystemStamp(BaseItem item)
|
||||
protected virtual Guid GetFileSystemStamp(IEnumerable<BaseItem> items)
|
||||
{
|
||||
// If there's no path or the item is a file, there's nothing to do
|
||||
if (item.LocationType != LocationType.FileSystem)
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
ItemResolveArgs resolveArgs;
|
||||
|
||||
try
|
||||
{
|
||||
resolveArgs = item.ResolveArgs;
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
Logger.ErrorException("Error determining if path is directory: {0}", ex, item.Path);
|
||||
throw;
|
||||
}
|
||||
|
||||
if (!resolveArgs.IsDirectory)
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
|
||||
var extensions = FileStampExtensionsDictionary;
|
||||
var numExtensions = FilestampExtensions.Length;
|
||||
|
||||
// Record the name of each file
|
||||
// Need to sort these because accoring to msdn docs, our i/o methods are not guaranteed in any order
|
||||
AddFiles(sb, resolveArgs.FileSystemChildren, extensions, numExtensions);
|
||||
AddFiles(sb, resolveArgs.MetadataFiles, extensions, numExtensions);
|
||||
foreach (var item in items)
|
||||
{
|
||||
// If there's no path or the item is a file, there's nothing to do
|
||||
if (item.LocationType == LocationType.FileSystem)
|
||||
{
|
||||
var resolveArgs = item.ResolveArgs;
|
||||
|
||||
if (resolveArgs.IsDirectory)
|
||||
{
|
||||
// Record the name of each file
|
||||
// Need to sort these because accoring to msdn docs, our i/o methods are not guaranteed in any order
|
||||
AddFiles(sb, resolveArgs.FileSystemChildren, extensions, numExtensions);
|
||||
AddFiles(sb, resolveArgs.MetadataFiles, extensions, numExtensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (sb.Length == 0)
|
||||
{
|
||||
return Guid.Empty;
|
||||
}
|
||||
|
||||
return sb.ToString().GetMD5();
|
||||
}
|
||||
|
|
|
@ -1,43 +1,17 @@
|
|||
<Properties>
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|x86" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="MediaBrowser.Server.Implementations\Library\UserManager.cs">
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="C:\Program Files (x86)\Mono-3.2.3\lib\mono\4.0\Microsoft.Common.targets">
|
||||
<Files>
|
||||
<File FileName="MediaBrowser.Server.Mono\app.config" Line="9" Column="10" />
|
||||
<File FileName="MediaBrowser.Server.Mono\app.config" Line="1" Column="1" />
|
||||
<File FileName="MediaBrowser.Server.Mono\FFMpeg\FFMpegDownloadInfo.cs" Line="1" Column="1" />
|
||||
<File FileName="MediaBrowser.Server.Mono\Program.cs" Line="84" Column="7" />
|
||||
<File FileName="MediaBrowser.Server.Implementations\Library\UserManager.cs" Line="235" Column="10" />
|
||||
<File FileName="MediaBrowser.Server.Mono\Program.cs" Line="1" Column="1" />
|
||||
<File FileName="MediaBrowser.Server.Implementations\Library\UserManager.cs" Line="407" Column="4" />
|
||||
<File FileName="C:\Program Files (x86)\Mono-3.2.3\lib\mono\4.0\Microsoft.Common.targets" Line="8" Column="15" />
|
||||
</Files>
|
||||
<Pads>
|
||||
<Pad Id="ProjectPad">
|
||||
<State expanded="True">
|
||||
<Node name="MediaBrowser.Api" expanded="True" />
|
||||
<Node name="MediaBrowser.Common" expanded="True" />
|
||||
<Node name="MediaBrowser.Common.Implementations" expanded="True" />
|
||||
<Node name="MediaBrowser.Controller" expanded="True" />
|
||||
<Node name="MediaBrowser.Server.Implementations" expanded="True">
|
||||
<Node name="Library" expanded="True">
|
||||
<Node name="UserManager.cs" selected="True" />
|
||||
</Node>
|
||||
</Node>
|
||||
<Node name="MediaBrowser.Server.Mono" expanded="True">
|
||||
<Node name="References" expanded="True" />
|
||||
<Node name="FFMpeg" expanded="True" />
|
||||
</Node>
|
||||
<Node name="MediaBrowser.WebDashboard" expanded="True" />
|
||||
</State>
|
||||
</Pad>
|
||||
<Pad Id="ClassPad">
|
||||
<State expanded="True" selected="True" />
|
||||
</Pad>
|
||||
<Pad Id="MonoDevelop.Debugger.WatchPad">
|
||||
<State />
|
||||
</Pad>
|
||||
</Pads>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore>
|
||||
<Breakpoint file="D:\Development\MediaBrowser\MediaBrowser.Common.Implementations\HttpClientManager\HttpClientManager.cs" line="477" column="17" />
|
||||
<Breakpoint file="D:\Development\MediaBrowser\MediaBrowser.Server.Implementations\Library\UserManager.cs" line="222" column="1" />
|
||||
</BreakpointStore>
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<MonoDevelop.Ide.DebuggingService.PinnedWatches />
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.IO;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
|
@ -35,9 +36,9 @@ namespace MediaBrowser.Providers
|
|||
.FirstOrDefault(i => i != null);
|
||||
}
|
||||
|
||||
protected override Guid GetFileSystemStamp(BaseItem item)
|
||||
protected override Guid GetFileSystemStamp(IEnumerable<BaseItem> items)
|
||||
{
|
||||
var files = item.ResolveArgs.PhysicalLocations
|
||||
var files = items.SelectMany(i => i.ResolveArgs.PhysicalLocations)
|
||||
.Select(i => new DirectoryInfo(i))
|
||||
.SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly))
|
||||
.Where(i =>
|
||||
|
|
|
@ -58,6 +58,21 @@ namespace MediaBrowser.Providers
|
|||
return false;
|
||||
}
|
||||
|
||||
protected override IEnumerable<BaseItem> GetItemsForFileStampComparison(BaseItem item)
|
||||
{
|
||||
var season = item as Season;
|
||||
if (season != null)
|
||||
{
|
||||
var series = season.Series;
|
||||
if (series != null)
|
||||
{
|
||||
return new[] { item, series };
|
||||
}
|
||||
}
|
||||
|
||||
return base.GetItemsForFileStampComparison(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the priority.
|
||||
/// </summary>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.IO;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.Configuration;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
|
@ -69,9 +70,9 @@ namespace MediaBrowser.Providers
|
|||
return GetImageFromLocation(location, filenameWithoutExtension);
|
||||
}
|
||||
|
||||
protected override Guid GetFileSystemStamp(BaseItem item)
|
||||
protected override Guid GetFileSystemStamp(IEnumerable<BaseItem> items)
|
||||
{
|
||||
var location = GetLocation(item);
|
||||
var location = GetLocation(items.First());
|
||||
|
||||
try
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user