Fix build
This commit is contained in:
parent
fb090df0b5
commit
4367b97a54
|
@ -44,6 +44,11 @@ namespace Emby.Server.Implementations.Library
|
|||
|
||||
// Make sure DateCreated and DateModified have values
|
||||
var fileInfo = directoryService.GetFile(item.Path);
|
||||
if (fileInfo == null)
|
||||
{
|
||||
throw new FileNotFoundException("Can't find item path.", item.Path);
|
||||
}
|
||||
|
||||
SetDateCreated(item, fileInfo);
|
||||
|
||||
EnsureName(item, fileInfo);
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace MediaBrowser.Controller.Library
|
|||
/// <param name="day">The day.</param>
|
||||
/// <returns>List{DayOfWeek}.</returns>
|
||||
[return: NotNullIfNotNull("day")]
|
||||
public static DayOfWeek[] GetAirDays(string? day)
|
||||
public static DayOfWeek[]? GetAirDays(string? day)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(day))
|
||||
{
|
||||
|
|
|
@ -43,18 +43,17 @@ namespace MediaBrowser.Controller.Providers
|
|||
return list;
|
||||
}
|
||||
|
||||
public FileSystemMetadata GetFile(string path)
|
||||
public FileSystemMetadata? GetFile(string path)
|
||||
{
|
||||
var result = _fileCache.GetOrAdd(path, p =>
|
||||
if (!_fileCache.TryGetValue(path, out var result))
|
||||
{
|
||||
var file = _fileSystem.GetFileInfo(p);
|
||||
return file != null && file.Exists ? file : null;
|
||||
});
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
// lets not store null results in the cache
|
||||
_fileCache.TryRemove(path, out _);
|
||||
var file = _fileSystem.GetFileInfo(path);
|
||||
var res = file != null && file.Exists ? file : null;
|
||||
if (res != null)
|
||||
{
|
||||
result = res;
|
||||
_fileCache.TryAdd(path, result);
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
@ -11,7 +11,7 @@ namespace MediaBrowser.Controller.Providers
|
|||
|
||||
List<FileSystemMetadata> GetFiles(string path);
|
||||
|
||||
FileSystemMetadata GetFile(string path);
|
||||
FileSystemMetadata? GetFile(string path);
|
||||
|
||||
IReadOnlyList<string> GetFilePaths(string path);
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ namespace MediaBrowser.LocalMetadata
|
|||
/// <param name="info">Item inf.</param>
|
||||
/// <param name="directoryService">Instance of the <see cref="IDirectoryService"/> interface.</param>
|
||||
/// <returns>The file system metadata.</returns>
|
||||
protected abstract FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService);
|
||||
protected abstract FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService);
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool HasChanged(BaseItem item, IDirectoryService directoryService)
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace MediaBrowser.LocalMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
{
|
||||
return directoryService.GetFile(Path.Combine(info.Path, "collection.xml"));
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace MediaBrowser.LocalMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
{
|
||||
return directoryService.GetFile(PlaylistXmlSaver.GetSavePath(info.Path));
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
=> directoryService.GetFile(Path.Combine(info.Path, "album.nfo"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
=> directoryService.GetFile(Path.Combine(info.Path, "artist.nfo"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
{
|
||||
var path = Path.ChangeExtension(info.Path, ".nfo");
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
=> directoryService.GetFile(Path.Combine(info.Path, "season.nfo"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override FileSystemMetadata GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
protected override FileSystemMetadata? GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||
=> directoryService.GetFile(Path.Combine(info.Path, "tvshow.nfo"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user