mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
fix case sensitive file names
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using MediaBrowser.Model.Configuration;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
public class MetadataConfigurationStore : IConfigurationFactory
|
||||
{
|
||||
public IEnumerable<ConfigurationStore> GetConfigurations()
|
||||
{
|
||||
return new List<ConfigurationStore>
|
||||
{
|
||||
new ConfigurationStore
|
||||
{
|
||||
Key = "metadata",
|
||||
ConfigurationType = typeof(MetadataConfiguration)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static class MetadataConfigurationExtensions
|
||||
{
|
||||
public static MetadataConfiguration GetMetadataConfiguration(this IConfigurationManager config)
|
||||
{
|
||||
return config.GetConfiguration<MetadataConfiguration>("metadata");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -174,6 +174,7 @@
|
||||
<Compile Include="Library\IUserDataManager.cs" />
|
||||
<Compile Include="Library\IUserViewManager.cs" />
|
||||
<Compile Include="Library\LibraryManagerExtensions.cs" />
|
||||
<Compile Include="Library\MetadataConfigurationStore.cs" />
|
||||
<Compile Include="Library\PlaybackStopEventArgs.cs" />
|
||||
<Compile Include="Library\UserDataSaveEventArgs.cs" />
|
||||
<Compile Include="LiveTv\RecordingGroup.cs" />
|
||||
|
||||
@@ -211,7 +211,7 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
{
|
||||
if (includeCreationTime)
|
||||
{
|
||||
item.DateCreated = DateTime.UtcNow;
|
||||
SetDateCreated(item, fileSystem, childData);
|
||||
}
|
||||
|
||||
item.DateModified = fileSystem.GetLastWriteTimeUtc(childData);
|
||||
@@ -224,7 +224,7 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
{
|
||||
if (includeCreationTime)
|
||||
{
|
||||
item.DateCreated = DateTime.UtcNow;
|
||||
SetDateCreated(item, fileSystem, fileData);
|
||||
}
|
||||
item.DateModified = fileSystem.GetLastWriteTimeUtc(fileData);
|
||||
}
|
||||
@@ -234,10 +234,24 @@ namespace MediaBrowser.Controller.Resolvers
|
||||
{
|
||||
if (includeCreationTime)
|
||||
{
|
||||
item.DateCreated = DateTime.UtcNow;
|
||||
SetDateCreated(item, fileSystem, args.FileInfo);
|
||||
}
|
||||
item.DateModified = fileSystem.GetLastWriteTimeUtc(args.FileInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private static void SetDateCreated(BaseItem item, IFileSystem fileSystem, FileSystemInfo info)
|
||||
{
|
||||
var config = BaseItem.ConfigurationManager.GetMetadataConfiguration();
|
||||
|
||||
if (config.UseFileCreationTimeForDateAdded)
|
||||
{
|
||||
item.DateModified = fileSystem.GetCreationTimeUtc(info);
|
||||
}
|
||||
else
|
||||
{
|
||||
item.DateCreated = DateTime.UtcNow;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user