示例#1
0
        public ICollection <string> GetMediaCategories(ResourcePath path)
        {
            ISystemResolver systemResolver = ServiceRegistration.Get <ISystemResolver>();
            IMediaLibrary   mediaLibrary   = ServiceRegistration.Get <IMediaLibrary>();

            ICollection <Share> shares = mediaLibrary.GetShares(systemResolver.LocalSystemId).Values;
            Share bestShare            = SharesHelper.BestContainingPath(shares, path);

            List <string> categories = new List <string>();

            if (bestShare != null)
            {
                categories.AddRange(bestShare.MediaCategories);
            }
            return(categories);
        }
示例#2
0
        public ICollection <string> GetMediaCategories(ResourcePath path)
        {
            List <string> categories     = new List <string>();
            var           systemResolver = ServiceRegistration.Get <ISystemResolver>();
            var           scm            = ServiceRegistration.Get <IServerConnectionManager>();
            var           cd             = ServiceRegistration.Get <IServerConnectionManager>().ContentDirectory;

            if (cd == null)
            {
                return(categories);
            }

            ICollection <Share> shares = cd.GetSharesAsync(systemResolver.LocalSystemId, SharesFilter.All).Result;
            Share bestShare            = SharesHelper.BestContainingPath(shares, path);

            if (bestShare != null)
            {
                categories.AddRange(bestShare.MediaCategories);
            }
            return(categories);
        }