diff options
Diffstat (limited to 'MediaBrowser.Controller/Kernel.cs')
| -rw-r--r-- | MediaBrowser.Controller/Kernel.cs | 160 |
1 files changed, 0 insertions, 160 deletions
diff --git a/MediaBrowser.Controller/Kernel.cs b/MediaBrowser.Controller/Kernel.cs index c11a40750..9bf7021e1 100644 --- a/MediaBrowser.Controller/Kernel.cs +++ b/MediaBrowser.Controller/Kernel.cs @@ -12,7 +12,6 @@ using MediaBrowser.Controller.Events; using MediaBrowser.Controller.IO;
using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Resolvers;
-using MediaBrowser.Model.DTO;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Progress;
using MediaBrowser.Model.Users;
@@ -198,165 +197,6 @@ namespace MediaBrowser.Controller }
/// <summary>
- /// Gets all years from all recursive children of a folder
- /// The CategoryInfo class is used to keep track of the number of times each year appears
- /// </summary>
- public IEnumerable<IBNItem<Year>> GetAllYears(Folder parent, User user)
- {
- Dictionary<int, int> data = new Dictionary<int, int>();
-
- // Get all the allowed recursive children
- IEnumerable<BaseItem> allItems = parent.GetParentalAllowedRecursiveChildren(user);
-
- foreach (var item in allItems)
- {
- // Add the year from the item to the data dictionary
- // If the year already exists, increment the count
- if (item.ProductionYear == null)
- {
- continue;
- }
-
- if (!data.ContainsKey(item.ProductionYear.Value))
- {
- data.Add(item.ProductionYear.Value, 1);
- }
- else
- {
- data[item.ProductionYear.Value]++;
- }
- }
-
- // Now go through the dictionary and create a Category for each studio
- List<IBNItem<Year>> list = new List<IBNItem<Year>>();
-
- foreach (int key in data.Keys)
- {
- // Get the original entity so that we can also supply the PrimaryImagePath
- Year entity = Kernel.Instance.ItemController.GetYear(key);
-
- if (entity != null)
- {
- list.Add(new IBNItem<Year>()
- {
- Item = entity,
- BaseItemCount = data[key]
- });
- }
- }
-
- return list;
- }
-
- /// <summary>
- /// Gets all studios from all recursive children of a folder
- /// The CategoryInfo class is used to keep track of the number of times each studio appears
- /// </summary>
- public IEnumerable<IBNItem<Studio>> GetAllStudios(Folder parent, User user)
- {
- Dictionary<string, int> data = new Dictionary<string, int>();
-
- // Get all the allowed recursive children
- IEnumerable<BaseItem> allItems = parent.GetParentalAllowedRecursiveChildren(user);
-
- foreach (var item in allItems)
- {
- // Add each studio from the item to the data dictionary
- // If the studio already exists, increment the count
- if (item.Studios == null)
- {
- continue;
- }
-
- foreach (string val in item.Studios)
- {
- if (!data.ContainsKey(val))
- {
- data.Add(val, 1);
- }
- else
- {
- data[val]++;
- }
- }
- }
-
- // Now go through the dictionary and create a Category for each studio
- List<IBNItem<Studio>> list = new List<IBNItem<Studio>>();
-
- foreach (string key in data.Keys)
- {
- // Get the original entity so that we can also supply the PrimaryImagePath
- Studio entity = Kernel.Instance.ItemController.GetStudio(key);
-
- if (entity != null)
- {
- list.Add(new IBNItem<Studio>()
- {
- Item = entity,
- BaseItemCount = data[key]
- });
- }
- }
-
- return list;
- }
-
- /// <summary>
- /// Gets all genres from all recursive children of a folder
- /// The CategoryInfo class is used to keep track of the number of times each genres appears
- /// </summary>
- public IEnumerable<IBNItem<Genre>> GetAllGenres(Folder parent, User user)
- {
- Dictionary<string, int> data = new Dictionary<string, int>();
-
- // Get all the allowed recursive children
- IEnumerable<BaseItem> allItems = parent.GetParentalAllowedRecursiveChildren(user);
-
- foreach (var item in allItems)
- {
- // Add each genre from the item to the data dictionary
- // If the genre already exists, increment the count
- if (item.Genres == null)
- {
- continue;
- }
-
- foreach (string val in item.Genres)
- {
- if (!data.ContainsKey(val))
- {
- data.Add(val, 1);
- }
- else
- {
- data[val]++;
- }
- }
- }
-
- // Now go through the dictionary and create a Category for each genre
- List<IBNItem<Genre>> list = new List<IBNItem<Genre>>();
-
- foreach (string key in data.Keys)
- {
- // Get the original entity so that we can also supply the PrimaryImagePath
- Genre entity = Kernel.Instance.ItemController.GetGenre(key);
-
- if (entity != null)
- {
- list.Add(new IBNItem<Genre>()
- {
- Item = entity,
- BaseItemCount = data[key]
- });
- }
- }
-
- return list;
- }
-
- /// <summary>
/// Gets all users within the system
/// </summary>
private IEnumerable<User> GetAllUsers()
|
