aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2014-11-16 17:46:01 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2014-11-16 17:46:01 -0500
commit049ef9b4ecd2c884e0ddb062b606770ef7f2dfa9 (patch)
tree13bb922d8203bcb8e9abb4d9dc2272e2d425bad6 /MediaBrowser.Server.Implementations/Library
parent5fdd7ec6725a3acb3365e92c090f2e90bbbf122f (diff)
update naming methods
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs22
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs8
-rw-r--r--MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs4
3 files changed, 26 insertions, 8 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 3ed682002..e2a2ce0a4 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -21,7 +21,6 @@ using MediaBrowser.Naming.Video;
using MediaBrowser.Server.Implementations.Library.Resolvers.TV;
using MediaBrowser.Server.Implementations.Library.Validators;
using MediaBrowser.Server.Implementations.ScheduledTasks;
-using MoreLinq;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
@@ -1635,8 +1634,8 @@ namespace MediaBrowser.Server.Implementations.Library
public bool IsVideoFile(string path)
{
- var parser = new VideoFileParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger());
- return parser.IsVideoFile(path);
+ var resolver = new VideoResolver(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger());
+ return resolver.IsVideoFile(path);
}
public bool IsAudioFile(string path)
@@ -1647,13 +1646,13 @@ namespace MediaBrowser.Server.Implementations.Library
public bool IsMultiPartFile(string path)
{
- var parser = new MultiPartParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger());
+ var parser = new MultiPartParser(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger());
return parser.Parse(path, FileInfoType.File).IsMultiPart;
}
public bool IsMultiPartFolder(string path)
{
- var parser = new MultiPartParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger());
+ var parser = new MultiPartParser(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger());
return parser.Parse(path, FileInfoType.Directory).IsMultiPart;
}
@@ -1676,5 +1675,18 @@ namespace MediaBrowser.Server.Implementations.Library
{
return SeriesResolver.GetEpisodeNumberFromFile(path, considerSeasonless);
}
+
+ public ItemLookupInfo ParseName(string name)
+ {
+ var resolver = new VideoResolver(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger());
+
+ var result = resolver.CleanDateTime(name);
+
+ return new ItemLookupInfo
+ {
+ Name = result.Name,
+ Year = result.Year
+ };
+ }
}
}
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
index 9ff1223b0..ba2a32c13 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/BaseVideoResolver.cs
@@ -1,6 +1,7 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Entities;
+using MediaBrowser.Naming.Audio;
using MediaBrowser.Naming.Video;
using System;
@@ -42,8 +43,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
// If the path is a file check for a matching extensions
if (!args.IsDirectory)
{
- var parser = new VideoFileParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger());
- var videoInfo = parser.ParseFile(args.Path);
+ var parser = new Naming.Video.VideoResolver(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger());
+ var videoInfo = parser.ResolveFile(args.Path);
if (videoInfo == null)
{
@@ -67,7 +68,8 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers
IsInMixedFolder = true,
IsPlaceHolder = videoInfo.IsStub,
IsShortcut = isShortcut,
- Name = videoInfo.Name
+ Name = videoInfo.Name,
+ ProductionYear = videoInfo.Year
};
if (videoInfo.IsStub)
diff --git a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
index 3082872fd..839b14a9e 100644
--- a/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
+++ b/MediaBrowser.Server.Implementations/Library/Resolvers/TV/EpisodeResolver.cs
@@ -70,6 +70,10 @@ namespace MediaBrowser.Server.Implementations.Library.Resolvers.TV
if (episode != null)
{
+ // The base video resolver is going to fill these in, so null them out
+ episode.ProductionYear = null;
+ episode.Name = null;
+
if (season != null)
{
episode.ParentIndexNumber = season.IndexNumber;