mirror of https://github.com/jellyfin/jellyfin.git
support dvd without video_ts folder
This commit is contained in:
parent
5eb44c42c5
commit
4548e6598d
|
@ -200,6 +200,19 @@ namespace MediaBrowser.Api.Movies
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (item is Video)
|
||||||
|
{
|
||||||
|
var imdbId = item.GetProviderId(MetadataProviders.Imdb);
|
||||||
|
|
||||||
|
// Use imdb id to try to filter duplicates of the same item
|
||||||
|
if (!string.IsNullOrWhiteSpace(imdbId))
|
||||||
|
{
|
||||||
|
list = list
|
||||||
|
.Where(i => !string.Equals(imdbId, i.GetProviderId(MetadataProviders.Imdb), StringComparison.OrdinalIgnoreCase))
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var items = SimilarItemsHelper.GetSimilaritems(item, list, getSimilarityScore).ToList();
|
var items = SimilarItemsHelper.GetSimilaritems(item, list, getSimilarityScore).ToList();
|
||||||
|
|
||||||
IEnumerable<BaseItem> returnItems = items;
|
IEnumerable<BaseItem> returnItems = items;
|
||||||
|
|
|
@ -15,6 +15,11 @@ namespace MediaBrowser.Common.Implementations.Logging
|
||||||
/// <returns>StringBuilder.</returns>
|
/// <returns>StringBuilder.</returns>
|
||||||
public static StringBuilder GetLogMessage(Exception exception)
|
public static StringBuilder GetLogMessage(Exception exception)
|
||||||
{
|
{
|
||||||
|
if (exception == null)
|
||||||
|
{
|
||||||
|
throw new ArgumentNullException("exception");
|
||||||
|
}
|
||||||
|
|
||||||
var messageText = new StringBuilder();
|
var messageText = new StringBuilder();
|
||||||
|
|
||||||
messageText.AppendLine(exception.Message);
|
messageText.AppendLine(exception.Message);
|
||||||
|
|
|
@ -212,6 +212,20 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public virtual string FileNameWithoutExtension
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (LocationType == LocationType.FileSystem)
|
||||||
|
{
|
||||||
|
return System.IO.Path.GetFileNameWithoutExtension(Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This is just a helper for convenience
|
/// This is just a helper for convenience
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -58,6 +58,20 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public override string FileNameWithoutExtension
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (LocationType == LocationType.FileSystem)
|
||||||
|
{
|
||||||
|
return System.IO.Path.GetFileName(Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets a value indicating whether this instance is physical root.
|
/// Gets or sets a value indicating whether this instance is physical root.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -21,6 +21,12 @@ namespace MediaBrowser.Controller.Entities
|
||||||
/// <value>The path.</value>
|
/// <value>The path.</value>
|
||||||
string Path { get; set; }
|
string Path { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the file name without extension.
|
||||||
|
/// </summary>
|
||||||
|
/// <value>The file name without extension.</value>
|
||||||
|
string FileNameWithoutExtension { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the identifier.
|
/// Gets the identifier.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -158,6 +158,22 @@ namespace MediaBrowser.Controller.Entities.Movies
|
||||||
ProductionYear = yearInName;
|
ProductionYear = yearInName;
|
||||||
hasChanges = true;
|
hasChanges = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Try to get the year from the folder name
|
||||||
|
if (!IsInMixedFolder)
|
||||||
|
{
|
||||||
|
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));
|
||||||
|
|
||||||
|
yearInName = info.Year;
|
||||||
|
|
||||||
|
if (yearInName.HasValue)
|
||||||
|
{
|
||||||
|
ProductionYear = yearInName;
|
||||||
|
hasChanges = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasChanges;
|
return hasChanges;
|
||||||
|
|
|
@ -89,5 +89,41 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
return GetItemLookupInfo<MusicVideoInfo>();
|
return GetItemLookupInfo<MusicVideoInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override bool BeforeMetadataRefresh()
|
||||||
|
{
|
||||||
|
var hasChanges = base.BeforeMetadataRefresh();
|
||||||
|
|
||||||
|
if (!ProductionYear.HasValue)
|
||||||
|
{
|
||||||
|
var info = LibraryManager.ParseName(Name);
|
||||||
|
|
||||||
|
var yearInName = info.Year;
|
||||||
|
|
||||||
|
if (yearInName.HasValue)
|
||||||
|
{
|
||||||
|
ProductionYear = yearInName;
|
||||||
|
hasChanges = true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Try to get the year from the folder name
|
||||||
|
if (!IsInMixedFolder)
|
||||||
|
{
|
||||||
|
info = LibraryManager.ParseName(System.IO.Path.GetFileName(ContainingFolderPath));
|
||||||
|
|
||||||
|
yearInName = info.Year;
|
||||||
|
|
||||||
|
if (yearInName.HasValue)
|
||||||
|
{
|
||||||
|
ProductionYear = yearInName;
|
||||||
|
hasChanges = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return hasChanges;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,6 @@ using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.MediaInfo;
|
using MediaBrowser.Model.MediaInfo;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
@ -236,6 +235,25 @@ namespace MediaBrowser.Controller.Entities
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public override string FileNameWithoutExtension
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (LocationType == LocationType.FileSystem)
|
||||||
|
{
|
||||||
|
if (VideoType == VideoType.BluRay || VideoType == VideoType.Dvd || VideoType == VideoType.HdDvd)
|
||||||
|
{
|
||||||
|
return System.IO.Path.GetFileName(Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return System.IO.Path.GetFileNameWithoutExtension(Path);
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal override bool IsValidFromResolver(BaseItem newItem)
|
internal override bool IsValidFromResolver(BaseItem newItem)
|
||||||
{
|
{
|
||||||
var current = this;
|
var current = this;
|
||||||
|
|
|
@ -1340,6 +1340,12 @@ namespace MediaBrowser.Controller.Providers
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is valid
|
||||||
|
if (!string.IsNullOrWhiteSpace(linkedItem.Path))
|
||||||
|
{
|
||||||
|
return linkedItem;
|
||||||
|
}
|
||||||
|
|
||||||
return string.IsNullOrWhiteSpace(linkedItem.ItemName) || string.IsNullOrWhiteSpace(linkedItem.ItemType) ? null : linkedItem;
|
return string.IsNullOrWhiteSpace(linkedItem.ItemName) || string.IsNullOrWhiteSpace(linkedItem.ItemType) ? null : linkedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,33 +126,29 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||||
|
|
||||||
private void PopulateImages(IHasImages item, List<LocalImageInfo> images, List<FileSystemInfo> files, bool supportParentSeriesFiles, IDirectoryService directoryService)
|
private void PopulateImages(IHasImages item, List<LocalImageInfo> images, List<FileSystemInfo> files, bool supportParentSeriesFiles, IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
var imagePrefix = string.Empty;
|
var imagePrefix = item.FileNameWithoutExtension + "-";
|
||||||
|
var isInMixedFolder = item.IsInMixedFolder;
|
||||||
|
|
||||||
var baseItem = item as BaseItem;
|
PopulatePrimaryImages(item, images, files, imagePrefix, isInMixedFolder);
|
||||||
if (baseItem != null && baseItem.IsInMixedFolder)
|
|
||||||
{
|
|
||||||
imagePrefix = _fileSystem.GetFileNameWithoutExtension(item.Path) + "-";
|
|
||||||
}
|
|
||||||
|
|
||||||
PopulatePrimaryImages(item, images, files, imagePrefix);
|
AddImage(files, images, "logo", imagePrefix, isInMixedFolder, ImageType.Logo);
|
||||||
PopulateBackdrops(item, images, files, imagePrefix, directoryService);
|
AddImage(files, images, "clearart", imagePrefix, isInMixedFolder, ImageType.Art);
|
||||||
PopulateScreenshots(images, files, imagePrefix);
|
AddImage(files, images, "disc", imagePrefix, isInMixedFolder, ImageType.Disc);
|
||||||
|
AddImage(files, images, "cdart", imagePrefix, isInMixedFolder, ImageType.Disc);
|
||||||
AddImage(files, images, imagePrefix + "logo", ImageType.Logo);
|
AddImage(files, images, "box", imagePrefix, isInMixedFolder, ImageType.Box);
|
||||||
AddImage(files, images, imagePrefix + "clearart", ImageType.Art);
|
AddImage(files, images, "back", imagePrefix, isInMixedFolder, ImageType.BoxRear);
|
||||||
AddImage(files, images, imagePrefix + "disc", ImageType.Disc);
|
AddImage(files, images, "boxrear", imagePrefix, isInMixedFolder, ImageType.BoxRear);
|
||||||
AddImage(files, images, imagePrefix + "cdart", ImageType.Disc);
|
AddImage(files, images, "menu", imagePrefix, isInMixedFolder, ImageType.Menu);
|
||||||
AddImage(files, images, imagePrefix + "box", ImageType.Box);
|
|
||||||
AddImage(files, images, imagePrefix + "back", ImageType.BoxRear);
|
|
||||||
AddImage(files, images, imagePrefix + "boxrear", ImageType.BoxRear);
|
|
||||||
AddImage(files, images, imagePrefix + "menu", ImageType.Menu);
|
|
||||||
|
|
||||||
// Banner
|
// Banner
|
||||||
AddImage(files, images, imagePrefix + "banner", ImageType.Banner);
|
AddImage(files, images, "banner", imagePrefix, isInMixedFolder, ImageType.Banner);
|
||||||
|
|
||||||
// Thumb
|
// Thumb
|
||||||
AddImage(files, images, imagePrefix + "thumb", ImageType.Thumb);
|
AddImage(files, images, "thumb", imagePrefix, isInMixedFolder, ImageType.Thumb);
|
||||||
AddImage(files, images, imagePrefix + "landscape", ImageType.Thumb);
|
AddImage(files, images, "landscape", imagePrefix, isInMixedFolder, ImageType.Thumb);
|
||||||
|
|
||||||
|
PopulateBackdrops(item, images, files, imagePrefix, isInMixedFolder, directoryService);
|
||||||
|
PopulateScreenshots(images, files, imagePrefix, isInMixedFolder);
|
||||||
|
|
||||||
if (supportParentSeriesFiles)
|
if (supportParentSeriesFiles)
|
||||||
{
|
{
|
||||||
|
@ -165,54 +161,72 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulatePrimaryImages(IHasImages item, List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix)
|
private void PopulatePrimaryImages(IHasImages item, List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix, bool isInMixedFolder)
|
||||||
{
|
{
|
||||||
AddImage(files, images, imagePrefix + "folder", ImageType.Primary);
|
var names = new List<string>
|
||||||
AddImage(files, images, imagePrefix + "cover", ImageType.Primary);
|
{
|
||||||
AddImage(files, images, imagePrefix + "poster", ImageType.Primary);
|
"folder",
|
||||||
AddImage(files, images, imagePrefix + "default", ImageType.Primary);
|
"cover",
|
||||||
|
"poster",
|
||||||
|
"default"
|
||||||
|
};
|
||||||
|
|
||||||
// Support plex/xbmc convention
|
// Support plex/kodi convention
|
||||||
if (item is Series)
|
if (item is Series)
|
||||||
{
|
{
|
||||||
AddImage(files, images, imagePrefix + "show", ImageType.Primary);
|
names.Add("show");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support plex/xbmc convention
|
// Support plex/kodi convention
|
||||||
if (item is Video && !(item is Episode))
|
if (item is Video && !(item is Episode))
|
||||||
{
|
{
|
||||||
AddImage(files, images, imagePrefix + "movie", ImageType.Primary);
|
names.Add("movie");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(item.Path))
|
foreach (var name in names)
|
||||||
{
|
{
|
||||||
var name = _fileSystem.GetFileNameWithoutExtension(item.Path);
|
AddImage(files, images, imagePrefix + name, ImageType.Primary);
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(name))
|
var fileNameWithoutExtension = item.FileNameWithoutExtension;
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(fileNameWithoutExtension))
|
||||||
|
{
|
||||||
|
AddImage(files, images, fileNameWithoutExtension, ImageType.Primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isInMixedFolder)
|
||||||
|
{
|
||||||
|
foreach (var name in names)
|
||||||
{
|
{
|
||||||
AddImage(files, images, name, ImageType.Primary);
|
AddImage(files, images, name, ImageType.Primary);
|
||||||
AddImage(files, images, name + "-poster", ImageType.Primary);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulateBackdrops(IHasImages item, List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix, IDirectoryService directoryService)
|
private void PopulateBackdrops(IHasImages item, List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix, bool isInMixedFolder, IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
PopulateBackdrops(images, files, imagePrefix, "backdrop", "backdrop", ImageType.Backdrop);
|
PopulateBackdrops(images, files, imagePrefix, "backdrop", "backdrop", isInMixedFolder, ImageType.Backdrop);
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(item.Path))
|
if (!string.IsNullOrEmpty(item.Path))
|
||||||
{
|
{
|
||||||
var name = _fileSystem.GetFileNameWithoutExtension(item.Path);
|
var name = item.FileNameWithoutExtension;
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(name))
|
if (!string.IsNullOrEmpty(name))
|
||||||
{
|
{
|
||||||
AddImage(files, images, imagePrefix + name + "-fanart", ImageType.Backdrop);
|
AddImage(files, images, imagePrefix + name + "-fanart", ImageType.Backdrop);
|
||||||
|
|
||||||
|
// Support without the prefix if it's in it's own folder
|
||||||
|
if (!isInMixedFolder)
|
||||||
|
{
|
||||||
|
AddImage(files, images, name + "-fanart", ImageType.Backdrop);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PopulateBackdrops(images, files, imagePrefix, "fanart", "fanart-", ImageType.Backdrop);
|
PopulateBackdrops(images, files, imagePrefix, "fanart", "fanart-", isInMixedFolder, ImageType.Backdrop);
|
||||||
PopulateBackdrops(images, files, imagePrefix, "background", "background-", ImageType.Backdrop);
|
PopulateBackdrops(images, files, imagePrefix, "background", "background-", isInMixedFolder, ImageType.Backdrop);
|
||||||
PopulateBackdrops(images, files, imagePrefix, "art", "art-", ImageType.Backdrop);
|
PopulateBackdrops(images, files, imagePrefix, "art", "art-", isInMixedFolder, ImageType.Backdrop);
|
||||||
|
|
||||||
var extraFanartFolder = files
|
var extraFanartFolder = files
|
||||||
.FirstOrDefault(i => string.Equals(i.Name, "extrafanart", StringComparison.OrdinalIgnoreCase));
|
.FirstOrDefault(i => string.Equals(i.Name, "extrafanart", StringComparison.OrdinalIgnoreCase));
|
||||||
|
@ -245,12 +259,12 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulateScreenshots(List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix)
|
private void PopulateScreenshots(List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix, bool isInMixedFolder)
|
||||||
{
|
{
|
||||||
PopulateBackdrops(images, files, imagePrefix, "screenshot", "screenshot", ImageType.Screenshot);
|
PopulateBackdrops(images, files, imagePrefix, "screenshot", "screenshot", isInMixedFolder, ImageType.Screenshot);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void PopulateBackdrops(List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix, string firstFileName, string subsequentFileNamePrefix, ImageType type)
|
private void PopulateBackdrops(List<LocalImageInfo> images, List<FileSystemInfo> files, string imagePrefix, string firstFileName, string subsequentFileNamePrefix, bool isInMixedFolder, ImageType type)
|
||||||
{
|
{
|
||||||
AddImage(files, images, imagePrefix + firstFileName, type);
|
AddImage(files, images, imagePrefix + firstFileName, type);
|
||||||
|
|
||||||
|
@ -270,6 +284,29 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Support without the prefix
|
||||||
|
if (!isInMixedFolder)
|
||||||
|
{
|
||||||
|
AddImage(files, images, firstFileName, type);
|
||||||
|
|
||||||
|
unfound = 0;
|
||||||
|
for (var i = 1; i <= 20; i++)
|
||||||
|
{
|
||||||
|
// Screenshot Image
|
||||||
|
var found = AddImage(files, images, subsequentFileNamePrefix + i, type);
|
||||||
|
|
||||||
|
if (!found)
|
||||||
|
{
|
||||||
|
unfound++;
|
||||||
|
|
||||||
|
if (unfound >= 3)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
private readonly CultureInfo _usCulture = new CultureInfo("en-US");
|
||||||
|
@ -310,6 +347,21 @@ namespace MediaBrowser.LocalMetadata.Images
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool AddImage(List<FileSystemInfo> files, List<LocalImageInfo> images, string name, string imagePrefix, bool isInMixedFolder, ImageType type)
|
||||||
|
{
|
||||||
|
var added = AddImage(files, images, imagePrefix + name, type);
|
||||||
|
|
||||||
|
if (!isInMixedFolder)
|
||||||
|
{
|
||||||
|
if (AddImage(files, images, name, type))
|
||||||
|
{
|
||||||
|
added = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return added;
|
||||||
|
}
|
||||||
|
|
||||||
private bool AddImage(IEnumerable<FileSystemInfo> files, List<LocalImageInfo> images, string name, ImageType type)
|
private bool AddImage(IEnumerable<FileSystemInfo> files, List<LocalImageInfo> images, string name, ImageType type)
|
||||||
{
|
{
|
||||||
var image = GetImage(files, name) as FileInfo;
|
var image = GetImage(files, name) as FileInfo;
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
using System.IO;
|
using MediaBrowser.Common.IO;
|
||||||
using System.Threading;
|
|
||||||
using MediaBrowser.Common.IO;
|
|
||||||
using MediaBrowser.Controller.Entities;
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.LocalMetadata.Parsers;
|
using MediaBrowser.LocalMetadata.Parsers;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
|
using System.IO;
|
||||||
|
using System.Threading;
|
||||||
|
|
||||||
namespace MediaBrowser.LocalMetadata.Providers
|
namespace MediaBrowser.LocalMetadata.Providers
|
||||||
{
|
{
|
||||||
|
@ -25,22 +25,10 @@ namespace MediaBrowser.LocalMetadata.Providers
|
||||||
|
|
||||||
protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
var fileInfo = FileSystem.GetFileSystemInfo(info.Path);
|
var specificFile = Path.ChangeExtension(info.Path, ".xml");
|
||||||
|
|
||||||
var directoryInfo = fileInfo as DirectoryInfo;
|
|
||||||
|
|
||||||
if (directoryInfo == null)
|
|
||||||
{
|
|
||||||
directoryInfo = new DirectoryInfo(Path.GetDirectoryName(info.Path));
|
|
||||||
}
|
|
||||||
|
|
||||||
var directoryPath = directoryInfo.FullName;
|
|
||||||
|
|
||||||
var specificFile = Path.Combine(directoryPath, FileSystem.GetFileNameWithoutExtension(info.Path) + ".xml");
|
|
||||||
|
|
||||||
var file = new FileInfo(specificFile);
|
var file = new FileInfo(specificFile);
|
||||||
|
|
||||||
return info.IsInMixedFolder || file.Exists ? file : new FileInfo(Path.Combine(directoryPath, "game.xml"));
|
return info.IsInMixedFolder || file.Exists ? file : new FileInfo(Path.Combine(Path.GetDirectoryName(info.Path), "game.xml"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,12 @@ namespace MediaBrowser.Model.Drawing
|
||||||
ParseValue(value);
|
ParseValue(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ImageSize(int width, int height)
|
||||||
|
{
|
||||||
|
_width = width;
|
||||||
|
_height = height;
|
||||||
|
}
|
||||||
|
|
||||||
private void ParseValue(string value)
|
private void ParseValue(string value)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(value))
|
if (!string.IsNullOrEmpty(value))
|
||||||
|
|
|
@ -38,9 +38,9 @@ namespace MediaBrowser.Providers.BoxSets
|
||||||
|
|
||||||
if (mergeMetadataSettings)
|
if (mergeMetadataSettings)
|
||||||
{
|
{
|
||||||
var list = source.LinkedChildren.ToList();
|
var list = source.LinkedChildren.Where(i => i.Type != LinkedChildType.Manual).ToList();
|
||||||
|
|
||||||
list.AddRange(target.LinkedChildren.Where(i => i.Type == LinkedChildType.Shortcut));
|
list.AddRange(target.LinkedChildren.Where(i => i.Type == LinkedChildType.Manual));
|
||||||
|
|
||||||
target.LinkedChildren = list;
|
target.LinkedChildren = list;
|
||||||
}
|
}
|
||||||
|
|
|
@ -757,13 +757,14 @@ namespace MediaBrowser.Providers.MediaInfo
|
||||||
/// <returns>System.Nullable{IsoType}.</returns>
|
/// <returns>System.Nullable{IsoType}.</returns>
|
||||||
private IsoType? DetermineIsoType(IIsoMount isoMount)
|
private IsoType? DetermineIsoType(IIsoMount isoMount)
|
||||||
{
|
{
|
||||||
var folders = Directory.EnumerateDirectories(isoMount.MountedPath).Select(Path.GetFileName).ToList();
|
var fileSystemEntries = Directory.EnumerateFileSystemEntries(isoMount.MountedPath).Select(Path.GetFileName).ToList();
|
||||||
|
|
||||||
if (folders.Contains("video_ts", StringComparer.OrdinalIgnoreCase))
|
if (fileSystemEntries.Contains("video_ts", StringComparer.OrdinalIgnoreCase) ||
|
||||||
|
fileSystemEntries.Contains("VIDEO_TS.IFO", StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return IsoType.Dvd;
|
return IsoType.Dvd;
|
||||||
}
|
}
|
||||||
if (folders.Contains("bdmv", StringComparer.OrdinalIgnoreCase))
|
if (fileSystemEntries.Contains("bdmv", StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return IsoType.BluRay;
|
return IsoType.BluRay;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
using System.Linq;
|
using MediaBrowser.Common.IO;
|
||||||
using MediaBrowser.Common.IO;
|
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.Playlists;
|
using MediaBrowser.Controller.Playlists;
|
||||||
using MediaBrowser.Controller.Providers;
|
using MediaBrowser.Controller.Providers;
|
||||||
|
@ -9,6 +7,7 @@ using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using MediaBrowser.Providers.Manager;
|
using MediaBrowser.Providers.Manager;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace MediaBrowser.Providers.Playlists
|
namespace MediaBrowser.Providers.Playlists
|
||||||
{
|
{
|
||||||
|
|
|
@ -18,17 +18,17 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// <param name="image">The image.</param>
|
/// <param name="image">The image.</param>
|
||||||
/// <param name="toStream">To stream.</param>
|
/// <param name="toStream">To stream.</param>
|
||||||
/// <param name="quality">The quality.</param>
|
/// <param name="quality">The quality.</param>
|
||||||
public static void Save(this Image image, System.Drawing.Imaging.ImageFormat outputFormat, Stream toStream, int quality)
|
public static void Save(this Image image, ImageFormat outputFormat, Stream toStream, int quality)
|
||||||
{
|
{
|
||||||
// Use special save methods for jpeg and png that will result in a much higher quality image
|
// Use special save methods for jpeg and png that will result in a much higher quality image
|
||||||
// All other formats use the generic Image.Save
|
// All other formats use the generic Image.Save
|
||||||
if (System.Drawing.Imaging.ImageFormat.Jpeg.Equals(outputFormat))
|
if (ImageFormat.Jpeg.Equals(outputFormat))
|
||||||
{
|
{
|
||||||
SaveAsJpeg(image, toStream, quality);
|
SaveAsJpeg(image, toStream, quality);
|
||||||
}
|
}
|
||||||
else if (System.Drawing.Imaging.ImageFormat.Png.Equals(outputFormat))
|
else if (ImageFormat.Png.Equals(outputFormat))
|
||||||
{
|
{
|
||||||
image.Save(toStream, System.Drawing.Imaging.ImageFormat.Png);
|
image.Save(toStream, ImageFormat.Png);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
|
using MediaBrowser.Model.Drawing;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The image format decoders
|
/// The image format decoders
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private static readonly KeyValuePair<byte[], Func<BinaryReader, Size>>[] ImageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, Size>>
|
private static readonly KeyValuePair<byte[], Func<BinaryReader, ImageSize>>[] ImageFormatDecoders = new Dictionary<byte[], Func<BinaryReader, ImageSize>>
|
||||||
{
|
{
|
||||||
{ new byte[] { 0x42, 0x4D }, DecodeBitmap },
|
{ new byte[] { 0x42, 0x4D }, DecodeBitmap },
|
||||||
{ new byte[] { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }, DecodeGif },
|
{ new byte[] { 0x47, 0x49, 0x46, 0x38, 0x37, 0x61 }, DecodeGif },
|
||||||
|
@ -44,7 +44,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// <param name="fileSystem">The file system.</param>
|
/// <param name="fileSystem">The file system.</param>
|
||||||
/// <returns>The dimensions of the specified image.</returns>
|
/// <returns>The dimensions of the specified image.</returns>
|
||||||
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
|
/// <exception cref="ArgumentException">The image was of an unrecognised format.</exception>
|
||||||
public static Size GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
|
public static ImageSize GetDimensions(string path, ILogger logger, IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -71,9 +71,15 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
memoryStream.Position = 0;
|
memoryStream.Position = 0;
|
||||||
|
|
||||||
// Co it the old fashioned way
|
// Co it the old fashioned way
|
||||||
using (var b = Image.FromStream(memoryStream, true, false))
|
using (var b = System.Drawing.Image.FromStream(memoryStream, true, false))
|
||||||
{
|
{
|
||||||
return b.Size;
|
var size = b.Size;
|
||||||
|
|
||||||
|
return new ImageSize
|
||||||
|
{
|
||||||
|
Width = size.Width,
|
||||||
|
Height = size.Height
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +92,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// <returns>Size.</returns>
|
/// <returns>Size.</returns>
|
||||||
/// <exception cref="System.ArgumentException">binaryReader</exception>
|
/// <exception cref="System.ArgumentException">binaryReader</exception>
|
||||||
/// <exception cref="ArgumentException">The image was of an unrecognized format.</exception>
|
/// <exception cref="ArgumentException">The image was of an unrecognized format.</exception>
|
||||||
private static Size GetDimensions(BinaryReader binaryReader)
|
private static ImageSize GetDimensions(BinaryReader binaryReader)
|
||||||
{
|
{
|
||||||
var magicBytes = new byte[MaxMagicBytesLength];
|
var magicBytes = new byte[MaxMagicBytesLength];
|
||||||
|
|
||||||
|
@ -161,12 +167,16 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="binaryReader">The binary reader.</param>
|
/// <param name="binaryReader">The binary reader.</param>
|
||||||
/// <returns>Size.</returns>
|
/// <returns>Size.</returns>
|
||||||
private static Size DecodeBitmap(BinaryReader binaryReader)
|
private static ImageSize DecodeBitmap(BinaryReader binaryReader)
|
||||||
{
|
{
|
||||||
binaryReader.ReadBytes(16);
|
binaryReader.ReadBytes(16);
|
||||||
int width = binaryReader.ReadInt32();
|
int width = binaryReader.ReadInt32();
|
||||||
int height = binaryReader.ReadInt32();
|
int height = binaryReader.ReadInt32();
|
||||||
return new Size(width, height);
|
return new ImageSize
|
||||||
|
{
|
||||||
|
Width = width,
|
||||||
|
Height = height
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -174,11 +184,15 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="binaryReader">The binary reader.</param>
|
/// <param name="binaryReader">The binary reader.</param>
|
||||||
/// <returns>Size.</returns>
|
/// <returns>Size.</returns>
|
||||||
private static Size DecodeGif(BinaryReader binaryReader)
|
private static ImageSize DecodeGif(BinaryReader binaryReader)
|
||||||
{
|
{
|
||||||
int width = binaryReader.ReadInt16();
|
int width = binaryReader.ReadInt16();
|
||||||
int height = binaryReader.ReadInt16();
|
int height = binaryReader.ReadInt16();
|
||||||
return new Size(width, height);
|
return new ImageSize
|
||||||
|
{
|
||||||
|
Width = width,
|
||||||
|
Height = height
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -186,12 +200,16 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="binaryReader">The binary reader.</param>
|
/// <param name="binaryReader">The binary reader.</param>
|
||||||
/// <returns>Size.</returns>
|
/// <returns>Size.</returns>
|
||||||
private static Size DecodePng(BinaryReader binaryReader)
|
private static ImageSize DecodePng(BinaryReader binaryReader)
|
||||||
{
|
{
|
||||||
binaryReader.ReadBytes(8);
|
binaryReader.ReadBytes(8);
|
||||||
int width = ReadLittleEndianInt32(binaryReader);
|
int width = ReadLittleEndianInt32(binaryReader);
|
||||||
int height = ReadLittleEndianInt32(binaryReader);
|
int height = ReadLittleEndianInt32(binaryReader);
|
||||||
return new Size(width, height);
|
return new ImageSize
|
||||||
|
{
|
||||||
|
Width = width,
|
||||||
|
Height = height
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -200,7 +218,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
/// <param name="binaryReader">The binary reader.</param>
|
/// <param name="binaryReader">The binary reader.</param>
|
||||||
/// <returns>Size.</returns>
|
/// <returns>Size.</returns>
|
||||||
/// <exception cref="System.ArgumentException"></exception>
|
/// <exception cref="System.ArgumentException"></exception>
|
||||||
private static Size DecodeJfif(BinaryReader binaryReader)
|
private static ImageSize DecodeJfif(BinaryReader binaryReader)
|
||||||
{
|
{
|
||||||
while (binaryReader.ReadByte() == 0xff)
|
while (binaryReader.ReadByte() == 0xff)
|
||||||
{
|
{
|
||||||
|
@ -211,7 +229,11 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
binaryReader.ReadByte();
|
binaryReader.ReadByte();
|
||||||
int height = ReadLittleEndianInt16(binaryReader);
|
int height = ReadLittleEndianInt16(binaryReader);
|
||||||
int width = ReadLittleEndianInt16(binaryReader);
|
int width = ReadLittleEndianInt16(binaryReader);
|
||||||
return new Size(width, height);
|
return new ImageSize
|
||||||
|
{
|
||||||
|
Width = width,
|
||||||
|
Height = height
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chunkLength < 0)
|
if (chunkLength < 0)
|
||||||
|
|
|
@ -515,7 +515,7 @@ namespace MediaBrowser.Server.Implementations.Drawing
|
||||||
filename += "b=" + backgroundColor;
|
filename += "b=" + backgroundColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
return GetCachePath(ResizedImageCachePath, filename, Path.GetExtension(originalPath));
|
return GetCachePath(ResizedImageCachePath, filename, "." + format.ToString().ToLower());
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -94,6 +94,23 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (IsDvdFile(filename))
|
||||||
|
{
|
||||||
|
videoInfo = parser.ResolveDirectory(args.Path);
|
||||||
|
|
||||||
|
if (videoInfo == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
video = new TVideoType
|
||||||
|
{
|
||||||
|
Path = args.Path,
|
||||||
|
VideoType = VideoType.Dvd,
|
||||||
|
ProductionYear = videoInfo.Year
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (video != null)
|
if (video != null)
|
||||||
|
@ -228,6 +245,16 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
|
||||||
return string.Equals(directoryName, "video_ts", StringComparison.OrdinalIgnoreCase);
|
return string.Equals(directoryName, "video_ts", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines whether [is DVD file] [the specified name].
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="name">The name.</param>
|
||||||
|
/// <returns><c>true</c> if [is DVD file] [the specified name]; otherwise, <c>false</c>.</returns>
|
||||||
|
protected bool IsDvdFile(string name)
|
||||||
|
{
|
||||||
|
return string.Equals(name, "video_ts.ifo", StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Determines whether [is blu ray directory] [the specified directory name].
|
/// Determines whether [is blu ray directory] [the specified directory name].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -237,15 +264,5 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
|
||||||
{
|
{
|
||||||
return string.Equals(directoryName, "bdmv", StringComparison.OrdinalIgnoreCase);
|
return string.Equals(directoryName, "bdmv", StringComparison.OrdinalIgnoreCase);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool IsBluRayContainer(string path, IDirectoryService directoryService)
|
|
||||||
{
|
|
||||||
return directoryService.GetDirectories(path).Any(i => IsBluRayDirectory(i.Name));
|
|
||||||
}
|
|
||||||
|
|
||||||
protected bool IsDvdContainer(string path, IDirectoryService directoryService)
|
|
||||||
{
|
|
||||||
return directoryService.GetDirectories(path).Any(i => IsDvdDirectory(i.Name));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
FullName = i.FullName,
|
FullName = i.FullName,
|
||||||
Type = FileInfoType.File
|
Type = FileInfoType.File
|
||||||
|
|
||||||
}).ToList());
|
}).ToList()).ToList();
|
||||||
|
|
||||||
var result = new MultiItemResolverResult
|
var result = new MultiItemResolverResult
|
||||||
{
|
{
|
||||||
|
@ -125,6 +125,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
Items = videos
|
Items = videos
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var isInMixedFolder = resolverResult.Count > 0;
|
||||||
|
|
||||||
foreach (var video in resolverResult)
|
foreach (var video in resolverResult)
|
||||||
{
|
{
|
||||||
var firstVideo = video.Files.First();
|
var firstVideo = video.Files.First();
|
||||||
|
@ -132,7 +134,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
var videoItem = new T
|
var videoItem = new T
|
||||||
{
|
{
|
||||||
Path = video.Files[0].Path,
|
Path = video.Files[0].Path,
|
||||||
IsInMixedFolder = true,
|
IsInMixedFolder = isInMixedFolder,
|
||||||
ProductionYear = video.Year,
|
ProductionYear = video.Year,
|
||||||
Name = video.Name,
|
Name = video.Name,
|
||||||
AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToList()
|
AdditionalParts = video.Files.Skip(1).Select(i => i.Path).ToList()
|
||||||
|
@ -171,7 +173,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
|
|
||||||
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(collectionType, CollectionType.HomeVideos, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
return FindMovie<Video>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType);
|
return FindMovie<Video>(args.Path, args.Parent, args.FileSystemChildren.ToList(), args.DirectoryService, collectionType, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(collectionType))
|
if (string.IsNullOrEmpty(collectionType))
|
||||||
|
@ -275,8 +277,9 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
/// <param name="fileSystemEntries">The file system entries.</param>
|
/// <param name="fileSystemEntries">The file system entries.</param>
|
||||||
/// <param name="directoryService">The directory service.</param>
|
/// <param name="directoryService">The directory service.</param>
|
||||||
/// <param name="collectionType">Type of the collection.</param>
|
/// <param name="collectionType">Type of the collection.</param>
|
||||||
|
/// <param name="supportMultiVersion">if set to <c>true</c> [support multi version].</param>
|
||||||
/// <returns>Movie.</returns>
|
/// <returns>Movie.</returns>
|
||||||
private T FindMovie<T>(string path, Folder parent, List<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, string collectionType)
|
private T FindMovie<T>(string path, Folder parent, List<FileSystemInfo> fileSystemEntries, IDirectoryService directoryService, string collectionType, bool supportMultiVersion = true)
|
||||||
where T : Video, new()
|
where T : Video, new()
|
||||||
{
|
{
|
||||||
var multiDiscFolders = new List<FileSystemInfo>();
|
var multiDiscFolders = new List<FileSystemInfo>();
|
||||||
|
@ -311,12 +314,22 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
|
|
||||||
multiDiscFolders.Add(child);
|
multiDiscFolders.Add(child);
|
||||||
}
|
}
|
||||||
|
else if (IsDvdFile(filename))
|
||||||
|
{
|
||||||
|
var movie = new T
|
||||||
|
{
|
||||||
|
Path = path,
|
||||||
|
VideoType = VideoType.Dvd
|
||||||
|
};
|
||||||
|
Set3DFormat(movie);
|
||||||
|
return movie;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, collectionType);
|
var result = ResolveVideos<T>(parent, fileSystemEntries, directoryService, collectionType);
|
||||||
|
|
||||||
// Test for multi-editions
|
// Test for multi-editions
|
||||||
if (result.Items.Count > 1)
|
if (result.Items.Count > 1 && supportMultiVersion)
|
||||||
{
|
{
|
||||||
var filenamePrefix = Path.GetFileName(path);
|
var filenamePrefix = Path.GetFileName(path);
|
||||||
|
|
||||||
|
@ -327,6 +340,7 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
var movie = (T)result.Items[0];
|
var movie = (T)result.Items[0];
|
||||||
movie.Name = filenamePrefix;
|
movie.Name = filenamePrefix;
|
||||||
movie.LocalAlternateVersions = result.Items.Skip(1).Select(i => i.Path).ToList();
|
movie.LocalAlternateVersions = result.Items.Skip(1).Select(i => i.Path).ToList();
|
||||||
|
movie.IsInMixedFolder = false;
|
||||||
|
|
||||||
_logger.Debug("Multi-version video found: " + movie.Path);
|
_logger.Debug("Multi-version video found: " + movie.Path);
|
||||||
|
|
||||||
|
@ -364,7 +378,11 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
|
|
||||||
var folderPaths = multiDiscFolders.Select(i => i.FullName).Where(i =>
|
var folderPaths = multiDiscFolders.Select(i => i.FullName).Where(i =>
|
||||||
{
|
{
|
||||||
var subfolders = directoryService.GetDirectories(i)
|
var subFileEntries = directoryService.GetFileSystemEntries(i)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
var subfolders = subFileEntries
|
||||||
|
.Where(e => (e.Attributes & FileAttributes.Directory) == FileAttributes.Directory)
|
||||||
.Select(d => d.Name)
|
.Select(d => d.Name)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
|
@ -379,6 +397,16 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.Movies
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var subFiles = subFileEntries
|
||||||
|
.Where(e => (e.Attributes & FileAttributes.Directory) != FileAttributes.Directory)
|
||||||
|
.Select(d => d.Name);
|
||||||
|
|
||||||
|
if (subFiles.Any(IsDvdFile))
|
||||||
|
{
|
||||||
|
videoTypes.Add(VideoType.Dvd);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
}).OrderBy(i => i).ToList();
|
}).OrderBy(i => i).ToList();
|
||||||
|
|
|
@ -220,19 +220,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||||
}
|
}
|
||||||
|
|
||||||
return 2;
|
return 2;
|
||||||
})
|
});
|
||||||
.ThenBy(i =>
|
|
||||||
{
|
|
||||||
double number = 0;
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(i.Number))
|
|
||||||
{
|
|
||||||
double.TryParse(i.Number, out number);
|
|
||||||
}
|
|
||||||
|
|
||||||
return number;
|
|
||||||
|
|
||||||
}).ThenBy(i => i.Name);
|
|
||||||
|
|
||||||
var allChannels = channels.ToList();
|
var allChannels = channels.ToList();
|
||||||
IEnumerable<LiveTvChannel> allEnumerable = allChannels;
|
IEnumerable<LiveTvChannel> allEnumerable = allChannels;
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="MediaBrowser.Naming, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="MediaBrowser.Naming, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.15\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
|
<HintPath>..\packages\MediaBrowser.Naming.1.0.0.16\lib\portable-net45+sl4+wp71+win8+wpa81\MediaBrowser.Naming.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Mono.Nat, Version=1.2.21.0, Culture=neutral, processorArchitecture=MSIL">
|
<Reference Include="Mono.Nat, Version=1.2.21.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<packages>
|
<packages>
|
||||||
<package id="MediaBrowser.Naming" version="1.0.0.15" targetFramework="net45" />
|
<package id="MediaBrowser.Naming" version="1.0.0.16" targetFramework="net45" />
|
||||||
<package id="Mono.Nat" version="1.2.21.0" targetFramework="net45" />
|
<package id="Mono.Nat" version="1.2.21.0" targetFramework="net45" />
|
||||||
<package id="morelinq" version="1.1.0" targetFramework="net45" />
|
<package id="morelinq" version="1.1.0" targetFramework="net45" />
|
||||||
</packages>
|
</packages>
|
|
@ -1,6 +1,4 @@
|
||||||
<configuration>
|
<configuration>
|
||||||
<dllmap dll="libwebp" target="./libwebp/linux/lib/libwebp.so" os="linux" wordsize="32"/>
|
|
||||||
<dllmap dll="libwebp" target="./libwebp/linux/lib64/libwebp.so" os="linux" wordsize="64"/>
|
|
||||||
<dllmap dll="libwebp" target="./libwebp/osx/libwebp.5.dylib" os="osx"/>
|
<dllmap dll="libwebp" target="./libwebp/osx/libwebp.5.dylib" os="osx"/>
|
||||||
<dllmap dll="libwebp" target="libwebp.so" os="linux" cpu="!x86,x86-64"/>
|
<dllmap dll="libwebp" target="libwebp.so" os="linux"/>
|
||||||
</configuration>
|
</configuration>
|
|
@ -135,14 +135,6 @@
|
||||||
<Link>libgdiplus.dylib</Link>
|
<Link>libgdiplus.dylib</Link>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</None>
|
</None>
|
||||||
<None Include="..\ThirdParty\libwebp\linux\x86\libwebp.so">
|
|
||||||
<Link>libwebp\linux\lib\libwebp.so</Link>
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="..\ThirdParty\libwebp\linux\x86_64\libwebp.so">
|
|
||||||
<Link>libwebp\linux\lib64\libwebp.so</Link>
|
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
|
||||||
</None>
|
|
||||||
<None Include="..\ThirdParty\libwebp\osx\libwebp.5.dylib">
|
<None Include="..\ThirdParty\libwebp\osx\libwebp.5.dylib">
|
||||||
<Link>libwebp\osx\libwebp.5.dylib</Link>
|
<Link>libwebp\osx\libwebp.5.dylib</Link>
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
|
|
@ -46,7 +46,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
||||||
{
|
{
|
||||||
var path = item.Path;
|
var path = item.Path;
|
||||||
|
|
||||||
return Path.Combine(path, fileSystem.GetFileNameWithoutExtension(path) + ".nfo");
|
return Path.Combine(path, Path.GetFileName(path) + ".nfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Path.ChangeExtension(item.Path, ".nfo");
|
return Path.ChangeExtension(item.Path, ".nfo");
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
||||||
{
|
{
|
||||||
var path = item.ContainingFolderPath;
|
var path = item.ContainingFolderPath;
|
||||||
|
|
||||||
return Path.Combine(path, fileSystem.GetFileNameWithoutExtension(path) + ".nfo");
|
return Path.Combine(path, Path.GetFileName(path) + ".nfo");
|
||||||
}
|
}
|
||||||
|
|
||||||
return Path.ChangeExtension(item.Path, ".nfo");
|
return Path.ChangeExtension(item.Path, ".nfo");
|
||||||
|
|
Loading…
Reference in New Issue