move more metadata settings to per library

This commit is contained in:
Luke Pulverenti
2016-10-02 00:31:47 -04:00
parent 1454e07c54
commit 911d9f4598
11 changed files with 42 additions and 61 deletions

View File

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

View File

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

View File

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