2015-04-15 23:59:20 +02:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2015-07-29 22:31:15 +02:00
|
|
|
|
using System.Linq;
|
2014-10-12 03:46:02 +02:00
|
|
|
|
|
2013-02-21 02:33:05 +01:00
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// This is just a marker interface to denote top level folders
|
|
|
|
|
/// </summary>
|
|
|
|
|
public interface ICollectionFolder
|
|
|
|
|
{
|
2014-06-15 01:13:09 +02:00
|
|
|
|
string CollectionType { get; }
|
2014-10-12 03:46:02 +02:00
|
|
|
|
string Path { get; }
|
2015-04-15 23:59:20 +02:00
|
|
|
|
string Name { get; }
|
|
|
|
|
Guid Id { get; }
|
2014-10-12 03:46:02 +02:00
|
|
|
|
IEnumerable<string> PhysicalLocations { get; }
|
2013-02-21 02:33:05 +01:00
|
|
|
|
}
|
2015-07-29 22:31:15 +02:00
|
|
|
|
|
|
|
|
|
public static class CollectionFolderExtensions
|
|
|
|
|
{
|
|
|
|
|
public static string GetViewType(this ICollectionFolder folder, User user)
|
|
|
|
|
{
|
|
|
|
|
if (user.Configuration.PlainFolderViews.Contains(folder.Id.ToString("N"), StringComparer.OrdinalIgnoreCase))
|
|
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return folder.CollectionType;
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-02-21 02:33:05 +01:00
|
|
|
|
}
|