mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 10:04:44 +01:00
Removed vf collection type
This commit is contained in:
parent
81c16c305b
commit
42a2835633
@@ -227,9 +227,40 @@ namespace MediaBrowser.Controller
|
||||
|
||||
user.Name = "Default User";
|
||||
user.Id = Guid.Parse("5d1cf7fce25943b790d140095457a42b");
|
||||
user.PrimaryImagePath = "D:\\Video\\TV\\Archer (2009)\\folder.jpg";
|
||||
|
||||
list.Add(user);
|
||||
|
||||
user = new User();
|
||||
user.Name = "Test User 1";
|
||||
user.Id = Guid.NewGuid();
|
||||
list.Add(user);
|
||||
|
||||
user = new User();
|
||||
user.Name = "Test User 2";
|
||||
user.Id = Guid.NewGuid();
|
||||
list.Add(user);
|
||||
|
||||
user = new User();
|
||||
user.Name = "Test User 3";
|
||||
user.Id = Guid.NewGuid();
|
||||
list.Add(user);
|
||||
|
||||
user = new User();
|
||||
user.Name = "Test User 4";
|
||||
user.Id = Guid.NewGuid();
|
||||
list.Add(user);
|
||||
|
||||
user = new User();
|
||||
user.Name = "Test User 5";
|
||||
user.Id = Guid.NewGuid();
|
||||
list.Add(user);
|
||||
|
||||
user = new User();
|
||||
user.Name = "Test User 6";
|
||||
user.Id = Guid.NewGuid();
|
||||
list.Add(user);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace MediaBrowser.Controller.Library
|
||||
{
|
||||
for (int i = 0; i < FileSystemChildren.Length; i++)
|
||||
{
|
||||
if (System.IO.Path.GetFileName(FileSystemChildren[i].Path).Equals(name, StringComparison.OrdinalIgnoreCase))
|
||||
if (FileSystemChildren[i].cFileName.Equals(name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -42,15 +42,7 @@ namespace MediaBrowser.Controller.Library
|
||||
|
||||
public bool ContainsFolder(string name)
|
||||
{
|
||||
for (int i = 0; i < FileSystemChildren.Length; i++)
|
||||
{
|
||||
if (System.IO.Path.GetFileName(FileSystemChildren[i].Path).Equals(name, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
return ContainsFile(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,34 +69,6 @@ namespace MediaBrowser.Controller.Library
|
||||
}
|
||||
}
|
||||
|
||||
public VirtualFolder VirtualFolder
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Parent != null)
|
||||
{
|
||||
return Parent.VirtualFolder;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string VirtualFolderCollectionType
|
||||
{
|
||||
get
|
||||
{
|
||||
VirtualFolder vf = VirtualFolder;
|
||||
|
||||
if (vf == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return vf.CollectionType;
|
||||
}
|
||||
}
|
||||
|
||||
public bool IsHidden
|
||||
{
|
||||
get
|
||||
|
||||
@@ -77,7 +77,6 @@
|
||||
<Compile Include="Resolvers\BaseItemResolver.cs" />
|
||||
<Compile Include="Resolvers\FolderResolver.cs" />
|
||||
<Compile Include="Resolvers\VideoResolver.cs" />
|
||||
<Compile Include="Resolvers\VirtualFolderResolver.cs" />
|
||||
<Compile Include="Xml\BaseItemXmlParser.cs" />
|
||||
<Compile Include="Xml\XmlExtensions.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
using System.ComponentModel.Composition;
|
||||
using System.IO;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Model.Entities;
|
||||
|
||||
namespace MediaBrowser.Controller.Resolvers
|
||||
{
|
||||
[Export(typeof(IBaseItemResolver))]
|
||||
public class VirtualFolderResolver : BaseFolderResolver<VirtualFolder>
|
||||
{
|
||||
public override ResolverPriority Priority
|
||||
{
|
||||
get { return ResolverPriority.Third; }
|
||||
}
|
||||
|
||||
protected override VirtualFolder Resolve(ItemResolveEventArgs args)
|
||||
{
|
||||
if (args.IsDirectory && args.Parent != null && args.Parent.IsRoot)
|
||||
{
|
||||
return new VirtualFolder();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
protected override void SetInitialItemValues(VirtualFolder item, ItemResolveEventArgs args)
|
||||
{
|
||||
// Set the name initially by stripping off the [CollectionType=...]
|
||||
// The name can always be overridden later by folder.xml
|
||||
string pathName = Path.GetFileNameWithoutExtension(args.Path);
|
||||
|
||||
string srch = "[collectiontype=";
|
||||
int index = pathName.IndexOf(srch, System.StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
item.Name = pathName.Substring(0, index).Trim();
|
||||
|
||||
item.CollectionType = pathName.Substring(index + srch.Length).TrimEnd(']');
|
||||
}
|
||||
|
||||
base.SetInitialItemValues(item, args);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user