mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 01:24:44 +01:00
move more metadata settings to per library
This commit is contained in:
@@ -1216,12 +1216,7 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
if (libraryFolder != null)
|
||||
{
|
||||
info.ItemId = libraryFolder.Id.ToString("N");
|
||||
}
|
||||
|
||||
var collectionFolder = libraryFolder as CollectionFolder;
|
||||
if (collectionFolder != null)
|
||||
{
|
||||
info.LibraryOptions = collectionFolder.GetLibraryOptions();
|
||||
info.LibraryOptions = GetLibraryOptions(libraryFolder);
|
||||
}
|
||||
|
||||
return info;
|
||||
@@ -1889,11 +1884,23 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
public LibraryOptions GetLibraryOptions(BaseItem item)
|
||||
{
|
||||
var collectionFolder = GetCollectionFolders(item)
|
||||
.OfType<CollectionFolder>()
|
||||
.FirstOrDefault();
|
||||
var collectionFolder = item as CollectionFolder;
|
||||
if (collectionFolder == null)
|
||||
{
|
||||
collectionFolder = GetCollectionFolders(item)
|
||||
.OfType<CollectionFolder>()
|
||||
.FirstOrDefault();
|
||||
}
|
||||
|
||||
return collectionFolder == null ? new LibraryOptions() : collectionFolder.GetLibraryOptions();
|
||||
var options = collectionFolder == null ? new LibraryOptions() : collectionFolder.GetLibraryOptions();
|
||||
|
||||
if (options.SchemaVersion < 3)
|
||||
{
|
||||
options.SaveLocalMetadata = ConfigurationManager.Configuration.SaveLocalMeta;
|
||||
options.EnableInternetProviders = ConfigurationManager.Configuration.EnableInternetProviders;
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
|
||||
public string GetContentType(BaseItem item)
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
||||
}
|
||||
|
||||
var libraryOptions = _libraryManager.GetLibraryOptions(video);
|
||||
if (libraryOptions != null && libraryOptions.SchemaVersion >= 2)
|
||||
if (libraryOptions != null)
|
||||
{
|
||||
if (!libraryOptions.EnableChapterImageExtraction)
|
||||
{
|
||||
@@ -70,29 +70,7 @@ namespace MediaBrowser.Server.Implementations.MediaEncoder
|
||||
}
|
||||
else
|
||||
{
|
||||
var options = _chapterManager.GetConfiguration();
|
||||
|
||||
if (video is Movie)
|
||||
{
|
||||
if (!options.EnableMovieChapterImageExtraction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (video is Episode)
|
||||
{
|
||||
if (!options.EnableEpisodeChapterImageExtraction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!options.EnableOtherVideoChapterImageExtraction)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Can't extract images if there are no video streams
|
||||
|
||||
@@ -242,8 +242,7 @@ namespace MediaBrowser.Server.Implementations.Session
|
||||
var userLastActivityDate = user.LastActivityDate ?? DateTime.MinValue;
|
||||
user.LastActivityDate = activityDate;
|
||||
|
||||
// Don't log in the db anymore frequently than 10 seconds
|
||||
if ((activityDate - userLastActivityDate).TotalSeconds > 10)
|
||||
if ((activityDate - userLastActivityDate).TotalSeconds > 60)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user