mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
limit ifo's to 300mb+
This commit is contained in:
parent
3d4a3c9cb8
commit
21706ffa52
@ -445,11 +445,15 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
AddMetadataPlugins(summary.Plugins, dummy, options);
|
AddMetadataPlugins(summary.Plugins, dummy, options);
|
||||||
AddImagePlugins(summary.Plugins, dummy, imageProviders);
|
AddImagePlugins(summary.Plugins, dummy, imageProviders);
|
||||||
|
|
||||||
summary.SupportedImageTypes = imageProviders.OfType<IRemoteImageProvider>()
|
var supportedImageTypes = imageProviders.OfType<IRemoteImageProvider>()
|
||||||
.SelectMany(i => i.GetSupportedImages(dummy))
|
.SelectMany(i => i.GetSupportedImages(dummy))
|
||||||
.Distinct()
|
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
supportedImageTypes.AddRange(imageProviders.OfType<IDynamicImageProvider>()
|
||||||
|
.SelectMany(i => i.GetSupportedImages(dummy)));
|
||||||
|
|
||||||
|
summary.SupportedImageTypes = supportedImageTypes.Distinct().ToList();
|
||||||
|
|
||||||
return summary;
|
return summary;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,8 +585,9 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
|
|
||||||
// Try to eliminate menus and intros by skipping all files at the front of the list that are less than the minimum size
|
// Try to eliminate menus and intros by skipping all files at the front of the list that are less than the minimum size
|
||||||
// Once we reach a file that is at least the minimum, return all subsequent ones
|
// Once we reach a file that is at least the minimum, return all subsequent ones
|
||||||
var allVobs = Directory.EnumerateFiles(root, "*", SearchOption.AllDirectories)
|
var allVobs = new DirectoryInfo(root).EnumerateFiles("*", SearchOption.AllDirectories)
|
||||||
.Where(file => string.Equals(Path.GetExtension(file), ".vob", StringComparison.OrdinalIgnoreCase))
|
.Where(file => string.Equals(file.Extension, ".vob", StringComparison.OrdinalIgnoreCase))
|
||||||
|
.OrderBy(i => i.FullName)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
// If we didn't find any satisfying the min length, just take them all
|
// If we didn't find any satisfying the min length, just take them all
|
||||||
@ -599,18 +600,22 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
if (titleNumber.HasValue)
|
if (titleNumber.HasValue)
|
||||||
{
|
{
|
||||||
var prefix = string.Format("VTS_0{0}_", titleNumber.Value.ToString(_usCulture));
|
var prefix = string.Format("VTS_0{0}_", titleNumber.Value.ToString(_usCulture));
|
||||||
var vobs = allVobs.Where(i => Path.GetFileName(i).StartsWith(prefix, StringComparison.OrdinalIgnoreCase)).ToList();
|
var vobs = allVobs.Where(i => i.Name.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||||
|
|
||||||
if (vobs.Count > 0)
|
if (vobs.Count > 0)
|
||||||
{
|
{
|
||||||
return vobs;
|
var minSizeVobs = allVobs
|
||||||
|
.SkipWhile(f => f.Length < minPlayableSize)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
return minSizeVobs.Count == 0 ? vobs.Select(i => i.FullName) : minSizeVobs.Select(i => i.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.Debug("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", video.Path);
|
_logger.Debug("Could not determine vob file list for {0} using DvdLib. Will scan using file sizes.", video.Path);
|
||||||
}
|
}
|
||||||
|
|
||||||
var files = allVobs
|
var files = allVobs
|
||||||
.SkipWhile(f => new FileInfo(f).Length < minPlayableSize)
|
.SkipWhile(f => f.Length < minPlayableSize)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
// If we didn't find any satisfying the min length, just take them all
|
// If we didn't find any satisfying the min length, just take them all
|
||||||
@ -623,7 +628,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
// Assuming they're named "vts_05_01", take all files whose second part matches that of the first file
|
// Assuming they're named "vts_05_01", take all files whose second part matches that of the first file
|
||||||
if (files.Count > 0)
|
if (files.Count > 0)
|
||||||
{
|
{
|
||||||
var parts = Path.GetFileNameWithoutExtension(files[0]).Split('_');
|
var parts = Path.GetFileNameWithoutExtension(files[0].FullName).Split('_');
|
||||||
|
|
||||||
if (parts.Length == 3)
|
if (parts.Length == 3)
|
||||||
{
|
{
|
||||||
@ -631,7 +636,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
|
|
||||||
files = files.TakeWhile(f =>
|
files = files.TakeWhile(f =>
|
||||||
{
|
{
|
||||||
var fileParts = Path.GetFileNameWithoutExtension(f).Split('_');
|
var fileParts = Path.GetFileNameWithoutExtension(f.FullName).Split('_');
|
||||||
|
|
||||||
return fileParts.Length == 3 && string.Equals(title, fileParts[1], StringComparison.OrdinalIgnoreCase);
|
return fileParts.Length == 3 && string.Equals(title, fileParts[1], StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
@ -646,7 +651,7 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return files;
|
return files.Select(i => i.FullName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,5 @@
|
|||||||
using MediaBrowser.Common.Extensions;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
using MediaBrowser.Controller.Entities.Audio;
|
|
||||||
using MediaBrowser.Controller.Library;
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Globalization;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
@ -31,80 +24,9 @@ namespace MediaBrowser.Providers.Music
|
|||||||
|
|
||||||
private void RunInternal(IProgress<double> progress, CancellationToken cancellationToken)
|
private void RunInternal(IProgress<double> progress, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var allItems = _libraryManager.RootFolder
|
// Reimplement this when more kinds of associations are supported.
|
||||||
.RecursiveChildren
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var musicAlbums = allItems
|
|
||||||
.OfType<MusicAlbum>()
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
var itemsWithSoundtracks = allItems.OfType<IHasSoundtracks>().ToList();
|
|
||||||
|
|
||||||
foreach (var item in itemsWithSoundtracks)
|
|
||||||
{
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
|
||||||
|
|
||||||
item.SoundtrackIds = GetSoundtrackIds(item, musicAlbums).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
progress.Report(50);
|
|
||||||
|
|
||||||
itemsWithSoundtracks = itemsWithSoundtracks.Where(i => i.SoundtrackIds.Count > 0).ToList();
|
|
||||||
|
|
||||||
foreach (var album in musicAlbums)
|
|
||||||
{
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
|
||||||
|
|
||||||
album.SoundtrackIds = GetAlbumLinks(album.Id, itemsWithSoundtracks).ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
progress.Report(100);
|
progress.Report(100);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<Guid> GetSoundtrackIds(IHasSoundtracks item, IEnumerable<MusicAlbum> albums)
|
|
||||||
{
|
|
||||||
var itemName = GetComparableName(item.Name);
|
|
||||||
|
|
||||||
return albums.Where(i => string.Equals(itemName, GetComparableName(i.Name), StringComparison.OrdinalIgnoreCase)).Select(i => i.Id);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetComparableName(string name)
|
|
||||||
{
|
|
||||||
name = " " + name + " ";
|
|
||||||
|
|
||||||
name = name.Replace(".", " ")
|
|
||||||
.Replace("_", " ")
|
|
||||||
.Replace("&", " ")
|
|
||||||
.Replace("!", " ")
|
|
||||||
.Replace("(", " ")
|
|
||||||
.Replace(")", " ")
|
|
||||||
.Replace(",", " ")
|
|
||||||
.Replace("-", " ")
|
|
||||||
.Replace(" a ", String.Empty, StringComparison.OrdinalIgnoreCase)
|
|
||||||
.Replace(" the ", String.Empty, StringComparison.OrdinalIgnoreCase)
|
|
||||||
.Replace(" ", String.Empty);
|
|
||||||
|
|
||||||
return name.Trim();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Removes the diacritics.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="text">The text.</param>
|
|
||||||
/// <returns>System.String.</returns>
|
|
||||||
private static string RemoveDiacritics(string text)
|
|
||||||
{
|
|
||||||
return String.Concat(
|
|
||||||
text.Normalize(NormalizationForm.FormD)
|
|
||||||
.Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
|
|
||||||
UnicodeCategory.NonSpacingMark)
|
|
||||||
).Normalize(NormalizationForm.FormC);
|
|
||||||
}
|
|
||||||
|
|
||||||
private IEnumerable<Guid> GetAlbumLinks(Guid albumId, IEnumerable<IHasSoundtracks> items)
|
|
||||||
{
|
|
||||||
return items.Where(i => i.SoundtrackIds.Contains(albumId)).Select(i => i.Id);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,18 +59,17 @@ namespace MediaBrowser.Providers.Omdb
|
|||||||
|
|
||||||
var imdbId = info.GetProviderId(MetadataProviders.Imdb);
|
var imdbId = info.GetProviderId(MetadataProviders.Imdb);
|
||||||
|
|
||||||
|
var searchResult = await GetSeriesImdbId(info, cancellationToken).ConfigureAwait(false);
|
||||||
|
result.Item.Name = searchResult.Item3;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(imdbId))
|
if (string.IsNullOrEmpty(imdbId))
|
||||||
{
|
{
|
||||||
var searchResult = await GetSeriesImdbId(info, cancellationToken).ConfigureAwait(false);
|
|
||||||
|
|
||||||
imdbId = searchResult.Item1;
|
imdbId = searchResult.Item1;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(searchResult.Item2))
|
if (!string.IsNullOrEmpty(searchResult.Item2))
|
||||||
{
|
{
|
||||||
result.Item.SetProviderId(MetadataProviders.Tvdb, searchResult.Item2);
|
result.Item.SetProviderId(MetadataProviders.Tvdb, searchResult.Item2);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Item.Name = searchResult.Item3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(imdbId))
|
if (!string.IsNullOrEmpty(imdbId))
|
||||||
@ -112,18 +111,17 @@ namespace MediaBrowser.Providers.Omdb
|
|||||||
|
|
||||||
var imdbId = info.GetProviderId(MetadataProviders.Imdb);
|
var imdbId = info.GetProviderId(MetadataProviders.Imdb);
|
||||||
|
|
||||||
|
var searchResult = await GetMovieImdbId(info, cancellationToken).ConfigureAwait(false);
|
||||||
|
result.Item.Name = searchResult.Item3;
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(imdbId))
|
if (string.IsNullOrEmpty(imdbId))
|
||||||
{
|
{
|
||||||
var searchResult = await GetMovieImdbId(info, cancellationToken).ConfigureAwait(false);
|
|
||||||
|
|
||||||
imdbId = searchResult.Item1;
|
imdbId = searchResult.Item1;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(searchResult.Item2))
|
if (!string.IsNullOrEmpty(searchResult.Item2))
|
||||||
{
|
{
|
||||||
result.Item.SetProviderId(MetadataProviders.Tmdb, searchResult.Item2);
|
result.Item.SetProviderId(MetadataProviders.Tmdb, searchResult.Item2);
|
||||||
}
|
}
|
||||||
|
|
||||||
result.Item.Name = searchResult.Item3;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(imdbId))
|
if (!string.IsNullOrEmpty(imdbId))
|
||||||
|
@ -46,7 +46,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
|||||||
|
|
||||||
new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep},
|
new SystemEventTrigger{ SystemEvent = SystemEvent.WakeFromSleep},
|
||||||
|
|
||||||
new IntervalTrigger{ Interval = TimeSpan.FromHours(2)}
|
new IntervalTrigger{ Interval = TimeSpan.FromHours(3)}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -439,8 +439,8 @@ namespace MediaBrowser.WebDashboard.Api
|
|||||||
var files = new[]
|
var files = new[]
|
||||||
{
|
{
|
||||||
"scripts/all.js" + versionString,
|
"scripts/all.js" + versionString,
|
||||||
"thirdparty/jstree1.0/jquery.jstree.min.js",
|
"thirdparty/jstree1.0/jquery.jstree.min.js"
|
||||||
"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"
|
//"https://www.gstatic.com/cv/js/sender/v1/cast_sender.js"
|
||||||
};
|
};
|
||||||
|
|
||||||
var tags = files.Select(s => string.Format("<script src=\"{0}\"></script>", s)).ToArray();
|
var tags = files.Select(s => string.Format("<script src=\"{0}\"></script>", s)).ToArray();
|
||||||
@ -465,7 +465,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||||||
"librarybrowser.js",
|
"librarybrowser.js",
|
||||||
"editorsidebar.js",
|
"editorsidebar.js",
|
||||||
"librarymenu.js",
|
"librarymenu.js",
|
||||||
"chromecast.js",
|
//"chromecast.js",
|
||||||
|
|
||||||
"ratingdialog.js",
|
"ratingdialog.js",
|
||||||
"aboutpage.js",
|
"aboutpage.js",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user