mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
support video_ts.nfo
This commit is contained in:
parent
2189851f11
commit
d2949d6e03
@ -115,9 +115,16 @@ namespace Emby.Drawing.ImageMagick
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool HasTransparency(string path)
|
||||||
|
{
|
||||||
|
var ext = Path.GetExtension(path);
|
||||||
|
|
||||||
|
return string.Equals(ext, ".png", StringComparison.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
public void EncodeImage(string inputPath, string outputPath, int width, int height, int quality, ImageProcessingOptions options)
|
public void EncodeImage(string inputPath, string outputPath, int width, int height, int quality, ImageProcessingOptions options)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrWhiteSpace(options.BackgroundColor))
|
if (string.IsNullOrWhiteSpace(options.BackgroundColor) && !HasTransparency(inputPath))
|
||||||
{
|
{
|
||||||
using (var originalImage = new MagickWand(inputPath))
|
using (var originalImage = new MagickWand(inputPath))
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,30 @@
|
|||||||
|
using MediaBrowser.Controller.Entities;
|
||||||
|
using MediaBrowser.Model.Entities;
|
||||||
|
|
||||||
namespace MediaBrowser.Controller.Providers
|
namespace MediaBrowser.Controller.Providers
|
||||||
{
|
{
|
||||||
public class ItemInfo
|
public class ItemInfo
|
||||||
{
|
{
|
||||||
public string Path { get; set; }
|
public ItemInfo()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public ItemInfo(IHasMetadata item)
|
||||||
|
{
|
||||||
|
Path = item.Path;
|
||||||
|
ContainingFolderPath = item.ContainingFolderPath;
|
||||||
|
IsInMixedFolder = item.IsInMixedFolder;
|
||||||
|
|
||||||
|
var video = item as Video;
|
||||||
|
if (video != null)
|
||||||
|
{
|
||||||
|
VideoType = video.VideoType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string Path { get; set; }
|
||||||
|
public string ContainingFolderPath { get; set; }
|
||||||
|
public VideoType VideoType { get; set; }
|
||||||
public bool IsInMixedFolder { get; set; }
|
public bool IsInMixedFolder { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -58,7 +58,7 @@ namespace MediaBrowser.LocalMetadata
|
|||||||
|
|
||||||
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
|
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
|
||||||
{
|
{
|
||||||
var file = GetXmlFile(new ItemInfo { IsInMixedFolder = item.IsInMixedFolder, Path = item.Path }, directoryService);
|
var file = GetXmlFile(new ItemInfo(item), directoryService);
|
||||||
|
|
||||||
if (file == null)
|
if (file == null)
|
||||||
{
|
{
|
||||||
|
@ -2,13 +2,10 @@
|
|||||||
using MediaBrowser.Common.IO;
|
using MediaBrowser.Common.IO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.LiveTv;
|
|
||||||
using MediaBrowser.Controller.MediaEncoding;
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
using MediaBrowser.Controller.Session;
|
using MediaBrowser.Controller.Session;
|
||||||
using MediaBrowser.MediaEncoding.Subtitles;
|
using MediaBrowser.MediaEncoding.Subtitles;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Dlna;
|
|
||||||
using MediaBrowser.Model.Drawing;
|
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.IO;
|
using MediaBrowser.Model.IO;
|
||||||
@ -39,7 +36,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||||
|
|
||||||
public BaseEncoder(MediaEncoder mediaEncoder,
|
protected BaseEncoder(MediaEncoder mediaEncoder,
|
||||||
ILogger logger,
|
ILogger logger,
|
||||||
IServerConfigurationManager configurationManager,
|
IServerConfigurationManager configurationManager,
|
||||||
IFileSystem fileSystem,
|
IFileSystem fileSystem,
|
||||||
@ -64,7 +61,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
IProgress<double> progress,
|
IProgress<double> progress,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var encodingJob = await new EncodingJobFactory(Logger, LibraryManager, MediaSourceManager)
|
var encodingJob = await new EncodingJobFactory(Logger, LibraryManager, MediaSourceManager, ConfigurationManager)
|
||||||
.CreateJob(options, IsVideoEncoder, progress, cancellationToken).ConfigureAwait(false);
|
.CreateJob(options, IsVideoEncoder, progress, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
encodingJob.OutputFilePath = GetOutputFilePath(encodingJob);
|
encodingJob.OutputFilePath = GetOutputFilePath(encodingJob);
|
||||||
@ -305,25 +302,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
return job.Options.CpuCoreLimit ?? 0;
|
return job.Options.CpuCoreLimit ?? 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected EncodingQuality GetQualitySetting()
|
|
||||||
{
|
|
||||||
var quality = GetEncodingOptions().EncodingQuality;
|
|
||||||
|
|
||||||
if (quality == EncodingQuality.Auto)
|
|
||||||
{
|
|
||||||
var cpuCount = Environment.ProcessorCount;
|
|
||||||
|
|
||||||
if (cpuCount >= 4)
|
|
||||||
{
|
|
||||||
//return EncodingQuality.HighQuality;
|
|
||||||
}
|
|
||||||
|
|
||||||
return EncodingQuality.HighSpeed;
|
|
||||||
}
|
|
||||||
|
|
||||||
return quality;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected string GetInputModifier(EncodingJob job, bool genPts = true)
|
protected string GetInputModifier(EncodingJob job, bool genPts = true)
|
||||||
{
|
{
|
||||||
var inputModifier = string.Empty;
|
var inputModifier = string.Empty;
|
||||||
@ -543,7 +521,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
var isVc1 = state.VideoStream != null &&
|
var isVc1 = state.VideoStream != null &&
|
||||||
string.Equals(state.VideoStream.Codec, "vc1", StringComparison.OrdinalIgnoreCase);
|
string.Equals(state.VideoStream.Codec, "vc1", StringComparison.OrdinalIgnoreCase);
|
||||||
|
|
||||||
var qualitySetting = GetQualitySetting();
|
var qualitySetting = state.Quality;
|
||||||
|
|
||||||
if (string.Equals(videoCodec, "libx264", StringComparison.OrdinalIgnoreCase))
|
if (string.Equals(videoCodec, "libx264", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.MediaEncoding;
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
using MediaBrowser.Model.Drawing;
|
using MediaBrowser.Model.Drawing;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
@ -24,7 +25,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
public Stream LogFileStream { get; set; }
|
public Stream LogFileStream { get; set; }
|
||||||
public IProgress<double> Progress { get; set; }
|
public IProgress<double> Progress { get; set; }
|
||||||
public TaskCompletionSource<bool> TaskCompletionSource;
|
public TaskCompletionSource<bool> TaskCompletionSource;
|
||||||
|
public EncodingQuality Quality { get; set; }
|
||||||
public EncodingJobOptions Options { get; set; }
|
public EncodingJobOptions Options { get; set; }
|
||||||
public string InputContainer { get; set; }
|
public string InputContainer { get; set; }
|
||||||
public MediaSourceInfo MediaSource { get; set; }
|
public MediaSourceInfo MediaSource { get; set; }
|
||||||
|
@ -1,8 +1,7 @@
|
|||||||
using System.IO;
|
using MediaBrowser.Common.Configuration;
|
||||||
using MediaBrowser.Controller.Entities;
|
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
using MediaBrowser.Controller.LiveTv;
|
|
||||||
using MediaBrowser.Controller.MediaEncoding;
|
using MediaBrowser.Controller.MediaEncoding;
|
||||||
|
using MediaBrowser.Model.Configuration;
|
||||||
using MediaBrowser.Model.Dlna;
|
using MediaBrowser.Model.Dlna;
|
||||||
using MediaBrowser.Model.Dto;
|
using MediaBrowser.Model.Dto;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
@ -22,14 +21,16 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
private readonly ILogger _logger;
|
private readonly ILogger _logger;
|
||||||
private readonly ILibraryManager _libraryManager;
|
private readonly ILibraryManager _libraryManager;
|
||||||
private readonly IMediaSourceManager _mediaSourceManager;
|
private readonly IMediaSourceManager _mediaSourceManager;
|
||||||
|
private readonly IConfigurationManager _config;
|
||||||
|
|
||||||
protected static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
protected static readonly CultureInfo UsCulture = new CultureInfo("en-US");
|
||||||
|
|
||||||
public EncodingJobFactory(ILogger logger, ILibraryManager libraryManager, IMediaSourceManager mediaSourceManager)
|
public EncodingJobFactory(ILogger logger, ILibraryManager libraryManager, IMediaSourceManager mediaSourceManager, IConfigurationManager config)
|
||||||
{
|
{
|
||||||
_logger = logger;
|
_logger = logger;
|
||||||
_libraryManager = libraryManager;
|
_libraryManager = libraryManager;
|
||||||
_mediaSourceManager = mediaSourceManager;
|
_mediaSourceManager = mediaSourceManager;
|
||||||
|
_config = config;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<EncodingJob> CreateJob(EncodingJobOptions options, bool isVideoRequest, IProgress<double> progress, CancellationToken cancellationToken)
|
public async Task<EncodingJob> CreateJob(EncodingJobOptions options, bool isVideoRequest, IProgress<double> progress, CancellationToken cancellationToken)
|
||||||
@ -95,6 +96,10 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
|
|
||||||
TryStreamCopy(state, request);
|
TryStreamCopy(state, request);
|
||||||
|
|
||||||
|
state.Quality = options.Context == EncodingContext.Static ?
|
||||||
|
EncodingQuality.MaxQuality :
|
||||||
|
GetQualitySetting();
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -194,6 +199,30 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||||||
state.MediaSource = mediaSource;
|
state.MediaSource = mediaSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected EncodingQuality GetQualitySetting()
|
||||||
|
{
|
||||||
|
var quality = GetEncodingOptions().EncodingQuality;
|
||||||
|
|
||||||
|
if (quality == EncodingQuality.Auto)
|
||||||
|
{
|
||||||
|
var cpuCount = Environment.ProcessorCount;
|
||||||
|
|
||||||
|
if (cpuCount >= 4)
|
||||||
|
{
|
||||||
|
//return EncodingQuality.HighQuality;
|
||||||
|
}
|
||||||
|
|
||||||
|
return EncodingQuality.HighSpeed;
|
||||||
|
}
|
||||||
|
|
||||||
|
return quality;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected EncodingOptions GetEncodingOptions()
|
||||||
|
{
|
||||||
|
return _config.GetConfiguration<EncodingOptions>("encoding");
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Infers the video codec.
|
/// Infers the video codec.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -378,7 +378,7 @@ namespace MediaBrowser.Providers.Manager
|
|||||||
var providerName = provider.GetType().Name;
|
var providerName = provider.GetType().Name;
|
||||||
Logger.Debug("Running {0} for {1}", providerName, logName);
|
Logger.Debug("Running {0} for {1}", providerName, logName);
|
||||||
|
|
||||||
var itemInfo = new ItemInfo { Path = item.Path, IsInMixedFolder = item.IsInMixedFolder };
|
var itemInfo = new ItemInfo(item);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -437,8 +437,6 @@ namespace MediaBrowser.WebDashboard.Api
|
|||||||
"connectlogin.js",
|
"connectlogin.js",
|
||||||
"dashboardgeneral.js",
|
"dashboardgeneral.js",
|
||||||
"dashboardpage.js",
|
"dashboardpage.js",
|
||||||
"device.js",
|
|
||||||
"devices.js",
|
|
||||||
"devicesupload.js",
|
"devicesupload.js",
|
||||||
"directorybrowser.js",
|
"directorybrowser.js",
|
||||||
"dlnaprofile.js",
|
"dlnaprofile.js",
|
||||||
@ -458,16 +456,10 @@ namespace MediaBrowser.WebDashboard.Api
|
|||||||
"favorites.js",
|
"favorites.js",
|
||||||
"forgotpassword.js",
|
"forgotpassword.js",
|
||||||
"forgotpasswordpin.js",
|
"forgotpasswordpin.js",
|
||||||
"gamesrecommendedpage.js",
|
|
||||||
"gamesystemspage.js",
|
|
||||||
"gamespage.js",
|
|
||||||
"gamegenrepage.js",
|
|
||||||
"gamestudiospage.js",
|
|
||||||
"homelatest.js",
|
"homelatest.js",
|
||||||
"indexpage.js",
|
"indexpage.js",
|
||||||
"itembynamedetailpage.js",
|
"itembynamedetailpage.js",
|
||||||
"itemdetailpage.js",
|
"itemdetailpage.js",
|
||||||
"itemlistpage.js",
|
|
||||||
"kids.js",
|
"kids.js",
|
||||||
"librarypathmapping.js",
|
"librarypathmapping.js",
|
||||||
"reports.js",
|
"reports.js",
|
||||||
@ -506,9 +498,7 @@ namespace MediaBrowser.WebDashboard.Api
|
|||||||
"musicalbums.js",
|
"musicalbums.js",
|
||||||
"musicalbumartists.js",
|
"musicalbumartists.js",
|
||||||
"musicartists.js",
|
"musicartists.js",
|
||||||
"musicgenres.js",
|
|
||||||
"musicrecommended.js",
|
"musicrecommended.js",
|
||||||
"musicvideos.js",
|
|
||||||
|
|
||||||
"mypreferencesdisplay.js",
|
"mypreferencesdisplay.js",
|
||||||
"mypreferenceslanguages.js",
|
"mypreferenceslanguages.js",
|
||||||
@ -529,22 +519,16 @@ namespace MediaBrowser.WebDashboard.Api
|
|||||||
"scheduledtaskspage.js",
|
"scheduledtaskspage.js",
|
||||||
"search.js",
|
"search.js",
|
||||||
"selectserver.js",
|
"selectserver.js",
|
||||||
"serversecurity.js",
|
|
||||||
"songs.js",
|
"songs.js",
|
||||||
"streamingsettings.js",
|
"streamingsettings.js",
|
||||||
"supporterkeypage.js",
|
"supporterkeypage.js",
|
||||||
"supporterpage.js",
|
"supporterpage.js",
|
||||||
"syncactivity.js",
|
"syncactivity.js",
|
||||||
"syncsettings.js",
|
"syncsettings.js",
|
||||||
"episodes.js",
|
|
||||||
"thememediaplayer.js",
|
"thememediaplayer.js",
|
||||||
"tvgenres.js",
|
|
||||||
"tvlatest.js",
|
"tvlatest.js",
|
||||||
"tvpeople.js",
|
|
||||||
"tvrecommended.js",
|
"tvrecommended.js",
|
||||||
"tvshows.js",
|
"tvshows.js",
|
||||||
"tvstudios.js",
|
|
||||||
"tvupcoming.js",
|
|
||||||
"useredit.js",
|
"useredit.js",
|
||||||
"usernew.js",
|
"usernew.js",
|
||||||
"myprofile.js",
|
"myprofile.js",
|
||||||
|
@ -219,6 +219,9 @@
|
|||||||
<Content Include="dashboard-ui\cordovaindex.html">
|
<Content Include="dashboard-ui\cordovaindex.html">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Content Include="dashboard-ui\thirdparty\cordova\imagestore.js">
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
</Content>
|
||||||
<Content Include="dashboard-ui\thirdparty\cordova\remotecontrols.js">
|
<Content Include="dashboard-ui\thirdparty\cordova\remotecontrols.js">
|
||||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
|
@ -952,6 +952,11 @@ namespace MediaBrowser.XbmcMetadata.Parsers
|
|||||||
var userData = GetOrAdd(userDataList, userDataUserId);
|
var userData = GetOrAdd(userDataList, userDataUserId);
|
||||||
|
|
||||||
userData.PlayCount = parsedValue;
|
userData.PlayCount = parsedValue;
|
||||||
|
|
||||||
|
if (parsedValue > 0)
|
||||||
|
{
|
||||||
|
userData.Played = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -59,7 +59,7 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||||||
|
|
||||||
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
|
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService, DateTime date)
|
||||||
{
|
{
|
||||||
var file = GetXmlFile(new ItemInfo { IsInMixedFolder = item.IsInMixedFolder, Path = item.Path }, directoryService);
|
var file = GetXmlFile(new ItemInfo(item), directoryService);
|
||||||
|
|
||||||
if (file == null)
|
if (file == null)
|
||||||
{
|
{
|
||||||
|
@ -5,8 +5,10 @@ using MediaBrowser.Controller.Providers;
|
|||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using MediaBrowser.XbmcMetadata.Parsers;
|
using MediaBrowser.XbmcMetadata.Parsers;
|
||||||
|
using MediaBrowser.XbmcMetadata.Savers;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
|
||||||
namespace MediaBrowser.XbmcMetadata.Providers
|
namespace MediaBrowser.XbmcMetadata.Providers
|
||||||
@ -35,21 +37,9 @@ namespace MediaBrowser.XbmcMetadata.Providers
|
|||||||
|
|
||||||
protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
protected override FileSystemInfo GetXmlFile(ItemInfo info, IDirectoryService directoryService)
|
||||||
{
|
{
|
||||||
var path = GetMovieSavePath(info, FileSystem);
|
return MovieNfoSaver.GetMovieSavePaths(info, FileSystem)
|
||||||
|
.Select(directoryService.GetFile)
|
||||||
return directoryService.GetFile(path);
|
.FirstOrDefault(i => i != null);
|
||||||
}
|
|
||||||
|
|
||||||
public static string GetMovieSavePath(ItemInfo item, IFileSystem fileSystem)
|
|
||||||
{
|
|
||||||
if (Directory.Exists(item.Path))
|
|
||||||
{
|
|
||||||
var path = item.Path;
|
|
||||||
|
|
||||||
return Path.Combine(path, Path.GetFileName(path) + ".nfo");
|
|
||||||
}
|
|
||||||
|
|
||||||
return Path.ChangeExtension(item.Path, ".nfo");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,10 +4,12 @@ using MediaBrowser.Controller.Entities;
|
|||||||
using MediaBrowser.Controller.Entities.Movies;
|
using MediaBrowser.Controller.Entities.Movies;
|
||||||
using MediaBrowser.Controller.Entities.TV;
|
using MediaBrowser.Controller.Entities.TV;
|
||||||
using MediaBrowser.Controller.Library;
|
using MediaBrowser.Controller.Library;
|
||||||
|
using MediaBrowser.Controller.Providers;
|
||||||
using MediaBrowser.Model.Entities;
|
using MediaBrowser.Model.Entities;
|
||||||
using MediaBrowser.Model.Logging;
|
using MediaBrowser.Model.Logging;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
|
||||||
namespace MediaBrowser.XbmcMetadata.Savers
|
namespace MediaBrowser.XbmcMetadata.Savers
|
||||||
@ -20,21 +22,32 @@ namespace MediaBrowser.XbmcMetadata.Savers
|
|||||||
|
|
||||||
protected override string GetLocalSavePath(IHasMetadata item)
|
protected override string GetLocalSavePath(IHasMetadata item)
|
||||||
{
|
{
|
||||||
return GetMovieSavePath(item, FileSystem);
|
return GetMovieSavePaths(new ItemInfo(item), FileSystem).FirstOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string GetMovieSavePath(IHasMetadata item, IFileSystem fileSystem)
|
public static List<string> GetMovieSavePaths(ItemInfo item, IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
var video = (Video)item;
|
var list = new List<string>();
|
||||||
|
|
||||||
if (video.VideoType == VideoType.Dvd || video.VideoType == VideoType.BluRay || video.VideoType == VideoType.HdDvd)
|
if (item.VideoType == VideoType.Dvd)
|
||||||
{
|
{
|
||||||
var path = item.ContainingFolderPath;
|
var path = item.ContainingFolderPath;
|
||||||
|
|
||||||
return Path.Combine(path, Path.GetFileName(path) + ".nfo");
|
list.Add(Path.Combine(path, "VIDEO_TS.nfo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return Path.ChangeExtension(item.Path, ".nfo");
|
if (item.VideoType == VideoType.Dvd || item.VideoType == VideoType.BluRay || item.VideoType == VideoType.HdDvd)
|
||||||
|
{
|
||||||
|
var path = item.ContainingFolderPath;
|
||||||
|
|
||||||
|
list.Add(Path.Combine(path, Path.GetFileName(path) + ".nfo"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list.Add(Path.ChangeExtension(item.Path, ".nfo"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override string GetRootElementName(IHasMetadata item)
|
protected override string GetRootElementName(IHasMetadata item)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user