Ejemplo n.º 1
0
        private List<BaseItem> GetTaggedItems(IItemByName byName, User user)
        {
            var person = byName as Person;

            if (person != null)
            {
                var items = _libraryManager.GetItems(new InternalItemsQuery
                {
                    Person = byName.Name

                }).Items;

                if (user != null)
                {
                    return items.Where(i => i.IsVisibleStandalone(user)).ToList();
                }

                return items.ToList();
            }

            var itemFilter = byName.GetItemFilter();

            return user != null ?
               user.RootFolder.GetRecursiveChildren(user, itemFilter).ToList() :
               _libraryManager.RootFolder.GetRecursiveChildren(itemFilter).ToList();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Attaches the item by name counts.
        /// </summary>
        /// <param name="dto">The dto.</param>
        /// <param name="item">The item.</param>
        /// <param name="user">The user.</param>
        private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user)
        {
            if (user == null)
            {
                //counts = item.ItemCounts;
                return;
            }

            ItemByNameCounts counts = item.GetItemByNameCounts(user.Id) ?? new ItemByNameCounts();

            dto.ChildCount = counts.TotalCount;

            dto.AdultVideoCount = counts.AdultVideoCount;
            dto.AlbumCount = counts.AlbumCount;
            dto.EpisodeCount = counts.EpisodeCount;
            dto.GameCount = counts.GameCount;
            dto.MovieCount = counts.MovieCount;
            dto.MusicVideoCount = counts.MusicVideoCount;
            dto.SeriesCount = counts.SeriesCount;
            dto.SongCount = counts.SongCount;
            dto.TrailerCount = counts.TrailerCount;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Attaches the item by name counts.
        /// </summary>
        /// <param name="dto">The dto.</param>
        /// <param name="item">The item.</param>
        /// <param name="user">The user.</param>
        private void AttachItemByNameCounts(BaseItemDto dto, IItemByName item, User user)
        {
            ItemByNameCounts counts;

            if (user == null)
            {
                //counts = item.ItemCounts;
                return;
            }
            if (!item.UserItemCounts.TryGetValue(user.Id, out counts))
            {
                counts = new ItemByNameCounts();
            }

            dto.ChildCount = counts.TotalCount;

            dto.AdultVideoCount = counts.AdultVideoCount;
            dto.AlbumCount = counts.AlbumCount;
            dto.EpisodeCount = counts.EpisodeCount;
            dto.GameCount = counts.GameCount;
            dto.MovieCount = counts.MovieCount;
            dto.MusicVideoCount = counts.MusicVideoCount;
            dto.SeriesCount = counts.SeriesCount;
            dto.SongCount = counts.SongCount;
            dto.TrailerCount = counts.TrailerCount;
        }
Ejemplo n.º 4
0
        private List<BaseItem> GetTaggedItems(IItemByName byName, User user)
        {
            var items = byName.GetTaggedItems(new InternalItemsQuery(user)
            {
                Recursive = true

            }).ToList();

            return items;
        }
Ejemplo n.º 5
0
        private List<BaseItem> GetTaggedItems(IItemByName byName, User user)
        {
            var person = byName as Person;

            if (person != null)
            {
                var items = _libraryManager.GetItems(new InternalItemsQuery(user)
                {
                    Person = byName.Name

                }, new string[] { });

                return items.ToList();
            }

            var itemFilter = byName.GetItemFilter();

            return user != null ?
               user.RootFolder.GetRecursiveChildren(user, itemFilter).ToList() :
               _libraryManager.RootFolder.GetRecursiveChildren(itemFilter).ToList();
        }