Example #1
0
        /* <summary>
         * Gets all the dos games that the user has added
         *</summary>
         *<param name="request"></param>
         *<returns></returns>
         */
        public object Get(GetDosGames request)
        {
            _logger.Debug("GetDosGames request received");
            var dosGames = _libraryManager.GetItemList(new InternalItemsQuery {
                IncludeItemTypes = new[] {
                    typeof(Game).Name
                },
                OrderBy = new[] {
                    new ValueTuple <string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending)
                }
            }).ToList();

            var gameNameList = new List <String>();

            if (dosGames.Count > 0)
            {
                foreach (var item in dosGames)
                {
                    var parent = item.FindParent <GameSystem>();
                    if (parent.Name == "DOS")
                    {
                        gameNameList.Add(item.Name);
                    }
                }
            }
            return(new GameQueryResult {
                TotalCount = gameNameList.Count,
                GameTitles = gameNameList.ToArray()
            });
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public object Get(GetDosGames request)
        {
            _logger.Debug("GetDosGames request received");

            var dosGames = _libraryManager.RootFolder.RecursiveChildren
                .Where(i => i is Game && !string.IsNullOrEmpty(((Game)i).GameSystem) && ((Game)i).GameSystem.Equals(MediaBrowser.Model.Games.GameSystem.DOS))
                .OrderBy(i => i.SortName)
                .ToList();

            var gameNameList = new List<String>();

            if (dosGames.Count > 0)
                gameNameList.AddRange(dosGames.Select(bi => bi.Name));

            return new GameQueryResult
            {
                TotalCount = gameNameList.Count,
                GameTitles = gameNameList.ToArray()
            };
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public object Get(GetDosGames request)
        {
            _logger.Debug("GetDosGames request received");

            var dosGames = _libraryManager.RootFolder.RecursiveChildren
                           .Where(i => i is Game && !string.IsNullOrEmpty(((Game)i).GameSystem) && ((Game)i).GameSystem.Equals(MediaBrowser.Model.Games.GameSystem.DOS))
                           .OrderBy(i => i.SortName)
                           .ToList();

            var gameNameList = new List <String>();

            if (dosGames.Count > 0)
            {
                gameNameList.AddRange(dosGames.Select(bi => bi.Name));
            }

            return(new GameQueryResult
            {
                TotalCount = gameNameList.Count,
                GameTitles = gameNameList.ToArray()
            });
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        public object Get(GetDosGames request)
        {
            _logger.Debug("GetDosGames request received");

            var dosGames = _libraryManager.GetItemList(new InternalItemsQuery
            {
                IncludeItemTypes = new[] { typeof(Game).Name },
                OrderBy          = new[] { new ValueTuple <string, SortOrder>(ItemSortBy.SortName, SortOrder.Ascending) }
            })
                           //.Where(i => i is Game && !string.IsNullOrEmpty(((Game)i).GameSystem) && ((Game)i).GameSystem.Equals("DOS"))
                           .ToList();

            var gameNameList = new List <String>();

            //if (dosGames.Count > 0)
            //    gameNameList.AddRange(dosGames.Select(bi => bi.Name));

            return(new GameQueryResult
            {
                TotalCount = gameNameList.Count,
                GameTitles = gameNameList.ToArray()
            });
        }