2015-04-15 17:59:20 -04:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
2015-07-29 16:31:15 -04:00
|
|
|
|
using System.Linq;
|
2014-10-11 21:46:02 -04:00
|
|
|
|
|
2013-02-20 20:33:05 -05:00
|
|
|
|
namespace MediaBrowser.Controller.Entities
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// This is just a marker interface to denote top level folders
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public interface ICollectionFolder
|
|
|
|
|
|
{
|
2014-06-14 19:13:09 -04:00
|
|
|
|
string CollectionType { get; }
|
2014-10-11 21:46:02 -04:00
|
|
|
|
string Path { get; }
|
2015-04-15 17:59:20 -04:00
|
|
|
|
string Name { get; }
|
|
|
|
|
|
Guid Id { get; }
|
2014-10-11 21:46:02 -04:00
|
|
|
|
IEnumerable<string> PhysicalLocations { get; }
|
2013-02-20 20:33:05 -05:00
|
|
|
|
}
|
2015-07-29 16:31:15 -04:00
|
|
|
|
|
2015-11-14 11:58:01 -05:00
|
|
|
|
public interface ISupportsUserSpecificView
|
|
|
|
|
|
{
|
|
|
|
|
|
bool EnableUserSpecificView { get; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-07-29 16:31:15 -04: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-20 20:33:05 -05:00
|
|
|
|
}
|